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

KnowledgeBaseReference Class

Definition

Base type for references. Please note this is the abstract base class. The derived classes available for instantiation are: KnowledgeBaseSearchIndexReference, KnowledgeBaseAzureBlobReference, KnowledgeBaseIndexedOneLakeReference, and KnowledgeBaseWebReference.

[System.ClientModel.Primitives.PersistableModelProxy(typeof(Azure.Search.Documents.KnowledgeBases.Models.UnknownKnowledgeBaseReference))]
public abstract class KnowledgeBaseReference : System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.KnowledgeBases.Models.KnowledgeBaseReference>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.KnowledgeBases.Models.KnowledgeBaseReference>
[System.ClientModel.Primitives.PersistableModelProxy(typeof(Azure.Search.Documents.Models.UnknownKnowledgeBaseReference))]
public abstract class KnowledgeBaseReference : System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.KnowledgeBases.Models.KnowledgeBaseReference>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.KnowledgeBases.Models.KnowledgeBaseReference>
[<System.ClientModel.Primitives.PersistableModelProxy(typeof(Azure.Search.Documents.KnowledgeBases.Models.UnknownKnowledgeBaseReference))>]
type KnowledgeBaseReference = class
    interface IJsonModel<KnowledgeBaseReference>
    interface IPersistableModel<KnowledgeBaseReference>
[<System.ClientModel.Primitives.PersistableModelProxy(typeof(Azure.Search.Documents.Models.UnknownKnowledgeBaseReference))>]
type KnowledgeBaseReference = class
    interface IJsonModel<KnowledgeBaseReference>
    interface IPersistableModel<KnowledgeBaseReference>
Public MustInherit Class KnowledgeBaseReference
Implements IJsonModel(Of KnowledgeBaseReference), IPersistableModel(Of KnowledgeBaseReference)
Inheritance
KnowledgeBaseReference
Derived
Attributes
Implements

Constructors

Name Description
KnowledgeBaseReference(String, Int32)

Initializes a new instance of KnowledgeBaseReference.

Properties

Name Description
ActivitySource

The source activity ID for the reference.

Id

The ID of the reference.

RerankerScore

The reranker score for the document reference.

SourceData

The source data for the reference.

To assign an object to the value of this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<KnowledgeBaseReference>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<KnowledgeBaseReference>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<KnowledgeBaseReference>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<KnowledgeBaseReference>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<KnowledgeBaseReference>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to