你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

Knowledge Retrieval - Retrieve Stream

从后备存储器获取相关数据,并以服务器发送的事件形式流传进度和结果。

使用服务器发送的事件帧法,以增量方式处理响应。 每个事件都包含一个事件名称和一个 JSON 编码的数据负载。 直播以事件 response.completed 或事件 error 结束。 OpenAPI 2.0 将响应体表示为字符串,因此生成的客户端可以在不进行类型事件解析的情况下公开原始响应。 不要将完整的响应体反序列化为单一 JSON 文档。

POST {endpoint}/knowledgebases('{knowledgeBaseName}')/retrieve?_overload=retrieveStream&api-version=2026-11-01-preview

URI 参数

名称 在 必需 类型 说明
endpoint
path True

string (uri)

搜索服务的终结点 URL。

knowledgeBaseName
path True

string

知识库的名称。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求标头

名称 必需 类型 说明
Accept True

Accept

接受(Accept)首部。

x-ms-query-source-authorization

string (password)

标识正在执行查询的用户的令牌。 此令牌用于对文档实施安全限制。

x-ms-query-work-iq-source-authorization

string (password)

用户声明令牌用于在 Work IQ 知识源上配置的客户拥有的 Entra 应用注册。 用于代表 Work IQ API 进行认证。

x-ms-client-request-id

string (uuid)

请求的不透明、全局唯一的客户端生成的字符串标识符。

请求正文

名称 类型 说明
includeActivity

boolean

指示检索结果应包括活动信息。

intents KnowledgeRetrievalIntent[]:

KnowledgeRetrievalSemanticIntent[]

无需模型查询规划即可执行的预期查询列表。

knowledgeSourceParams KnowledgeSourceParams[]:

知识源的运行时参数列表。

maxOutputDocuments

integer (int32)

限制输出中最大文档数量。

maxOutputSize

integer (int32)

限制输出中内容的最大大小。

maxOutputSizeInTokens

integer (int32)

限制输出中内容的最大大小。

maxRuntimeInSeconds

integer (int32)

最大运行时间(以秒为单位)。

messages

KnowledgeBaseMessage[]

聊天消息样式输入的列表。

outputMode

KnowledgeRetrievalOutputMode

此检索的输出配置。

retrievalReasoningEffort KnowledgeRetrievalReasoningEffort:

检索推理努力配置。

toolName

string

要选择的工具。 在全KB检索时省略。

响应

名称 类型 说明
200 OK

string

请求已成功。

Media Types: "text/event-stream", "application/json"

Other Status Codes

ErrorResponse

未预期的错误响应。

Media Types: "text/event-stream", "application/json"

安全性

api-key

类型: apiKey
在: header

OAuth2Auth

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

作用域

名称 说明
https://search.azure.com/.default

示例

KnowledgeBaseRetrieveStream

示例请求

POST https://typespecpreviewexampleservice.search.windows.net/knowledgebases('base-preview-test')/retrieve?_overload=retrieveStream&api-version=2026-11-01-preview





{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "hello world"
        }
      ]
    }
  ],
  "maxRuntimeInSeconds": 60,
  "maxOutputSize": 100000,
  "maxOutputDocuments": 50,
  "retrievalReasoningEffort": {
    "kind": "low"
  },
  "includeActivity": true,
  "outputMode": "answerSynthesis",
  "knowledgeSourceParams": [
    {
      "knowledgeSourceName": "ks-preview-test",
      "includeReferences": true,
      "includeReferenceSourceData": true,
      "alwaysQuerySource": false,
      "neverQuerySource": false,
      "failOnError": false,
      "rerankerThreshold": 2.1,
      "resultsProcessing": "rerank",
      "kind": "searchIndex",
      "filterAddOn": "foo eq bar",
      "queryHintOverrides": {
        "filters": [
          {
            "field": "country",
            "fieldValues": [
              "United States",
              "Japan",
              "France",
              "Germany"
            ],
            "filterInstructions": "Country associated with the document."
          }
        ],
        "boosts": [
          {
            "kind": "fieldValue",
            "boostInstructions": "Prefer documents matching the user's locale.",
            "field": "language",
            "fieldValues": [
              "en-US",
              "ja-JP",
              "fr-FR",
              "de-DE"
            ],
            "boost": 1.5
          }
        ]
      },
      "topicGraph": {
        "kind": "diverse",
        "diversityFactor": 0.1
      }
    }
  ],
  "toolName": "product-search"
}

