數據代理程式是一項功能強大的工具,旨在增強數據結果的正確性,並提供建立者將商務內容併入其數據查詢的方法。 藉由使用數據代理程式,用戶可以透過自然語言與數據互動,讓複雜的數據作業更容易存取且可採取動作。
此外,數據代理程式可協助建立、策展及設定數據專家,讓組織能夠建置可反映其獨特程式、案例和商業規則的自定義解決方案。 此自定義可確保產生的深入解析不僅準確,而且與內容相關。
本文說明可用來增強數據代理程序的各種設定。
數據代理程式指示
數據代理程式指示會引導代理程式產生正確且相關的用戶問題回應。 這些指示可以指定要設定優先順序的數據源、概述如何處理特定類型的查詢,並提供實用的術語或內容來解譯使用者意圖。
以下是撰寫有效代理程式層級指示的建議起始格式:
## Objective
// Describe the overall goal of the agent.
// Example: "Help users analyze retail sales performance and customer behavior across regions."
## Data sources
// Specify which data sources the agent should consider, and in what order of priority.
// Example: "Use 'SalesLakehouse' for product and transaction data. Use 'CRMModel' for customer demographics."
## Key terminology
// Define terms or acronyms the agent may encounter in user queries.
// Example: "'GMV' refers to Gross Merchandise Value."
## Response guidelines
// Set expectations for how the agent should format or present answers.
// Example: ""
## Handling common topics
// Provide special handling rules or context for frequently asked topics.
// Example: "When asked about customers, use the 'ChurnModelScoring' Lakehouse to get customer details. Then, list any open support tickets"
數據源指示
當代理將問題路由至指定的數據來源時,會套用數據來源指示。 這些指示提供建構精確查詢所需的內容,無論是在 SQL、DAX 或 KQL 中,都能讓代理程式擷取精確的資訊。
本節應包含數據源特定指引,例如相關數據表、數據行、關聯性,以及回答常見或複雜問題所需的任何查詢邏輯。 提供的內容越多,代理程式就能產生精確且有意義的查詢。
使用下列樣本作為起點:
## General knowledge
// Share general background information the agent should consider when querying this data source.
## Table descriptions
// Describe key tables and important columns within those tables.
## When asked about
// Provide query-specific logic or table preferences for certain topics.
// Example: “When asked about shoe sales, always use the SalesProduct table.”
數據源範例查詢
數據代理工具使用範例查詢,也稱為少數示例,以改善生成查詢的品質。 其可讓建立者傳遞代理程式在形成回應時可以參考的範例查詢邏輯。 使用數據源時,對應的工具會自動查閱用戶問題最相關的範例查詢,並將前三名傳遞給數據代理程式工具。 這些範例會併入產生程式,協助代理程式產生更精確且內容適當的查詢結果。