用量
agent: agent_name { advanced_analytics: yes | no description: "string" instructions: "string" is_dashboard_agent: yes | no show_debuginfo: yes | no show_thinking: yes | no }
|
階層
模型檔案或 LookML 檔案
agent |
預設值
無
接受
|
定義
agent 參數會定義 LookML 資訊主頁的資料代理。開發人員可以使用這項參數及其子參數,在版本管控的 LookML 中,為與單一 LookML 資訊主頁相關聯的單一代理,定義自訂代理指令、分析行為和顯示偏好設定。
開發人員可以使用 default_dashboard_agent 參數,將資訊主頁代理與單一 LookML 資訊主頁建立關聯。
無法在 LookML 中定義使用者定義資訊主頁或探索的資料代理。
如要進一步瞭解如何設定及使用 LookML 資訊主頁代理,請參閱「建立及管理 LookML 資訊主頁的資料代理」說明文件頁面。
子參數
資訊主頁代理程式定義支援下列子參數:
advanced_analytics
advanced_analytics 子參數可控制代理是否能使用進階數據分析,生成及執行 Python 程式碼,進行複雜運算和自訂視覺化。
接受 yes 或 no。預設值為 no。
description
description 子參數提供選用的文字說明,說明代理程式的用途。
agent: sales_agent {
description: "Executive sales overview dashboard agent"
is_dashboard_agent: yes
}
instructions
instructions 子參數接受任意形式的字串,可為代理提供業務背景資訊、偏好欄位、篩選規則,或處理對話問題時的語氣。
agent: sales_agent {
instructions: "Focus on net revenue and filter by current quarter by default."
is_dashboard_agent: yes
}
您可以使用 @{<var>CONSTANT_NAME</var>} 語法,在 instructions 中參照 LookML 常數:
agent: sales_agent {
instructions: "Focus on net revenue. @{FISCAL_YEAR_RULE}"
is_dashboard_agent: yes
}
如省略,代理運作時不會有自訂指令情境。
is_dashboard_agent
is_dashboard_agent 子參數會指定代理是否設為資訊主頁代理。
接受 yes 或 no。如要搭配 LookML 資訊主頁使用代理,請將這項參數設為 yes。
show_debuginfo
show_debuginfo 子參數會決定代理是否在對話回覆中顯示執行記錄和診斷資訊。
接受 yes 或 no。預設值為 no。
show_thinking
show_thinking 子參數會決定代理是否在對話回覆中顯示推論步驟和中繼查詢計畫。
接受 yes 或 no。預設值為 no。
範例
定義 LookML 資訊主頁代理
以下範例定義了 LookML 資訊主頁代理,並啟用自訂指令、進階數據分析和思考過程顯示功能:
agent: customer_insights_agent {
instructions: "Address the user politely. Prioritize active subscriber metrics and churn analysis."
description: "Dashboard agent for Customer Insights dashboard."
is_dashboard_agent: yes
advanced_analytics: yes
show_thinking: yes
show_debuginfo: no
}
如要在 LookML 資訊主頁使用這個代理,請在 .dashboard.lookml 檔案中對應:
- dashboard: customer_insights
title: "Customer Insights"
layout: newspaper
enabled_dashboard_agents: true
default_dashboard_agent: customer_insights_agent
elements:
- name: active_subscribers
type: single_value
model: subscriptions
explore: customers
measures: [customers.count]