示例响应

"event: retrieval.started\ndata: {\"requestId\":\"00000000-0000-0000-0000-000000000000\",\"knowledgeBaseName\":\"base-preview-test\",\"outputMode\":\"answerSynthesis\",\"reasoningEffort\":{\"kind\":\"low\"}}\n\nevent: activity.started\ndata: {\"id\":0,\"type\":\"modelQueryPlanning\",\"startedAt\":\"2025-01-01T00:08:45.045Z\"}\n\nevent: activity.completed\ndata: {\"type\":\"modelQueryPlanning\",\"id\":0,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"inputTokens\":11,\"outputTokens\":22,\"elapsedMs\":1234,\"model\":{\"modelName\":\"gpt-4o\",\"deploymentId\":\"gpt-4o-deployment\"}}\n\nevent: activity.started\ndata: {\"id\":1,\"type\":\"searchIndex\",\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"knowledgeSourceName\":\"ks-preview-test\"}\n\nevent: activity.completed\ndata: {\"type\":\"searchIndex\",\"id\":1,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"knowledgeSourceName\":\"ks-preview-test\",\"queryTime\":\"2025-01-01T00:08:45.045Z\",\"count\":2,\"elapsedMs\":1234,\"searchIndexArguments\":{\"search\":\"hello world\",\"filter\":\"((category eq 'news') and ((id ne null) and (foo eq bar))) and (Key eq 'myDocKey1')\",\"semanticConfigurationName\":\"testconfig\",\"queryType\":\"simple\",\"sourceDataFields\":[{\"name\":\"category\"},{\"name\":\"description\"},{\"name\":\"ownerId\"},{\"name\":\"id\"}],\"searchFields\":[]},\"queryHintProcessing\":{\"generatedFilter\":\"Key eq 'myDocKey1'\"}}\n\nevent: activity.started\ndata: {\"id\":2,\"type\":\"searchIndex\",\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"knowledgeSourceName\":\"ks-preview-test\"}\n\nevent: activity.completed\ndata: {\"type\":\"searchIndex\",\"id\":2,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"knowledgeSourceName\":\"ks-preview-test\",\"queryTime\":\"2025-01-01T00:08:45.045Z\",\"count\":2,\"elapsedMs\":1234,\"searchIndexArguments\":{\"search\":\"hello world two\",\"filter\":\"((category eq 'news') and ((id ne null) and (foo eq bar))) and (Key eq 'myDocKey1')\",\"semanticConfigurationName\":\"testconfig\",\"queryType\":\"simple\",\"sourceDataFields\":[{\"name\":\"category\"},{\"name\":\"description\"},{\"name\":\"ownerId\"},{\"name\":\"id\"}],\"searchFields\":[]},\"queryHintProcessing\":{\"generatedFilter\":\"Key eq 'myDocKey1'\"}}\n\nevent: activity.started\ndata: {\"id\":3,\"type\":\"modelAnswerSynthesis\",\"startedAt\":\"2025-01-01T00:08:45.045Z\"}\n\nevent: activity.completed\ndata: {\"type\":\"modelAnswerSynthesis\",\"id\":3,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"inputTokens\":11,\"outputTokens\":22,\"elapsedMs\":1234,\"model\":{\"modelName\":\"gpt-4o\",\"deploymentId\":\"gpt-4o-deployment\"}}\n\nevent: activity.started\ndata: {\"id\":4,\"type\":\"agenticReasoning\",\"startedAt\":\"2025-01-01T00:08:45.045Z\"}\n\nevent: activity.completed\ndata: {\"type\":\"agenticReasoning\",\"id\":4,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"reasoningTokens\":78,\"retrievalReasoningEffort\":{\"kind\":\"low\"},\"logicalReasoningEffort\":{\"kind\":\"low\"}}\n\nevent: answer.completed\ndata: {\"messageIndex\":0,\"message\":{\"content\":[{\"type\":\"text\",\"text\":\"[{...}]\"}]}}\n\nevent: references.completed\ndata: [{\"type\":\"searchIndex\",\"id\":\"83dd7d40\",\"activitySource\":1,\"rerankerScore\":4,\"docKey\":\"myDocKey1\",\"citationUrl\":\"https://typespecpreviewexampleservice.search.windows.net/indexes/preview-test/docs/myDocKey1?$select=category%2Cdescription%2CownerId%2Cid&api-version=2026-11-01-preview&allowUnsafeKeys=true\",\"sourceData\":{\"id\":\"myDocKey1\",\"title\":\"high_doc\",\"content\":\"hello world\"}},{\"type\":\"searchIndex\",\"id\":\"83dd7d41\",\"activitySource\":1,\"rerankerScore\":3.9,\"docKey\":\"myDocKey2\",\"citationUrl\":\"https://typespecpreviewexampleservice.search.windows.net/indexes/preview-test/docs/myDocKey2?$select=category%2Cdescription%2CownerId%2Cid&api-version=2026-11-01-preview&allowUnsafeKeys=true\",\"sourceData\":{\"id\":\"myDocKey2\",\"title\":\"low_doc\",\"content\":\"goodbye world\"}}]\n\nevent: response.completed\ndata: {\"statusCode\":200,\"response\":{\"response\":[{\"content\":[{\"type\":\"text\",\"text\":\"[{...}]\"}]}],\"activity\":[{\"type\":\"modelQueryPlanning\",\"id\":0,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"inputTokens\":11,\"outputTokens\":22,\"elapsedMs\":1234,\"model\":{\"modelName\":\"gpt-4o\",\"deploymentId\":\"gpt-4o-deployment\"}},{\"type\":\"searchIndex\",\"id\":1,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"knowledgeSourceName\":\"ks-preview-test\",\"queryTime\":\"2025-01-01T00:08:45.045Z\",\"count\":2,\"elapsedMs\":1234,\"searchIndexArguments\":{\"search\":\"hello world\",\"filter\":\"((category eq 'news') and ((id ne null) and (foo eq bar))) and (Key eq 'myDocKey1')\",\"semanticConfigurationName\":\"testconfig\",\"queryType\":\"simple\",\"sourceDataFields\":[{\"name\":\"category\"},{\"name\":\"description\"},{\"name\":\"ownerId\"},{\"name\":\"id\"}],\"searchFields\":[]},\"queryHintProcessing\":{\"generatedFilter\":\"Key eq 'myDocKey1'\"}},{\"type\":\"searchIndex\",\"id\":2,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"knowledgeSourceName\":\"ks-preview-test\",\"queryTime\":\"2025-01-01T00:08:45.045Z\",\"count\":2,\"elapsedMs\":1234,\"searchIndexArguments\":{\"search\":\"hello world two\",\"filter\":\"((category eq 'news') and ((id ne null) and (foo eq bar))) and (Key eq 'myDocKey1')\",\"semanticConfigurationName\":\"testconfig\",\"queryType\":\"simple\",\"sourceDataFields\":[{\"name\":\"category\"},{\"name\":\"description\"},{\"name\":\"ownerId\"},{\"name\":\"id\"}],\"searchFields\":[]},\"queryHintProcessing\":{\"generatedFilter\":\"Key eq 'myDocKey1'\"}},{\"type\":\"modelAnswerSynthesis\",\"id\":3,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"inputTokens\":11,\"outputTokens\":22,\"elapsedMs\":1234,\"model\":{\"modelName\":\"gpt-4o\",\"deploymentId\":\"gpt-4o-deployment\"}},{\"type\":\"agenticReasoning\",\"id\":4,\"startedAt\":\"2025-01-01T00:08:45.045Z\",\"completedAt\":\"2025-01-01T00:08:46.279Z\",\"reasoningTokens\":78,\"retrievalReasoningEffort\":{\"kind\":\"low\"},\"logicalReasoningEffort\":{\"kind\":\"low\"}}],\"references\":[{\"type\":\"searchIndex\",\"id\":\"83dd7d40\",\"activitySource\":1,\"rerankerScore\":4,\"docKey\":\"myDocKey1\",\"citationUrl\":\"https://typespecpreviewexampleservice.search.windows.net/indexes/preview-test/docs/myDocKey1?$select=category%2Cdescription%2CownerId%2Cid&api-version=2026-11-01-preview&allowUnsafeKeys=true\",\"sourceData\":{\"id\":\"myDocKey1\",\"title\":\"high_doc\",\"content\":\"hello world\"}},{\"type\":\"searchIndex\",\"id\":\"83dd7d41\",\"activitySource\":1,\"rerankerScore\":3.9,\"docKey\":\"myDocKey2\",\"citationUrl\":\"https://typespecpreviewexampleservice.search.windows.net/indexes/preview-test/docs/myDocKey2?$select=category%2Cdescription%2CownerId%2Cid&api-version=2026-11-01-preview&allowUnsafeKeys=true\",\"sourceData\":{\"id\":\"myDocKey2\",\"title\":\"low_doc\",\"content\":\"goodbye world\"}}]}}\n\n"

