Dela via


EmbeddingsOptions Class

Definition

The configuration information for an embeddings request.

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

Constructors

EmbeddingsOptions(IEnumerable<String>)

Initializes a new instance of EmbeddingsOptions.

Properties

AdditionalProperties

Additional Properties

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" }.

Dimensions

Optional. The number of dimensions the resulting output embeddings should have. Passing null causes the model to use its default value. Returns a 422 error if the model doesn't support the value or parameter.

EncodingFormat

Optional. The desired format for the returned embeddings.

Input

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.

InputType

Optional. The type of the input. Returns a 422 error if the model doesn't support the value or parameter.

Model

ID of the specific AI model to use, if more than one model is available on the endpoint.

Explicit Interface Implementations

IJsonModel<EmbeddingsOptions>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

IJsonModel<EmbeddingsOptions>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<EmbeddingsOptions>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<EmbeddingsOptions>.GetFormatFromOptions(ModelReaderWriterOptions)

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

IPersistableModel<EmbeddingsOptions>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to