InferenceModelFactory.EmbeddingInput Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
One item to embed, defaulting to text: an optional id and exactly one source, content or url with sasToken.
public static Azure.Data.AI.EmbeddingInput EmbeddingInput(string id = default, Azure.Data.AI.EmbeddingContentKind? contentKind = default, string content = default, Uri uri = default, string sasToken = default);
static member EmbeddingInput : string * Nullable<Azure.Data.AI.EmbeddingContentKind> * string * Uri * string -> Azure.Data.AI.EmbeddingInput
Public Shared Function EmbeddingInput (Optional id As String = Nothing, Optional contentKind As Nullable(Of EmbeddingContentKind) = Nothing, Optional content As String = Nothing, Optional uri As Uri = Nothing, Optional sasToken As String = Nothing) As EmbeddingInput
Parameters
- id
- String
A caller-chosen identifier, up to 256 characters, echoed on the matching result.
- contentKind
- Nullable<EmbeddingContentKind>
What the item is: a document (text, the default), a search query (query) or a document image (image).
- content
- String
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.
- uri
- 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.
- sasToken
- String
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.
Returns
A new EmbeddingInput instance for mocking.