定义

名称 说明
Accept

接受(Accept)首部。

AgentRuntimeGraphHydrateDocumentsParams

知识检索返回的水合源文档的选择和计数限制。

AgentRuntimeGraphParams

在检索过程中对启用图的 Azure Blob 知识源进行特定图的覆盖。

AgentRuntimeGraphProvenanceParams

用于知识检索图结果的源文档水合策略。

AzureBlobKnowledgeSourceParams

指定 Azure Blob 知识源的运行时参数

BalancedVectorQueryTopicGraph

将纯载体相似性与多样性感知性反演相结合。 建议默认平衡多样性与相关性。

DiverseVectorQueryTopicGraph

采用主题图多样化检索。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详情

ErrorResponse

所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。

FabricDataAgentKnowledgeSourceParams

指定 Fabric Data Agent 知识源的运行时参数

FabricOntologyKnowledgeSourceParams

指定 Fabric 本体知识源的运行时参数

FileKnowledgeSourceParams

指定文件知识源的运行时参数

IndexedOneLakeKnowledgeSourceParams

指定索引 OneLake 知识源的运行时参数

IndexedSharePointKnowledgeSourceParams

指定索引 SharePoint 知识源的运行时参数

IndexedSqlKnowledgeSourceParams

指定索引SQL知识源的运行时参数

