ภาษา

SearchModelFactory.KnowledgeBase Method

Definition

Represents a knowledge base definition.

public static Azure.Search.Documents.Indexes.Models.KnowledgeBase KnowledgeBase(string name, System.Collections.Generic.IEnumerable<Azure.Search.Documents.Indexes.Models.KnowledgeSourceReference> knowledgeSources, System.Collections.Generic.IEnumerable<Azure.Search.Documents.Indexes.Models.KnowledgeBaseTool> tools, System.Collections.Generic.IEnumerable<Azure.Search.Documents.Indexes.Models.KnowledgeBaseModel> models, Azure.Search.Documents.KnowledgeBases.Models.KnowledgeRetrievalReasoningEffort retrievalReasoningEffort, Azure.Search.Documents.KnowledgeBases.Models.KnowledgeRetrievalOutputMode? outputMode, Azure.ETag? eTag, Azure.Search.Documents.Indexes.Models.SearchResourceEncryptionKey encryptionKey, string description, System.Collections.Generic.IDictionary<string,string> tags, string retrievalInstructions, string answerInstructions, Azure.Search.Documents.Indexes.Models.CorsOptions corsOptions = default, Azure.Search.Documents.Indexes.Models.KnowledgeBaseRetrieveDefaults retrieveDefaults = default);
static member KnowledgeBase : string * seq<Azure.Search.Documents.Indexes.Models.KnowledgeSourceReference> * seq<Azure.Search.Documents.Indexes.Models.KnowledgeBaseTool> * seq<Azure.Search.Documents.Indexes.Models.KnowledgeBaseModel> * Azure.Search.Documents.KnowledgeBases.Models.KnowledgeRetrievalReasoningEffort * Nullable<Azure.Search.Documents.KnowledgeBases.Models.KnowledgeRetrievalOutputMode> * Nullable<Azure.ETag> * Azure.Search.Documents.Indexes.Models.SearchResourceEncryptionKey * string * System.Collections.Generic.IDictionary<string, string> * string * string * Azure.Search.Documents.Indexes.Models.CorsOptions * Azure.Search.Documents.Indexes.Models.KnowledgeBaseRetrieveDefaults -> Azure.Search.Documents.Indexes.Models.KnowledgeBase
Public Shared Function KnowledgeBase (name As String, knowledgeSources As IEnumerable(Of KnowledgeSourceReference), tools As IEnumerable(Of KnowledgeBaseTool), models As IEnumerable(Of KnowledgeBaseModel), retrievalReasoningEffort As KnowledgeRetrievalReasoningEffort, outputMode As Nullable(Of KnowledgeRetrievalOutputMode), eTag As Nullable(Of ETag), encryptionKey As SearchResourceEncryptionKey, description As String, tags As IDictionary(Of String, String), retrievalInstructions As String, answerInstructions As String, Optional corsOptions As CorsOptions = Nothing, Optional retrieveDefaults As KnowledgeBaseRetrieveDefaults = Nothing) As KnowledgeBase

Parameters

name
String

The name of the knowledge base.

knowledgeSources
IEnumerable<KnowledgeSourceReference>

Knowledge sources referenced by this knowledge base.

tools
IEnumerable<KnowledgeBaseTool>

Named retrieval tools, each limited to a subset of this knowledge base's sources. When configured, MCP advertises these tools in addition to the built-in knowledge_base_retrieve tool, which retrieves from the full knowledge base. Omitting tools or supplying an empty array in this API version clears existing tools.

models
IEnumerable<KnowledgeBaseModel>

Contains configuration options on how to connect to AI models.

retrievalReasoningEffort
KnowledgeRetrievalReasoningEffort

The retrieval reasoning effort configuration.

outputMode
Nullable<KnowledgeRetrievalOutputMode>

The output mode for the knowledge base.

eTag
Nullable<ETag>

The ETag of the knowledge base.

encryptionKey
SearchResourceEncryptionKey

A description of an encryption key that you create in Azure Key Vault.

description
String

The description of the knowledge base.

tags
IDictionary<String,String>

User-defined key-value pairs for categorizing the knowledge base and attributing its usage and costs.

retrievalInstructions
String

Instructions considered by the knowledge base when developing query plan.

answerInstructions
String

Instructions considered by the knowledge base when generating answers.

corsOptions
CorsOptions

Options to control Cross-Origin Resource Sharing (CORS) for the knowledge base.

retrieveDefaults
KnowledgeBaseRetrieveDefaults

Persisted request-wide retrieve defaults for this knowledge base. These values apply to retrieve requests that omit the corresponding fields; request-time values take precedence when present.

Returns

A new KnowledgeBase instance for mocking.

Applies to