用量
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 子參數會決定 AI 代理是否在對話回覆中顯示執行記錄和診斷資訊。
接受 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]