KnowledgeBaseImageContent

图片内容。

KnowledgeBaseMessage

自然语言消息样式对象。

KnowledgeBaseMessageContentType

消息内容的类型。

KnowledgeBaseMessageImageContent

图像消息类型。

KnowledgeBaseMessageTextContent

短信类型。

KnowledgeBaseRetrievalRequest

检索请求的输入协定。

KnowledgeRetrievalAutoReasoningEffort

检索时自动选择推理努力。 服务会在最低层级为每个请求做种,并只在需要时逐步升级,直到服务的最高可用层级。

KnowledgeRetrievalIntentType

要使用的知识库配置类型。

KnowledgeRetrievalLowReasoningEffort

以较低的推理工作量运行知识检索。

KnowledgeRetrievalMediumReasoningEffort

以中等推理工作量运行知识检索。

KnowledgeRetrievalMinimalReasoningEffort

以最少的推理工作运行知识检索。

KnowledgeRetrievalOutputMode

此检索的输出配置。

KnowledgeRetrievalReasoningEffortKind

检索期间要使用的工作量。

KnowledgeRetrievalSemanticIntent

语义查询意图。

KnowledgeSourceGraphProvenanceKind

基于图的知识检索中的源文档行为。

KnowledgeSourceKind

知识来源的那种。

