Knowledge Bases - Create Or Update
创建新的知识库,或者如果已有知识库就更新。
PUT {endpoint}/knowledgebases('{knowledgeBaseName}')?api-version=2026-11-01-preview
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
搜索服务的终结点 URL。 |
|
knowledge
|
path | True |
string |
知识库的名称。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求标头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| x-ms-client-request-id |
string (uuid) |
请求的不透明、全局唯一的客户端生成的字符串标识符。 |
|
| Accept |
接受(Accept)首部。 |
||
| If-Match |
string |
定义 If-Match 条件。 仅当服务器上的 ETag 与此值匹配时,才会执行该作。 |
|
| If-None-Match |
string |
定义 If-None-Match 条件。 仅当服务器上的 ETag 与此值不匹配时,才会执行该作。 |
|
| Prefer | True |
对于 HTTP PUT 请求,指示服务在成功时返回创建/更新的资源。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| knowledgeSources | True |
本知识库引用的知识来源。 |
|
| name | True |
string |
知识库的名称。 |
| @odata.etag |
string |
知识库的 ETag。 |
|
| answerInstructions |
string |
知识库在生成答案时考虑的指令。 |
|
| corsOptions |
为知识库提供控制跨原点资源共享(CORS)的选项。 |
||
| description |
string |
知识库的描述。 |
|
| encryptionKey |
描述在 Azure 密钥保管库 中创建的加密密钥。 |
||
| models | KnowledgeBaseModel[]: |
包含有关如何连接到 AI 模型的配置选项。 |
|
| outputMode |
知识库的输出模式。 |
||
| retrievalInstructions |
string |
知识库在制定查询计划时考虑的指令。 |
|
| retrievalReasoningEffort | KnowledgeRetrievalReasoningEffort: |
检索推理努力配置。 |
|
| retrieveDefaults |
该知识库的持久请求范围检索默认值。 这些值用于检索省略对应字段的请求;如果存在,请求时间值优先。 |
||
| tags |
object |
用户自定义的关键值对用于分类知识库及其使用情况和成本。 |
|
| tools |
命名检索工具,每个仅限于该知识库来源的子集。 配置完成后,MCP 除了内置的 knowledge_base_retrieve 工具外,还会宣传这些工具,后者从完整的知识库中检索数据。 在此 API 版本中省略工具或提供空数组会清除现有工具。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求已成功。 |
|
| 201 Created |
请求已成功,因此创建了一个新资源。 |
|
| Other Status Codes |
未预期的错误响应。 |
安全性
api-key
类型:
apiKey
在:
header
OAuth2Auth
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
作用域
| 名称 | 说明 |
|---|---|
| https://search.azure.com/.default |
示例
SearchServiceCreateOrUpdateKnowledgeBase
示例请求
PUT https://typespecpreviewexampleservice.search.windows.net/knowledgebases('base-preview-test')?api-version=2026-11-01-preview
{
"name": "base-preview-test",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
],
"models": [
{
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "https://test-sample.openai.azure.com/",
"deploymentId": "myDeployment",
"apiKey": "api-key",
"modelName": "gpt-4o-mini"
}
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"outputMode": "extractiveData",
"@odata.etag": "0x1234568AE7E58A1",
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"description": "Description of the knowledge base.",
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
}
}
示例响应
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "base-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "https://test-sample.openai.azure.com/",
"deploymentId": "myDeployment",
"apiKey": "api-key",
"modelName": "gpt-4o-mini"
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "base-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "https://test-sample.openai.azure.com/",
"deploymentId": "myDeployment",
"apiKey": "api-key",
"modelName": "gpt-4o-mini"
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
SearchServiceCreateOrUpdateKnowledgeBaseMicrosoftRetriever1
示例请求
PUT https://typespecpreviewexampleservice.search.windows.net/knowledgebases('travel-knowledgebase')?api-version=2026-11-01-preview
{
"name": "travel-knowledgebase",
"knowledgeSources": [
{
"name": "hotels"
}
],
"models": [
{
"kind": "microsoftRetriever1"
}
],
"outputMode": "extractiveData",
"description": "Find hotels using Microsoft Retriever 1."
}
示例响应
{
"name": "travel-knowledgebase",
"knowledgeSources": [
{
"name": "hotels"
}
],
"models": [
{
"kind": "microsoftRetriever1"
}
],
"outputMode": "extractiveData",
"description": "Find hotels using Microsoft Retriever 1."
}
{
"name": "travel-knowledgebase",
"knowledgeSources": [
{
"name": "hotels"
}
],
"models": [
{
"kind": "microsoftRetriever1"
}
],
"outputMode": "extractiveData",
"description": "Find hotels using Microsoft Retriever 1."
}
SearchServiceCreateOrUpdateKnowledgeBaseOpenAICompatible
示例请求
PUT https://typespecpreviewexampleservice.search.windows.net/knowledgebases('compatible-model-preview-test')?api-version=2026-11-01-preview
{
"name": "compatible-model-preview-test",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini",
"headers": {
"api-key": "EXAMPLE-NOT-A-REAL-SECRET"
}
}
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"outputMode": "extractiveData",
"@odata.etag": "0x1234568AE7E58A1",
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"description": "Description of the knowledge base.",
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
}
}
示例响应
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "compatible-model-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini"
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "compatible-model-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini"
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
SearchServiceCreateOrUpdateKnowledgeBaseOpenAICompatibleUserAssignedIdentity
示例请求
PUT https://typespecpreviewexampleservice.search.windows.net/knowledgebases('compatible-model-preview-test')?api-version=2026-11-01-preview
{
"name": "compatible-model-preview-test",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini",
"managedIdentityAudience": "11111111-2222-3333-4444-555555555555",
"authIdentity": {
"@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
"userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/search-identities/providers/Microsoft.ManagedIdentity/userAssignedIdentities/catalog-model-caller"
}
}
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"outputMode": "extractiveData",
"@odata.etag": "0x1234568AE7E58A1",
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"description": "Description of the knowledge base.",
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
}
}
示例响应
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "compatible-model-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini",
"managedIdentityAudience": "11111111-2222-3333-4444-555555555555",
"authIdentity": {
"@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
"userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/search-identities/providers/Microsoft.ManagedIdentity/userAssignedIdentities/catalog-model-caller"
}
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
{
"@odata.etag": "0x1234568AE7E58A1",
"name": "compatible-model-preview-test",
"description": "Description of the knowledge base.",
"retrievalInstructions": "Instructions for retrieval for the knowledge base.",
"answerInstructions": "Instructions for answer synthesis.",
"outputMode": "extractiveData",
"knowledgeSources": [
{
"name": "ks-preview-test"
}
],
"models": [
{
"kind": "openAICompatible",
"openAICompatibleParameters": {
"uri": "https://model-gateway.contoso.com/teams/catalog/chat/completions?route=primary&api-version=2026-01-01",
"modelName": "gpt-4.1-mini",
"managedIdentityAudience": "11111111-2222-3333-4444-555555555555",
"authIdentity": {
"@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
"userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/search-identities/providers/Microsoft.ManagedIdentity/userAssignedIdentities/catalog-model-caller"
}
}
}
],
"encryptionKey": {
"keyVaultKeyName": "myUserManagedEncryptionKey-createdinAzureKeyVault",
"keyVaultKeyVersion": "myKeyVersion-32charAlphaNumericString",
"keyVaultUri": "https://myKeyVault.vault.azure.net",
"isServiceLevelKey": false,
"accessCredentials": {
"applicationId": "00000000-0000-0000-0000-000000000000",
"applicationSecret": "<applicationSecret>"
}
},
"tags": {
"businessUnit": "Contoso Engineering Department",
"costCenter": "ABC-123",
"owner": "Contoso"
},
"retrievalReasoningEffort": {
"kind": "low"
},
"corsOptions": {
"allowedOrigins": [
"https://myapp.example.com"
],
"maxAgeInSeconds": 300
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 45,
"maxOutputDocuments": 8,
"maxOutputSizeInTokens": 12000
},
"tools": [
{
"name": "product-search",
"description": "Search product documentation.",
"knowledgeSources": [
{
"name": "ks-preview-test",
"alwaysQuerySource": false,
"filterAddOn": "id ne null",
"maxOutputDocuments": 50,
"failOnError": true
}
],
"retrievalReasoningEffort": {
"kind": "low"
},
"retrieveDefaults": {
"maxRuntimeInSeconds": 30,
"maxOutputDocuments": 2,
"maxOutputSizeInTokens": 5000
}
}
]
}
定义
| 名称 | 说明 |
|---|---|
| Accept |
接受(Accept)首部。 |
|
Azure |
将调用的 Azure Open AI 模型名称。 |
|
Azure |
指定用于连接到 Azure OpenAI 资源的参数。 |
|
Cors |
定义用于控制索引的跨域资源共享(CORS)的选项。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详情 |
|
Error |
所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。 |
|
Knowledge |
代表知识库定义。 |
|
Knowledge |
指定用于执行查询规划的 Azure OpenAI 资源。 |
|
Knowledge |
指定用于查询规划和检索的 Microsoft Retriever 1。 |
|
Knowledge |
用于查询规划的 AI 模型。 |
|
Knowledge |
指定一个由客户控制的兼容 OpenAI 模型,用于知识库检索或最小模式知识源图像的口述化。 在检索时,模型配置文件会选择聊天完成或回答。 不支持标准/用户用户群提取或带有 Web 知识源的知识库。 |
|
Knowledge |
适用于兼容 OpenAI 的聊天完成或回复端点的连接参数。 创建时需要恰好一个非空头部或 managedIdentityAudience。 更新可以省略头部,以保留未更改的连接和模型配置文件的凭据。 |
|
Knowledge |
知识库检索请求的请求默认值为持久。 每个值为匹配的检索请求字段提供默认值;未设置时服务默认值生效,存在时优先考虑请求时间值。 |
|
Knowledge |
一个具名检索工具,包含客户提供的描述及其知识库来源的部分来源。 |
|
Knowledge |
对现有知识源和选定的持久检索默认值子集的引用,而非完整的请求时间参数模型。 引用的源决定了类型;保存知识库时,不兼容的默认选项会被拒绝。 显式检索请求值优先,但过滤器与 AND 结合使用。 |
|
Knowledge |
检索时自动选择推理努力。 服务会在最低层级为每个请求做种,并只在需要时逐步升级,直到服务的最高可用层级。 |
|
Knowledge |
以较低的推理工作量运行知识检索。 |
|
Knowledge |
以中等推理工作量运行知识检索。 |
|
Knowledge |
以最少的推理工作运行知识检索。 |
|
Knowledge |
此检索的输出配置。 |
|
Knowledge |
检索期间要使用的工作量。 |
|
Knowledge |
引用知识来源。 |
| Prefer |
对于 HTTP PUT 请求,指示服务在成功时返回创建/更新的资源。 |
|
Search |
清除数据源的标识属性。 |
|
Search |
指定要使用的数据源的标识。 |
|
Search |
Azure 密钥保管库 中的客户管理的加密密钥。 创建和管理的密钥可用于加密或解密静态数据,例如索引和同义词映射。 |
Accept
接受(Accept)首部。
| 值 | 说明 |
|---|---|
| application/json;odata.metadata=minimal |
AzureOpenAIModelName
将调用的 Azure Open AI 模型名称。
| 值 | 说明 |
|---|---|
| text-embedding-ada-002 |
TextEmbeddingAda002 模型。 |
| text-embedding-3-large |
TextEmbedding3大型模型。 |
| text-embedding-3-small |
TextEmbedding3小型模型。 |
| gpt-4o |
GPT4o模型。 |
| gpt-4o-mini |
GPT4oMini型号。 |
| gpt-4.1 |
GPT41型号。 |
| gpt-4.1-mini |
GPT41Mini型号。 |
| gpt-4.1-nano |
Gpt41Nano模型。 |
| gpt-5 |
GPT5型号。 |
| gpt-5-mini |
Gpt5Mini型号。 |
| gpt-5-nano |
Gpt5Nano模型。 |
| gpt-5.1 |
GPT51型号。 |
| gpt-5.2 |
GPT52型号。 |
| gpt-5.4 |
GPT54型号。 |
| gpt-5.4-mini |
GPT54Mini型号。 |
| gpt-5.4-nano |
Gpt54Nano型号。 |
| gpt-5.5 |
GPT55型号。 |
| gpt-5.6-sol |
GPT56Sol模型。 |
| gpt-5.6-terra |
Gpt56Terra型号。 |
| gpt-5.6-luna |
Gpt56Luna型号。 |
| gpt-6-astra |
Gpt6Astra 型号。 |
| gpt-6-sol |
Gpt6Sol模型。 |
| gpt-6-luna |
Gpt6Luna模型。 |
| gpt-6.1-sol |
Gpt61Sol模型。 |
AzureOpenAIVectorizerParameters
指定用于连接到 Azure OpenAI 资源的参数。
| 名称 | 类型 | 说明 |
|---|---|---|
| apiKey |
string |
指定的 Azure OpenAI 资源的 API 密钥。 |
| authIdentity | SearchIndexerDataIdentity: |
用于出站连接的用户分配的托管标识。 |
| deploymentId |
string |
指定资源上的 Azure OpenAI 模型部署的 ID。 |
| modelName |
在提供的 deploymentId 路径中部署的嵌入模型的名称。 |
|
| resourceUri |
string (uri) |
Azure OpenAI 资源的资源 URI。 |
CorsOptions
定义用于控制索引的跨域资源共享(CORS)的选项。
| 名称 | 类型 | 说明 |
|---|---|---|
| allowedOrigins |
string[] |
JavaScript 代码将被授予对索引访问权限的来源列表。 可以包含 {protocol}://{fully-qualified-domain-name}[:{port#}] 形式的主机列表,或单个“*”以允许所有源(不推荐)。 |
| maxAgeInSeconds |
integer (int64) |
浏览器应缓存 CORS 预检响应的持续时间。 默认为 5 分钟。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
附加信息。 |
|
| type |
string |
其他信息类型。 |
ErrorDetail
错误详情
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误的附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详情。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误的目标。 |
ErrorResponse
所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
KnowledgeBase
代表知识库定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| @odata.etag |
string |
知识库的 ETag。 |
| answerInstructions |
string |
知识库在生成答案时考虑的指令。 |
| corsOptions |
为知识库提供控制跨原点资源共享(CORS)的选项。 |
|
| description |
string |
知识库的描述。 |
| encryptionKey |
描述在 Azure 密钥保管库 中创建的加密密钥。 |
|
| knowledgeSources |
本知识库引用的知识来源。 |
|
| models | KnowledgeBaseModel[]: |
包含有关如何连接到 AI 模型的配置选项。 |
| name |
string |
知识库的名称。 |
| outputMode |
知识库的输出模式。 |
|
| retrievalInstructions |
string |
知识库在制定查询计划时考虑的指令。 |
| retrievalReasoningEffort | KnowledgeRetrievalReasoningEffort: |
检索推理努力配置。 |
| retrieveDefaults |
该知识库的持久请求范围检索默认值。 这些值用于检索省略对应字段的请求;如果存在,请求时间值优先。 |
|
| tags |
object |
用户自定义的关键值对用于分类知识库及其使用情况和成本。 |
| tools |
命名检索工具,每个仅限于该知识库来源的子集。 配置完成后,MCP 除了内置的 knowledge_base_retrieve 工具外,还会宣传这些工具,后者从完整的知识库中检索数据。 在此 API 版本中省略工具或提供空数组会清除现有工具。 |
KnowledgeBaseAzureOpenAIModel
指定用于执行查询规划的 Azure OpenAI 资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| azureOpenAIParameters |
Azure OpenAI 参数。 |
|
| kind |
string:
azure |
用于查询规划的 AI 模型。 |
KnowledgeBaseMicrosoftRetriever1Model
指定用于查询规划和检索的 Microsoft Retriever 1。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
microsoft |
用于查询规划的 AI 模型。 |
KnowledgeBaseModelKind
用于查询规划的 AI 模型。
| 值 | 说明 |
|---|---|
| azureOpenAI |
使用 Azure Open AI 模型进行查询规划。 |
| openAICompatible |
使用客户控制的兼容 OpenAI 终端进行知识库检索或知识源图像的口述化。 |
| microsoftRetriever1 |
使用 Microsoft Retriever 1 进行查询规划和检索。 |
KnowledgeBaseOpenAICompatibleModel
指定一个由客户控制的兼容 OpenAI 模型,用于知识库检索或最小模式知识源图像的口述化。 在检索时,模型配置文件会选择聊天完成或回答。 不支持标准/用户用户群提取或带有 Web 知识源的知识库。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
open |
用于查询规划的 AI 模型。 |
| openAICompatibleParameters |
适用于兼容 OpenAI 端点的连接和身份验证参数。 |
KnowledgeBaseOpenAICompatibleParameters
适用于兼容 OpenAI 的聊天完成或回复端点的连接参数。 创建时需要恰好一个非空头部或 managedIdentityAudience。 更新可以省略头部,以保留未更改的连接和模型配置文件的凭据。
| 名称 | 类型 | 说明 |
|---|---|---|
| authIdentity | SearchIndexerDataIdentity: |
用于获取 managedIdentityAudience 令牌的用户分配的托管身份。 省略使用搜索服务系统分配的身份。 仅允许与 managedIdentityAudience 一起使用。 |
| headers |
object (password) |
非空存储的 HTTP 头用于端点身份验证。 名称和数值均为秘密,且从不在回复中返回。 空地图无效。 与 managedIdentityAudience 和 authIdentity 互斥。 更新时,仅在相同端点、模型配置文件和身份验证身份未变的情况下,保留被遗漏的报头在同一资源和模型绑定上;否则,请提供新的凭据。 |
| managedIdentityAudience |
string |
客户第三方 Microsoft Entra 应用程序用于托管身份身份验证的纯标准应用程序 GUID。 不要包含 api:// 前缀或 /.default 后缀。 与头部互斥。 |
| modelName |
一个受支持的聊天模型名称,用于确定搜索的功能和限制。 对于知识源图像的口头化,该路径作为请求文本中的模型选择器发送;URI 路径独立选择聊天完成或回答,而非该名称。 在知识库检索中,GPT-6 模型配置文件使用响应,现有模型配置文件使用聊天完成;端点必须支持所选协议,包括响应的无状态工具延续。 检索请求体省略模型;URI 或网关选择实际模型并提供所需的提供者模型标识符。 不支持嵌入模型和任意提供者协议。 |
|
| uri |
string (uri) |
完整的 HTTPS 帖子 URL,包括路径参数和查询参数。 未添加路径或 API 版本,未更改发送;不执行重定向。 对于知识库检索,端点必须接受模型配置文件的聊天完成或回答协议。 对于知识源图像的口述化,URI 路径必须以 /chat/completions 或 /response 结尾;查询参数不选择协议。 |
KnowledgeBaseRetrieveDefaults
知识库检索请求的请求默认值为持久。 每个值为匹配的检索请求字段提供默认值;未设置时服务默认值生效,存在时优先考虑请求时间值。
| 名称 | 类型 | 说明 |
|---|---|---|
| maxOutputDocuments |
integer (int32) |
检索输出中默认的最大文档数量。 |
| maxOutputSizeInTokens |
integer (int32) |
检索输出中内容的默认最大大小(以代币计)。 |
| maxRuntimeInSeconds |
integer (int32) |
取回请求的默认最大运行时间(秒数)。 |
KnowledgeBaseTool
一个具名检索工具,包含客户提供的描述及其知识库来源的部分来源。
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string minLength: 1maxLength: 1024 |
一个非空的使用时间描述,最多 1024 个字符。 在MCP目录中原文刊登广告。 |
| knowledgeSources |
一个非空的唯一源引用列表。 每个来源都必须属于知识库。 不同的工具可能引用的是同一个来源。 |
|
| name |
string minLength: 2maxLength: 64 pattern: ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])$ |
独特的、区分大小写的工具名称。 包含 2 到 64 个小写 ASCII 字母、数字或连字符,且无前置或后置连字符。 |
| retrievalReasoningEffort | KnowledgeRetrievalReasoningEffort: |
覆盖了该工具知识库的推理工作。 显式的检索请求值优先。 |
| retrieveDefaults |
检索覆盖此工具知识库默认值的默认值。 显式的检索请求值优先。 |
KnowledgeBaseToolKnowledgeSourceReference
对现有知识源和选定的持久检索默认值子集的引用,而非完整的请求时间参数模型。 引用的源决定了类型;保存知识库时,不兼容的默认选项会被拒绝。 显式检索请求值优先,但过滤器与 AND 结合使用。
| 名称 | 类型 | 说明 |
|---|---|---|
| alwaysQuerySource |
boolean |
是否需要查询源代码。 不支持 MCP 服务器源。 明确的请求排除优先级。 |
| failOnError |
boolean |
如果此源遇到错误,是否应当检索失败。 |
| filterAddOn |
string |
用于搜索索引源的额外 OData 过滤器。 在保存知识库时,因不支持的源类型而被拒绝。 结合源过滤器和请求过滤器,使用 AND。 |
| maxOutputDocuments |
integer (int32) minimum: 50maximum: 200 |
从此源检索的最大文档数量,介于 50 到 200 之间。 |
| name |
string minLength: 1 |
知识库中知识源的名称。 |
| rerankerThreshold |
number (float) |
退回文档的最低重级分数。 需要启用重新排序功能。 |
KnowledgeRetrievalAutoReasoningEffort
检索时自动选择推理努力。 服务会在最低层级为每个请求做种,并只在需要时逐步升级,直到服务的最高可用层级。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
auto |
那种推理努力。 |
KnowledgeRetrievalLowReasoningEffort
以较低的推理工作量运行知识检索。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
low |
那种推理努力。 |
KnowledgeRetrievalMediumReasoningEffort
以中等推理工作量运行知识检索。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
medium |
那种推理努力。 |
KnowledgeRetrievalMinimalReasoningEffort
以最少的推理工作运行知识检索。
| 名称 | 类型 | 说明 |
|---|---|---|
| kind |
string:
minimal |
那种推理努力。 |
KnowledgeRetrievalOutputMode
此检索的输出配置。
| 值 | 说明 |
|---|---|
| extractiveData |
直接从知识源返回数据,无需生成更改。 |
| answerSynthesis |
合成响应有效负载的答案。 |
KnowledgeRetrievalReasoningEffortKind
检索期间要使用的工作量。
| 值 | 说明 |
|---|---|
| minimal |
不执行任何源选择、查询规划或迭代搜索。 |
| low |
在检索过程中使用低推理。 |
| medium |
在检索过程中使用适量的推理。 |
| auto |
检索时自动选择推理努力,从最低层级逐步升级到所需范围。 |
KnowledgeSourceReference
引用知识来源。
| 名称 | 类型 | 说明 |
|---|---|---|
| enableFreshness |
boolean |
指示是否应为该知识源启用新鲜度感知检索。 当为真时,检索过程中会应用新度评分曲线,以偏向较新文档的结果。 |
| enableImageServing |
boolean |
指示是否应为该知识源启用图像服务。 当属实时,在采集过程中提取的图像会在查询时传递给下游模型。 |
| name |
string |
知识源的名称。 |
Prefer
对于 HTTP PUT 请求,指示服务在成功时返回创建/更新的资源。
| 值 | 说明 |
|---|---|
| return=representation |
SearchIndexerDataNoneIdentity
清除数据源的标识属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| @odata.type |
string:
#Microsoft. |
指定身份类型的 URI 片段。 |
SearchIndexerDataUserAssignedIdentity
指定要使用的数据源的标识。
| 名称 | 类型 | 说明 |
|---|---|---|
| @odata.type |
string:
#Microsoft. |
指定身份类型的 URI 片段。 |
| federatedIdentityClientId |
string |
多租户 User-Assigned 托管身份支持:已配置为与用户分配的托管身份联合的多门户应用的客户端ID。 |
| userAssignedIdentity |
string |
用户分配的托管标识的完全限定的 Azure 资源 ID 通常以“/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentity/myId”的形式分配给搜索服务。 |
SearchResourceEncryptionKey
Azure 密钥保管库 中的客户管理的加密密钥。 创建和管理的密钥可用于加密或解密静态数据,例如索引和同义词映射。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| accessCredentials.applicationId |
string |
向 AAD 应用程序 ID 授予对静态数据加密时要使用的 Azure 密钥保管库 所需的访问权限。 应用程序 ID 不应与 AAD 应用程序的对象 ID 混淆。 |
|
| accessCredentials.applicationSecret |
string |
指定的 AAD 应用程序的身份验证密钥。 |
|
| identity | SearchIndexerDataIdentity: |
用于此加密密钥的显式托管标识。 如果未指定并且访问凭据属性为 null,则使用系统分配的托管标识。 更新资源时,如果未指定显式标识,则保持不变。 如果指定了“none”,则清除此属性的值。 |
|
| isServiceLevelKey |
boolean |
False |
一个可选值,表示该键是否为服务级键。 默认值为 false。 |
| keyVaultKeyName |
string |
用于加密静态数据的 Azure 密钥保管库 密钥的名称。 |
|
| keyVaultKeyVersion |
string |
用于加密静态数据的 Azure 密钥保管库 密钥的版本。 |
|
| keyVaultUri |
string |
Azure 密钥保管库 的 URI(也称为 DNS 名称),其中包含用于加密静态数据的密钥。 示例 URI 可能是 |