你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
注意
Azure AI 搜索可通过Azure门户、REST API 和Azure SDK获取。 它也是 Foundry IQ 的基础;Foundry IQ 是一个托管式知识层,可将企业内容转化为供 Microsoft Foundry 门户中的智能体使用的、可复用且具备权限感知能力的知识库。
Important
标记为“预览”的特性、功能或属性不受服务级别协议 (SLA) 保障,不建议用于生产工作负载,并且在正式发布之前可能会更改或受到限制。 Azure AI 搜索预览条款适用于所有预览功能,无论是独立功能还是正式版功能的一部分。
已建立索引的 OneLake 知识来源将 Microsoft OneLake 文件引入 Azure AI 搜索中的智能体检索管道。 知识库是在运行时查询知识库时独立创建的、在知识库中引用的,并用作基础数据。
创建索引的 OneLake 知识源时,可以指定外部数据源、模型和属性,以自动生成以下Azure AI 搜索对象:
- 一个表示湖屋的数据源。
- 一个技能集能够对来自数据湖仓的多模态内容进行分块,并可选择性地进行向量化处理。
- 存储扩充内容并满足代理检索条件的索引。
- 使用前面的对象驱动索引和扩充管道的索引器。
生成的索引 器符合 OneLake 索引器,其先决条件、支持的任务、支持的文档格式、支持的快捷方式和限制也适用于 OneLake 知识源。 有关详细信息,请参阅 OneLake 索引器文档 和 索引器限制。 如果生成的技能集调用外部服务,该技能的输入和服务限制也适用。
使用支持
| Azure 门户 | Microsoft Foundry 门户 | .NET SDK | Python SDK | Java SDK | JavaScript SDK | REST API |
|---|---|---|---|---|---|---|
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
先决条件
在任意提供代理检索功能的区域中提供的 Azure AI 搜索服务。
完成 OneLake 索引器先决条件。
如果
contentExtractionMode为standard,请在 Foundry Tools 中内容理解支持的区域以及 终结点中使用 Microsoft Foundry 资源https://<resource-name>.services.ai.azure.com。 部署嵌入模型,并在启用图像语言化时部署多模式聊天模型。创建知识源的权限。 使用分配给用户帐户的搜索服务参与者和搜索索引数据参与者角色(建议)或使用管理员 API 密钥配置无密钥身份验证。
如果知识来源为嵌入或图像描述指定了 Azure OpenAI 模型,则搜索服务必须具有托管标识,并且该标识在 Microsoft Foundry 资源上具有认知服务用户权限。
所需
Azure.Search.Documents软件包:对于
2026-08-01-preview功能,最新的预览包:dotnet add package Azure.Search.Documents --prerelease对于
2026-04-01功能,最新稳定版软件包:dotnet add package Azure.Search.Documents
对于无密钥身份验证,请使用
Azure.Identity软件包:dotnet add package Azure.Identity
所需
azure-search-documents软件包:对于
2026-08-01-preview功能,最新的预览包:pip install --pre azure-search-documents对于
2026-04-01功能,最新稳定版软件包:pip install azure-search-documents
对于无密钥身份验证,请使用
azure-identity软件包:pip install azure-identity
所需的搜索服务 REST API 版本:
对于预览功能: 2026-08-01-preview
对于正式发布的功能:2026-04-01
对于无密钥身份验证,请在每个 HTTP 请求的标头中包含
AuthorizationMicrosoft Entra ID令牌。
局限性
索引的 OneLake 知识源不支持专用同步。 保持 networkAccessMode 设置为 public.
检查现有知识源
知识源是顶级可重用对象。 了解现有知识源有助于重复使用或命名新对象。
运行以下代码,按名称和类型列出知识源。
// List knowledge sources by name and type
using Azure.Search.Documents.Indexes;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential);
var knowledgeSources = indexClient.GetKnowledgeSourcesAsync();
Console.WriteLine("Knowledge Sources:");
await foreach (var ks in knowledgeSources)
{
Console.WriteLine($" Name: {ks.Name}, Type: {ks.GetType().Name}");
}
Reference:SearchIndexClient
# List knowledge sources by name and type
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key"))
for ks in index_client.list_knowledge_sources():
print(f" - {ks.name} ({ks.kind})")
Reference:SearchIndexClient
### List knowledge sources by name and type
GET {{search-url}}/knowledgesources?api-version={{api-version}}&$select=name,kind
Authorization: Bearer {{token}}
参考:知识源 - 列表
还可以按名称返回单个知识源以查看其 JSON 定义。
using Azure.Search.Documents.Indexes;
using System.Text.Json;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential);
// Specify the knowledge source name to retrieve
string ksNameToGet = "earth-knowledge-source";
// Get its definition
var knowledgeSourceResponse = await indexClient.GetKnowledgeSourceAsync(ksNameToGet);
var ks = knowledgeSourceResponse.Value;
// Serialize to JSON for display
var jsonOptions = new JsonSerializerOptions
{
WriteIndented = true,
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.Never
};
Console.WriteLine(JsonSerializer.Serialize(ks, ks.GetType(), jsonOptions));
Reference:SearchIndexClient
# Get a knowledge source definition
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
import json
index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key"))
ks = index_client.get_knowledge_source("knowledge_source_name")
print(json.dumps(ks.as_dict(), indent = 2))
Reference:SearchIndexClient
### Get a knowledge source definition
GET {{search-url}}/knowledgesources/{{knowledge-source-name}}?api-version={{api-version}}
Authorization: Bearer {{token}}
参考:知识源 - 获取
以下 JSON 是已编入索引的 OneLake 知识源的示例响应。
{
"name": "my-onelake-ks",
"kind": "indexedOneLake",
"description": "A sample indexed OneLake knowledge source.",
"encryptionKey": null,
"indexedOneLakeParameters": {
"fabricWorkspaceId": "<REDACTED>",
"lakehouseId": "<REDACTED>",
"targetPath": null,
"ingestionParameters": {
"disableImageVerbalization": false,
"ingestionPermissionOptions": [],
"contentExtractionMode": "standard",
"identity": null,
"embeddingModel": {
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "<REDACTED>",
"deploymentId": "text-embedding-3-large",
"modelName": "text-embedding-3-large"
}
},
"chatCompletionModel": {
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "<aoai-endpoint>",
"deploymentId": "gpt-5-mini",
"modelName": "gpt-5-mini"
}
},
"ingestionSchedule": null,
"aiServices": {
"uri": "<aoai-endpoint>",
}
},
"createdResources": {
"datasource": "my-onelake-ks-datasource",
"indexer": "my-onelake-ks-indexer",
"skillset": "my-onelake-ks-skillset",
"index": "my-onelake-ks-index"
}
}
}
创建知识源
运行以下代码以创建索引的 OneLake 知识源。
// Create an indexed OneLake knowledge source
using Azure.Search.Documents.Indexes;
using Azure.Search.Documents.Indexes.Models;
using Azure.Search.Documents.KnowledgeBases.Models;
using Azure.Search.Documents.Models;
using Azure.Identity;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), new DefaultAzureCredential());
var chatCompletionParams = new AzureOpenAIVectorizerParameters
{
ResourceUri = new Uri(aoaiEndpoint),
DeploymentName = aoaiGptDeployment,
ModelName = aoaiGptModel
};
var embeddingParams = new AzureOpenAIVectorizerParameters
{
ResourceUri = new Uri(aoaiEndpoint),
DeploymentName = aoaiEmbeddingDeployment,
ModelName = aoaiEmbeddingModel
};
var ingestionParams = new KnowledgeSourceIngestionParameters
{
NetworkAccessMode = KnowledgeSourceNetworkAccessMode.Public,
DisableImageVerbalization = false,
ChatCompletionModel = new KnowledgeBaseAzureOpenAIModel(azureOpenAIParameters: chatCompletionParams),
EmbeddingModel = new KnowledgeSourceAzureOpenAIVectorizer
{
AzureOpenAIParameters = embeddingParams
},
IngestionPermissionOptions = new List<KnowledgeSourceIngestionPermissionOption>
{
KnowledgeSourceIngestionPermissionOption.UserIds,
KnowledgeSourceIngestionPermissionOption.GroupIds
}
};
var oneLakeParams = new IndexedOneLakeKnowledgeSourceParameters(
fabricWorkspaceId: fabricWorkspaceId,
lakehouseId: lakehouseId)
{
IngestionParameters = ingestionParams
};
var knowledgeSource = new IndexedOneLakeKnowledgeSource(
name: "my-onelake-ks",
indexedOneLakeParameters: oneLakeParams)
{
Description = "This knowledge source pulls content from a lakehouse."
};
await indexClient.CreateOrUpdateKnowledgeSourceAsync(knowledgeSource);
Console.WriteLine($"Knowledge source '{knowledgeSource.Name}' created or updated successfully.");
Reference:SearchIndexClient、 IndexedOneLakeKnowledgeSource
# Create an indexed OneLake knowledge source
from azure.identity import DefaultAzureCredential
from azure.search.documents.indexes import SearchIndexClient
from azure.search.documents.indexes.models import IndexedOneLakeKnowledgeSource, IndexedOneLakeKnowledgeSourceParameters, KnowledgeBaseAzureOpenAIModel, AzureOpenAIVectorizerParameters, KnowledgeSourceAzureOpenAIVectorizer, KnowledgeSourceContentExtractionMode, KnowledgeSourceIngestionParameters
from azure.search.documents.knowledgebases.models import KnowledgeSourceNetworkAccessMode
index_client = SearchIndexClient(endpoint = "<search-endpoint>", credential = DefaultAzureCredential())
knowledge_source = IndexedOneLakeKnowledgeSource(
name = "my-onelake-ks",
description= "This knowledge source pulls content from a lakehouse.",
encryption_key = None,
indexed_one_lake_parameters = IndexedOneLakeKnowledgeSourceParameters(
fabric_workspace_id = "fabric_workspace_id",
lakehouse_id = "lakehouse_id",
target_path = None,
ingestion_parameters = KnowledgeSourceIngestionParameters(
network_access_mode = KnowledgeSourceNetworkAccessMode.PUBLIC,
identity = None,
disable_image_verbalization = False,
chat_completion_model = KnowledgeBaseAzureOpenAIModel(
azure_open_ai_parameters = AzureOpenAIVectorizerParameters(
resource_url = "<aoai-endpoint>",
deployment_name = "<aoai-gpt-deployment>",
model_name = "<aoai-gpt-model>",
)
),
embedding_model = KnowledgeSourceAzureOpenAIVectorizer(
azure_open_ai_parameters=AzureOpenAIVectorizerParameters(
resource_url = "<aoai-endpoint>",
deployment_name = "<aoai-embedding-deployment>",
model_name = "<aoai-embedding-model>",
)
),
content_extraction_mode = KnowledgeSourceContentExtractionMode.MINIMAL,
ingestion_schedule = None,
ingestion_permission_options = ["user_ids", "group_ids"]
)
)
)
index_client.create_or_update_knowledge_source(knowledge_source)
print(f"Knowledge source '{knowledge_source.name}' created or updated successfully.")
Reference:SearchIndexClient
### Create an indexed OneLake knowledge source
PUT {{search-endpoint}}/knowledgesources/my-onelake-ks?api-version=2026-08-01-preview
Authorization: Bearer {{search-access-token}}
Content-Type: application/json
{
"name": "my-onelake-ks",
"kind": "indexedOneLake",
"description": "This knowledge source pulls content from a lakehouse.",
"indexedOneLakeParameters": {
"fabricWorkspaceId": "<fabric-workspace-id>",
"lakehouseId": "<lakehouse-id>",
"targetPath": null,
"ingestionParameters": {
"networkAccessMode": "public",
"identity": null,
"disableImageVerbalization": null,
"chatCompletionModel": {
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "{{aoai-endpoint}}",
"deploymentId": "{{aoai-gpt-deployment}}",
"modelName": "{{aoai-gpt-model}}"
}
},
"embeddingModel": {
"kind": "azureOpenAI",
"azureOpenAIParameters": {
"resourceUri": "{{aoai-endpoint}}",
"deploymentId": "{{aoai-embedding-deployment}}",
"modelName": "{{aoai-embedding-model}}"
}
},
"contentExtractionMode": "minimal",
"ingestionSchedule": null,
"ingestionPermissionOptions": ["userIds", "groupIds"]
}
}
}
参考:知识源 - 创建或更新
注意
若要使用 ingestionPermissionOptions 强制执行文档级权限,请使用 2026-08-01-preview API 版本。 2026-04-01 API 版本不支持此功能。
使用按语言自动选择的分析器(预览版)
从 2026-08-01-preview API 版本开始,针对 Blob、已编制索引的 OneLake 以及已编制索引的 SharePoint 知识源提供了按语言的自动分析器。 启用后,Azure AI 搜索检测每个源文档的语言,并自动应用匹配Microsoft语言分析器。 不会在知识源定义或查询中指定分析器。
若要启用每种语言的自动分析器,请在知识源定义中设置为contentExtractionModeminimal和配置ingestionParameters.aiServices。
对于无密钥身份验证,请省略 aiServices.apiKey,并在 Microsoft Foundry 资源上将 认知服务用户 角色分配给搜索服务的托管标识。 对于基于密钥的身份验证,请将 aiServices.apiKey 设置为您的 Foundry 资源的有效密钥。
支持以下语言:
- English
- 日语
- French
- Spanish
- German
- 荷兰语
- Italian
- 巴西葡萄牙语
- 欧洲葡萄牙语
- 简体中文
- 繁体中文
- Korean
对于多语言内容,Azure AI 搜索根据检测到的主要语言选择分析器。 当语言不受支持或不确定时,它使用标准分析器。
启用自动每种语言分析器时,Azure AI 搜索向生成的索引架构添加每个支持语言的语言特定内容字段,无论数据是否包含这些语言中的文档。 在摄取过程中,文档会根据检测到的语言被路由到相应的语言专用字段。
未使用的语言字段不包含索引内容,并且存储影响最小,但它们仍然是索引架构的一部分,并计入索引字段限制。 规划索引设计、字段计数和存储要求时,请考虑其他字段。 有关更多信息,请参阅索引限制和估算和管理搜索服务的容量。
语言检测在超出免费 AI 增强额度后将开始收费。 有关详细信息,请参阅 免费扩充。
检查摄取状态
运行以下代码来监视引入进度和运行状况,包括知识源类型以及生成索引器管道并填充搜索索引的知识源的详细索引错误。
using Azure.Search.Documents.Indexes;
using System.Text.Json;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), new AzureKeyCredential(apiKey));
// Get knowledge source ingestion status
var statusResponse = await indexClient.GetKnowledgeSourceStatusAsync(knowledgeSourceName);
var status = statusResponse.Value;
// Serialize to JSON for display
var json = JsonSerializer.Serialize(status, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(json);
Reference:SearchIndexClient
# Check knowledge source ingestion status
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
import json
index_client = SearchIndexClient(endpoint="search_url", credential=AzureKeyCredential("api_key"))
status = index_client.get_knowledge_source_status("knowledge_source_name")
print(json.dumps(status.as_dict(), indent=2))
Reference:SearchIndexClient
### Check knowledge source ingestion status
GET {{search-url}}/knowledgesources/{{knowledge-source-name}}/status?api-version={{api-version}}
Authorization: Bearer {{token}}
Content-Type: application/json
参考:知识源 - 获取状态
包含引入参数且正在主动引入内容的请求的响应可能如以下示例所示。
{
"kind": "azureBlob",
"synchronizationStatus": "active",
"synchronizationInterval": "1d",
"currentSynchronizationState": {
"startTime": "2026-04-10T19:30:00Z",
"itemUpdatesProcessed": 1100,
"itemsUpdatesFailed": 100,
"itemsSkipped": 1100,
"errors": [
{
"key": "Item id 1",
"docURL": "https://contoso.blob.core.windows.net/contracts/2024/Q4/doc-00023.csv",
"statusCode": 400,
"componentName": "DocumentExtraction.AzureBlob.MyDataSource",
"errorMessage": "Could not read the value of column 'foo' at index '0'.",
"details": "The file could not be parsed.",
"documentationLink": "https://go.microsoft.com/fwlink/?linkid=2049388"
}
]
},
"lastSynchronizationState": {
"status": "partialSuccess",
"startTime": "2026-04-09T19:30:00Z",
"endTime": "2026-04-09T19:40:01Z",
"itemUpdatesProcessed": 1100,
"itemsUpdatesFailed": 100,
"itemsSkipped": 1100,
"errors": null
},
"statistics": {
"totalSynchronizations": 25,
"averageSynchronizationDuration": "00:15:20",
"averageItemsProcessedPerSynchronization": 500
}
}
注意
从 2026-04-01 API 版本开始,文档级错误详细信息的 kind 属性和 currentSynchronizationState.errors[] 数组即可使用。 对于早期 API 版本,不会返回这些字段。 该 lastSynchronizationState.status 字段也是 2026-04-01 中的新增字段。
查看生成的对象
创建此知识源时,Azure AI 搜索自动生成数据源、技能集、索引器和索引。 创建响应将列出下 createdResources的每个对象。
这些对象根据固定模板生成,其名称基于知识源的名称。 无法更改对象名称。 避免直接编辑这些对象,因为更改可能会引入中断索引器管道的错误或不兼容。
可以使用Azure门户验证对象创建。 工作流为:
检查索引器是否有成功或失败的消息。 这里会显示连接错误或配额错误。
检查数据源以验证与数据存储的连接。 该连接使用连接字符串或托管标识,具体取决于你如何配置知识源。
检查技能集以查看内容是如何分块和选择性的矢量化的。
检查索引以了解您的内容是如何被编制索引和公开以供检索的,包括哪些字段可供搜索和筛选,以及哪些字段存储用于相似性搜索的向量。 使用搜索资源管理器针对生成的索引运行查询。
分配给知识库
如果对知识源感到满意, 请将其添加到知识库。
对于任何指定为 OneLake 知识源且已编入索引的知识库,请确保将 includeReferenceSourceData 设置为 true。 此步骤是将源文档 URL 拉取到引文中所必需的。
查询知识库
配置知识库后, 调用检索操作或 MCP 终结点 来查询知识源。 选择与方案匹配的配置。
强制实施文档级权限(预览版)
若要强制实施文档级权限,请在创建此知识源时设置 ingestionPermissionOptions ,然后在检索请求中包含用户的访问令牌。 有关详细信息,请参阅在查询时强制实施权限(预览版)。
显示文档嵌入图像(预览版)
若要在答案合成响应中显示文档嵌入的图像(如图表或扫描),请对此知识源进行配置 assetStore ,然后在知识库上启用图像服务。 配置了 ingestionPermissionOptions 时,不支持图像服务。 有关详细信息,请参阅代理检索中Surface文档嵌入图像(预览版)。
删除知识源
在删除知识库之前,必须删除引用它的任何知识库或更新知识库定义以删除引用。 对于生成索引和索引器管道的知识源,也会删除所有 生成的对象 。 但是,如果使用现有索引创建知识源,则不会删除索引。
如果尝试删除正在使用的知识源,该操作将失败并返回受影响的知识库列表。
删除知识源:
获取搜索服务上所有知识库的列表。
using Azure.Search.Documents.Indexes; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); var knowledgeBases = indexClient.GetKnowledgeBasesAsync(); Console.WriteLine("Knowledge Bases:"); await foreach (var kb in knowledgeBases) { Console.WriteLine($" - {kb.Name}"); }Reference:SearchIndexClient
示例响应可能如下所示:
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }获取单个知识库定义以检查知识源引用。
using Azure.Search.Documents.Indexes; using System.Text.Json; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); // Specify the knowledge base name to retrieve string kbNameToGet = "earth-knowledge-base"; // Get a specific knowledge base definition var knowledgeBaseResponse = await indexClient.GetKnowledgeBaseAsync(kbNameToGet); var kb = knowledgeBaseResponse.Value; // Serialize to JSON for display string json = JsonSerializer.Serialize(kb, new JsonSerializerOptions { WriteIndented = true }); Console.WriteLine(json);Reference:SearchIndexClient
示例响应可能如下所示:
{ "Name": "earth-knowledge-base", "KnowledgeSources": [ { "Name": "earth-knowledge-source" } ], "Models": [ {} ], "RetrievalReasoningEffort": {}, "OutputMode": {}, "ETag": "\u00220x8DE278629D782B3\u0022", "EncryptionKey": null, "Description": null, "RetrievalInstructions": null, "AnswerInstructions": null }删除知识库,或者如果有多个知识库,请更新知识库以删除源。 此示例显示删除。
using Azure.Search.Documents.Indexes; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); await indexClient.DeleteKnowledgeBaseAsync(knowledgeBaseName); System.Console.WriteLine($"Knowledge base '{knowledgeBaseName}' deleted successfully.");Reference:SearchIndexClient
删除知识源。
await indexClient.DeleteKnowledgeSourceAsync(knowledgeSourceName); System.Console.WriteLine($"Knowledge source '{knowledgeSourceName}' deleted successfully.");Reference:SearchIndexClient
获取搜索服务上所有知识库的列表。
# Get knowledge bases from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) print("Knowledge Bases:") for kb in index_client.list_knowledge_bases(): print(f" - {kb.name}")Reference:SearchIndexClient
示例响应可能如下所示:
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }获取单个知识库定义以检查知识源引用。
# Get a knowledge base definition from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) kb = index_client.get_knowledge_base("knowledge_base_name") print(kb)Reference:SearchIndexClient
示例响应可能如下所示:
{ "name": "my-kb", "description": null, "retrievalInstructions": null, "answerInstructions": null, "outputMode": null, "knowledgeSources": [ { "name": "my-blob-ks" } ], "models": [], "encryptionKey": null, "retrievalReasoningEffort": { "kind": "low" } }删除知识库,或者如果有多个知识库,请更新知识库以删除源。 此示例显示删除。
# Delete a knowledge base from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) index_client.delete_knowledge_base("knowledge_base_name") print(f"Knowledge base deleted successfully.")Reference:SearchIndexClient
删除知识源。
# Delete a knowledge source from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) index_client.delete_knowledge_source("knowledge_source_name") print(f"Knowledge source deleted successfully.")Reference:SearchIndexClient
获取搜索服务上所有知识库的列表。
### Get knowledge bases GET {{search-url}}/knowledgebases?api-version={{api-version}}&$select=name Authorization: Bearer {{token}}参考:知识库 - 列表
示例响应可能如下所示:
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }获取单个知识库定义以检查知识源引用。
### Get a knowledge base definition GET {{search-url}}/knowledgebases/{{knowledge-base-name}}?api-version={{api-version}} Authorization: Bearer {{token}}参考:知识库 - 获取
示例响应可能如下所示:
{ "name": "my-kb", "description": null, "retrievalInstructions": null, "answerInstructions": null, "outputMode": null, "knowledgeSources": [ { "name": "my-blob-ks" } ], "models": [], "encryptionKey": null, "retrievalReasoningEffort": { "kind": "low" } }删除知识库,或者如果有多个知识库,请更新知识库以删除源。 此示例显示删除。
### Delete a knowledge base DELETE {{search-url}}/knowledgebases/{{knowledge-base-name}}?api-version={{api-version}} Authorization: Bearer {{token}}参考:知识库 - 删除
删除知识源。
### Delete a knowledge source DELETE {{search-url}}/knowledgesources/{{knowledge-source-name}}?api-version={{api-version}} Authorization: Bearer {{token}}参考:知识源 - 删除