KnowledgeSourceResultsProcessing

控制知识源的结果是否会被重新排序。

McpServerKnowledgeSourceParams

指定MCP服务器知识源的运行时参数

NoneVectorQueryTopicGraph

使用常规向量搜索,不使用主题图进行多样化检索。

RemoteSharePointKnowledgeSourceParams

指定远程 SharePoint 知识源的运行时参数

SearchIndexKnowledgeSourceBoostKind

这正是搜索索引知识源的提升提示。

SearchIndexKnowledgeSourceFieldValueBoost

一个基于字段值提升文档的提示。

SearchIndexKnowledgeSourceFilterHint

一个用于识别字段的提示,以及查询规划器在构建筛选器时可以使用的详尽基础值。

SearchIndexKnowledgeSourceFilterHintAutoConfiguration

配置从目标索引面自动解析滤镜提示的接地值。

SearchIndexKnowledgeSourceMultiWordExpressionBoost

一个基于多词表达式提升文档的提示。

SearchIndexKnowledgeSourceParams

指定搜索索引知识源的运行时参数

SearchIndexKnowledgeSourceQueryHints

指导查询规划的提示,使搜索索引知识源获得有用的筛选和提升。

VectorSearchTopicGraphKind

该使用的主题图向量搜索类型。

WebKnowledgeSourceParams

指定 Web 知识源的运行时参数

WorkIQKnowledgeSourceParams

指定WorkIQ知识源的运行时参数

Accept

接受(Accept)首部。

值 说明
text/event-stream

AgentRuntimeGraphHydrateDocumentsParams

知识检索返回的水合源文档的选择和计数限制。

名称 类型 默认值 说明
select

string

包含逗号分隔的可检索源字段。

top

integer (int32)

minimum: 1
maximum: 100
50

要返回的最大水合文档数。 默认为 50;这与图行数无关。

AgentRuntimeGraphParams

在检索过程中对启用图的 Azure Blob 知识源进行特定图的覆盖。

名称 类型 默认值 说明
includeQuery

boolean

False

在 graphSearchArguments.gql 中包含生成的 GQL。 省略或错误不会暴露生成的查询文本。

provenance

AgentRuntimeGraphProvenanceParams

控制是否返回支持图表结果的源文档。

AgentRuntimeGraphProvenanceParams

用于知识检索图结果的源文档水合策略。

名称 类型 默认值 说明
hydrateDocuments

AgentRuntimeGraphHydrateDocumentsParams

源文档选项;仅当类型为 hydrate 时才有效。

kind

KnowledgeSourceGraphProvenanceKind

none

图检索是仅返回图行,还是同时对源文档进行水化。

AzureBlobKnowledgeSourceParams

指定 Azure Blob 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

graphParameters

AgentRuntimeGraphParams

启用图的源的图形查询可见性和源文档水合选项。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

azureBlob

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

topicGraph VectorQueryTopicGraph:

在此检索时覆盖知识源存储的 topicGraph。 省略时,存储的知识源值适用。

BalancedVectorQueryTopicGraph

将纯载体相似性与多样性感知性反演相结合。 建议默认平衡多样性与相关性。

名称 类型 说明
kind string:

balanced

该使用的主题图向量搜索类型。

minDiversityPoolSize

integer (int32)

minimum: 250
maximum: 10000

在主题图抽样前需检索的最小向量候选数量。 默认值为 1,000。

DiverseVectorQueryTopicGraph

采用主题图多样化检索。

名称 类型 说明
diversityFactor

number (float)

minimum: 0
maximum: 1

主题图多样性检索所采用的多样性因子。 如果省略,则使用主题图配置文件中默认配置的版本。

kind string:

diverse

该使用的主题图向量搜索类型。

minDiversityPoolSize

integer (int32)

minimum: 250
maximum: 10000

