Show / Hide Table of Contents

Class ImageEmbeddingsOptions

The configuration information for an image embeddings request.

Inheritance
System.Object
ImageEmbeddingsOptions
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.AI.Inference.dll
Syntax
public class ImageEmbeddingsOptions : System.ClientModel.Primitives.IJsonModel<Azure.AI.Inference.ImageEmbeddingsOptions>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Inference.ImageEmbeddingsOptions>

Constructors

ImageEmbeddingsOptions(IEnumerable<ImageEmbeddingInput>)

Initializes a new instance of ImageEmbeddingsOptions.

Declaration
public ImageEmbeddingsOptions (System.Collections.Generic.IEnumerable<Azure.AI.Inference.ImageEmbeddingInput> input);
Parameters
System.Collections.Generic.IEnumerable<ImageEmbeddingInput> input

Input image to embed. To embed multiple inputs in a single request, pass an array. The input must not exceed the max input tokens for the model.

Exceptions
System.ArgumentNullException

input is null.

Properties

AdditionalProperties

Additional Properties

To assign an object to the value of this property use System.BinaryData.FromObjectAsJson``1(``0,System.Text.Json.JsonSerializerOptions).

To assign an already formatted json string to this property use System.BinaryData.FromString(System.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" }.

Declaration
public System.Collections.Generic.IDictionary<string,BinaryData> AdditionalProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String,System.BinaryData>

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.

Declaration
public Nullable<int> Dimensions { get; set; }
Property Value
System.Nullable<System.Int32>

EncodingFormat

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.

Declaration
public Nullable<Azure.AI.Inference.EmbeddingEncodingFormat> EncodingFormat { get; set; }
Property Value
System.Nullable<EmbeddingEncodingFormat>

Input

Input image to embed. To embed multiple inputs in a single request, pass an array. The input must not exceed the max input tokens for the model.

Declaration
public System.Collections.Generic.IList<Azure.AI.Inference.ImageEmbeddingInput> Input { get; }
Property Value
System.Collections.Generic.IList<ImageEmbeddingInput>

InputType

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

Declaration
public Nullable<Azure.AI.Inference.EmbeddingInputType> InputType { get; set; }
Property Value
System.Nullable<EmbeddingInputType>

Model

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

Declaration
public string Model { get; set; }
Property Value
System.String

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Declaration
protected virtual void JsonModelWriteCore (System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.Text.Json.Utf8JsonWriter writer

The JSON writer.

System.ClientModel.Primitives.ModelReaderWriterOptions options

The client options for reading and writing models.

Explicit Interface Implementations

IJsonModel<ImageEmbeddingsOptions>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

Declaration
Azure.AI.Inference.ImageEmbeddingsOptions IJsonModel<ImageEmbeddingsOptions>.Create (ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.Text.Json.Utf8JsonReader reader

The System.Text.Json.Utf8JsonReader to read.

System.ClientModel.Primitives.ModelReaderWriterOptions options

The System.ClientModel.Primitives.ModelReaderWriterOptions to use.

Returns
ImageEmbeddingsOptions

A T representation of the JSON value.

Exceptions
System.FormatException

If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format.

IJsonModel<ImageEmbeddingsOptions>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided System.Text.Json.Utf8JsonWriter.

Declaration
void IJsonModel<ImageEmbeddingsOptions>.Write (System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.Text.Json.Utf8JsonWriter writer

The System.Text.Json.Utf8JsonWriter to write into.

System.ClientModel.Primitives.ModelReaderWriterOptions options

The System.ClientModel.Primitives.ModelReaderWriterOptions to use.

Exceptions
System.FormatException

If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format.

IPersistableModel<ImageEmbeddingsOptions>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided System.BinaryData into a model.

Declaration
Azure.AI.Inference.ImageEmbeddingsOptions IPersistableModel<ImageEmbeddingsOptions>.Create (BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.BinaryData data

The System.BinaryData to parse.

System.ClientModel.Primitives.ModelReaderWriterOptions options

The System.ClientModel.Primitives.ModelReaderWriterOptions to use.

Returns
ImageEmbeddingsOptions

A T representation of the data.

Exceptions
System.FormatException

If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format.

IPersistableModel<ImageEmbeddingsOptions>.GetFormatFromOptions(ModelReaderWriterOptions)

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

Declaration
string IPersistableModel<ImageEmbeddingsOptions>.GetFormatFromOptions (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.ClientModel.Primitives.ModelReaderWriterOptions options

The System.ClientModel.Primitives.ModelReaderWriterOptions to consider when serializing and deserializing the model.

Returns
System.String

The format that the model uses when communicating with the service.

IPersistableModel<ImageEmbeddingsOptions>.Write(ModelReaderWriterOptions)

Writes the model into a System.BinaryData.

Declaration
BinaryData IPersistableModel<ImageEmbeddingsOptions>.Write (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
System.ClientModel.Primitives.ModelReaderWriterOptions options

The System.ClientModel.Primitives.ModelReaderWriterOptions to use.

Returns
System.BinaryData

A binary representation of the written model.

Exceptions
System.FormatException

If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format.

Back to top Azure SDK for .NET