Language

EmbeddingInput Class

Definition

One item to embed, defaulting to text: an optional id and exactly one source, content or url with sasToken.

public class EmbeddingInput : System.ClientModel.Primitives.IJsonModel<Azure.Data.AI.EmbeddingInput>, System.ClientModel.Primitives.IPersistableModel<Azure.Data.AI.EmbeddingInput>
type EmbeddingInput = class
    interface IJsonModel<EmbeddingInput>
    interface IPersistableModel<EmbeddingInput>
Public Class EmbeddingInput
Implements IJsonModel(Of EmbeddingInput), IPersistableModel(Of EmbeddingInput)
Inheritance
EmbeddingInput
Implements

Constructors

Name Description
EmbeddingInput()

Initializes a new instance of EmbeddingInput.

Properties

Name Description
Content

The item, inline. For text and query: the text, up to 100,000 characters; text over the model's token limit (currently 8,192 tokens) isn't rejected: only its start is embedded, and the result is flagged with truncated and an EMBEDDING_INPUT_TRUNCATED warning. For image, only where the endpoint accepts inline images (off by default): a data:image/...;base64, URI or raw base64. The service never fetches URLs in content.

ContentKind

What the item is: a document (text, the default), a search query (query) or a document image (image).

Id

A caller-chosen identifier, up to 256 characters, echoed on the matching result.

SasToken

Required with url: a user delegation SAS for that one blob (its query string, with or without a leading ?): read-only (sp=r), for the blob (sr=b), https-only (spr=https), and signed by the identity that calls this API. A SAS valid for more than 15 minutes is accepted with warning EMBEDDING_SAS_LONG_LIVED. The service uses it for one read and never stores, logs or returns it.

Uri

For text and image items, from Microsoft Entra callers, where enabled: the Azure Blob Storage URL of the blob to embed, https://{account}.blob.core.windows.net/{container}/{blob}, with no query string. This is how images are sent by default. Text blobs are read as UTF-8, currently up to 1 MiB. Queries must be sent inline.

Methods

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

Explicit Interface Implementations

Name Description
IJsonModel<EmbeddingInput>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<EmbeddingInput>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<EmbeddingInput>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<EmbeddingInput>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<EmbeddingInput>.Write(ModelReaderWriterOptions)

Applies to