在主题图抽样前需检索的最小向量候选数量。 默认值为 1,000。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

附加信息。

type

string

其他信息类型。

ErrorDetail

错误详情

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误的附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详情。

message

string

错误消息。

target

string

错误的目标。

ErrorResponse

所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。

名称 类型 说明
error

ErrorDetail

错误对象。

FabricDataAgentKnowledgeSourceParams

指定 Fabric Data Agent 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

fabricDataAgent

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

FabricOntologyKnowledgeSourceParams

指定 Fabric 本体知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

fabricOntology

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

FileKnowledgeSourceParams

指定文件知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

file

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

IndexedOneLakeKnowledgeSourceParams

指定索引 OneLake 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

indexedOneLake

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

IndexedSharePointKnowledgeSourceParams

指定索引 SharePoint 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

indexedSharePoint

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

IndexedSqlKnowledgeSourceParams

指定索引SQL知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

indexedSql

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

KnowledgeBaseImageContent

图片内容。

名称 类型 说明
url

string (uri)

图像的 URL。

KnowledgeBaseMessage

自然语言消息样式对象。

名称 类型 说明
content KnowledgeBaseMessageContent[]:

消息的内容。

role

string

工具响应的作用。

KnowledgeBaseMessageContentType

消息内容的类型。

值 说明
text

短信内容类型。

image

图像消息内容类型。

KnowledgeBaseMessageImageContent

图像消息类型。

名称 类型 说明
image

KnowledgeBaseImageContent

图片内容。

type string:

image

消息的类型

KnowledgeBaseMessageTextContent

短信类型。

名称 类型 说明
text

string

文本内容。

type string:

text

消息的类型

KnowledgeBaseRetrievalRequest

检索请求的输入协定。

名称 类型 说明
includeActivity

boolean

指示检索结果应包括活动信息。

intents KnowledgeRetrievalIntent[]:

KnowledgeRetrievalSemanticIntent[]

无需模型查询规划即可执行的预期查询列表。

knowledgeSourceParams KnowledgeSourceParams[]:

知识源的运行时参数列表。

maxOutputDocuments

integer (int32)

限制输出中最大文档数量。

maxOutputSize

integer (int32)

限制输出中内容的最大大小。

maxOutputSizeInTokens

integer (int32)

限制输出中内容的最大大小。

maxRuntimeInSeconds

integer (int32)

最大运行时间(以秒为单位)。

messages

KnowledgeBaseMessage[]

聊天消息样式输入的列表。

outputMode

KnowledgeRetrievalOutputMode

此检索的输出配置。

retrievalReasoningEffort KnowledgeRetrievalReasoningEffort:

检索推理努力配置。

toolName

string

要选择的工具。 在全KB检索时省略。

KnowledgeRetrievalAutoReasoningEffort

检索时自动选择推理努力。 服务会在最低层级为每个请求做种,并只在需要时逐步升级,直到服务的最高可用层级。

名称 类型 说明
kind string:

auto

那种推理努力。

KnowledgeRetrievalIntentType

要使用的知识库配置类型。

值 说明
semantic

自然语言语义查询意向。

KnowledgeRetrievalLowReasoningEffort

以较低的推理工作量运行知识检索。

名称 类型 说明
kind string:

low

那种推理努力。

KnowledgeRetrievalMediumReasoningEffort

以中等推理工作量运行知识检索。

名称 类型 说明
kind string:

medium

那种推理努力。

KnowledgeRetrievalMinimalReasoningEffort

以最少的推理工作运行知识检索。

名称 类型 说明
kind string:

minimal

那种推理努力。

KnowledgeRetrievalOutputMode

此检索的输出配置。

值 说明
extractiveData

直接从知识源返回数据,无需生成更改。

answerSynthesis

合成响应有效负载的答案。

KnowledgeRetrievalReasoningEffortKind

检索期间要使用的工作量。

值 说明
minimal

不执行任何源选择、查询规划或迭代搜索。

low

在检索过程中使用低推理。

medium

在检索过程中使用适量的推理。

auto

检索时自动选择推理努力,从最低层级逐步升级到所需范围。

KnowledgeRetrievalSemanticIntent

语义查询意图。

名称 类型 说明
search

string

要执行的语义查询

type string:

semantic

意向的类型。

KnowledgeSourceGraphProvenanceKind

基于图的知识检索中的源文档行为。

值 说明
none

返回图表结果而不对其源文档进行水化处理。

hydrate

还会从配置的来源索引中返回选定的源文档。

KnowledgeSourceKind

知识来源的那种。

值 说明
searchIndex

从搜索索引中读取数据的知识源。

azureBlob

用于读取数据并将其从 Azure Blob 存储引入搜索索引的知识源。

indexedSharePoint

一个读取索引 SharePoint 数据的知识源。

indexedOneLake

一个读取索引 OneLake 数据的知识源。

indexedSql

一个知识源,可以从Azure SQL 数据库或SQL 托管实例获取数据到搜索索引。

web

一个从网络读取数据的知识源。

remoteSharePoint

一个读取远程SharePoint数据的知识源。

workIQ

一个读取工作智商数据的知识源

file

一个支持直接文件上传和索引的知识源。

mcpServer

一个由MCP(模型上下文协议)服务器支持的知识源。

fabricDataAgent

一个从Fabric数据代理获取数据的知识源。

fabricOntology

一个从Microsoft Fabric本体中提取数据的知识源。

KnowledgeSourceResultsProcessing

控制知识源的结果是否会被重新排序。

值 说明
rerank

这些知识源的成果会经过重新排序流程。 这是默认行为。

none

该知识源的结果绕过重新排序,保持其底层顺序。

McpServerKnowledgeSourceParams

指定MCP服务器知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

mcpServer

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

NoneVectorQueryTopicGraph

使用常规向量搜索,不使用主题图进行多样化检索。

名称 类型 说明
kind string:

none

该使用的主题图向量搜索类型。

RemoteSharePointKnowledgeSourceParams

指定远程 SharePoint 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

filterExpressionAddOn

string

应用于 SharePoint 数据源的筛选条件。 必须在关键字查询语言语法中指定它。 它将与知识源定义中指定的筛选器表达式结合使用。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

remoteSharePoint

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

SearchIndexKnowledgeSourceBoostKind

这正是搜索索引知识源的提升提示。

值 说明
fieldValue

根据字段值提升文档。

multiWordExpression

基于多词表达式提升文档。

SearchIndexKnowledgeSourceFieldValueBoost

一个基于字段值提升文档的提示。

名称 类型 说明
boost

number (double)

文档评分的乘数。 必须是不等于 1.0 的正数。

boostInstructions

string

自然语言说明,说明何时以及如何应用加成。

field

string

minLength: 1

搜索索引字段的名称。

fieldValues

string[]

场的代表性值。

kind string:

fieldValue

那种提升提示。

SearchIndexKnowledgeSourceFilterHint

一个用于识别字段的提示,以及查询规划器在构建筛选器时可以使用的详尽基础值。

名称 类型 说明
autoConfiguration

SearchIndexKnowledgeSourceFilterHintAutoConfiguration

配置服务以解析场面的接地值。 它的存在支持自动配置。 字段必须可筛选且可面分析。 当目标索引启用了文档级权限或 Purview 敏感性标签时,不支持;此限制在知识源创建/更新和知识库检索时得到验证。 与 fieldValues 互斥。 仅支持在知识源存储 queryHints中,不支持请求时 queryHintOverrides。

field

string

minLength: 1

可筛选的搜索索引字段名称。

fieldValues

string[]

该领域的穷尽数值集合。 最多 160 个值,每个值最多 128 个字符,总共 2048 个字符。 在支持 autoConfiguration的版本中,除非 autoConfiguration 特别说明且与之互斥,否则是必需的。

filterInstructions

string

自然语言说明,解释何时以及如何在场上过滤。

SearchIndexKnowledgeSourceFilterHintAutoConfiguration

配置从目标索引面自动解析滤镜提示的接地值。

名称 类型 说明
cacheTtl

integer (int32)

minimum: 60
maximum: 3600

解析的分面值会缓存所解析的秒数。 专用服务允许的范围为 60 至 3600,无服务器服务为 60 至 900。 省略时,专用服务默认为 3600 秒,无服务器服务为 900 秒。

maxFacetValueCount

integer (int32)

minimum: 1
maximum: 64

用作接地的最大面值数值。 默认为 64;允许的范围为 1 到 64。 值按递减的面数顺序选择,受与手动筛选值相同的 2048 字符组合长度限制和每值 128 字符限制。

SearchIndexKnowledgeSourceMultiWordExpressionBoost

一个基于多词表达式提升文档的提示。

名称 类型 说明
boost

number (double)

文档评分的乘数。 必须是不等于 1.0 的正数。

boostInstructions

string

自然语言说明,说明何时以及如何应用加成。

fieldValues

string[]

提升的代表性值。

kind string:

multiWordExpression

那种提升提示。

SearchIndexKnowledgeSourceParams

指定搜索索引知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

filterAddOn

string

应用于索引的筛选条件(例如,“State eq VA”)。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

searchIndex

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

queryHintOverrides

SearchIndexKnowledgeSourceQueryHints

指导查询规划的提示,帮助你进行有用的筛选和提升。 如果指定,该对象将替换知识源上配置的完整查询提示集合。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

topicGraph VectorQueryTopicGraph:

在此检索时覆盖知识源存储的 topicGraph。 省略时,存储的知识源值适用。

SearchIndexKnowledgeSourceQueryHints

指导查询规划的提示,使搜索索引知识源获得有用的筛选和提升。

名称 类型 说明
boosts SearchIndexKnowledgeSourceBoost[]:

提升提示,识别查询规划器可用来影响文档排名的条件。

filters

SearchIndexKnowledgeSourceFilterHint[]

筛选提示,识别字段和代表性值,查询规划器在构建筛选时可以使用。

VectorSearchTopicGraphKind

该使用的主题图向量搜索类型。

值 说明
none

当主题图多样性检索关闭时,使用普通向量搜索。

diverse

使用主题图谱多样化检索。

balanced

将纯载体相似性与多样性感知性反演相结合。 建议默认平衡多样性与相关性。

WebKnowledgeSourceParams

指定 Web 知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

count

integer (int32)

要返回的 Web 结果数。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

freshness

string

网络结果的新鲜度。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

web

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

language

string

网络结果的语言。

market

string

网络结果的市场。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。

WorkIQKnowledgeSourceParams

指定WorkIQ知识源的运行时参数

名称 类型 说明
alwaysQuerySource

boolean

指示此知识源应绕过源选择,并始终在检索时进行查询。

enableImageServing

boolean

指示在检索时是否应启用该知识源的图像服务。 当为真时,在导入过程中提取的图像会传递给下游模型。

failOnError

boolean

表示如果从该知识源的检索遇到错误,整个检索请求应当失败。 默认值为 false。

includeReferenceSourceData

boolean

指示引用是否应在其有效负载中包含检索期间获得的结构化数据。

includeReferences

boolean

指示是否应为从此源检索的数据包含引用。

kind string:

workIQ

知识源的类型。

knowledgeSourceName

string

参数应用到的索引的名称。

maxOutputDocuments

integer (int32)

限制从该知识源返回的最大文档数量。

neverQuerySource

boolean

表示该知识源应从请求的候选集中排除,且检索时绝不查询。 该排除是请求本地的,不会修改知识库成员资格。 不能在同一知识源上与 alwaysQuerySource 合并使用。

rerankerThreshold

number (float)

所有检索到的文档必须满足重新排序器阈值才能包含在响应中。

resultsProcessing

KnowledgeSourceResultsProcessing

覆盖知识源存储的结果,仅处理此检索调用。 省略时,存储的知识源值适用。