EmbeddingsAsyncClient Class

  • java.lang.Object
    • com.azure.ai.inference.EmbeddingsAsyncClient

public final class EmbeddingsAsyncClient

Initializes a new instance of the asynchronous EmbeddingsClient type.

Method Summary

Modifier and Type Method and Description
Mono<EmbeddingsResult> embed(List<String> input)

Return the embedding vectors for given text prompts.

Mono<EmbeddingsResult> embed(List<String> input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams)

Return the embedding vectors for given text prompts.

Mono<Response<EmbeddingsResult>> embedWithResponse(List<String> input)

Return the embedding vectors for given text prompts.

Mono<Response<EmbeddingsResult>> embedWithResponse(List<String> input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams)

Return the embedding vectors for given text prompts.

Mono<ModelInfo> getModelInfo()

Returns information about the AI model.

Methods inherited from java.lang.Object

Method Details

embed

public Mono<EmbeddingsResult> embed(List<String> input)

Return the embedding vectors for given text prompts. The method makes a REST API call to the `/embeddings` route on the given endpoint.

Parameters:

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.

Returns:

representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios on successful completion of Mono.

embed

public Mono<EmbeddingsResult> embed(List<String> input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams)

Return the embedding vectors for given text prompts. The method makes a REST API call to the `/embeddings` route on the given endpoint.

Parameters:

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.
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.
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.
extraParams - Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. This sets the HTTP request header extra-parameters.

Returns:

representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios on successful completion of Mono.

embedWithResponse

public Mono<Response<EmbeddingsResult>> embedWithResponse(List<String> input)

Return the embedding vectors for given text prompts. The method makes a REST API call to the `/embeddings` route on the given endpoint.

Parameters:

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.

Returns:

representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios on successful completion of Mono.

embedWithResponse

public Mono<Response<EmbeddingsResult>> embedWithResponse(List<String> input, Integer dimensions, EmbeddingEncodingFormat encodingFormat, EmbeddingInputType inputType, String model, ExtraParameters extraParams)

Return the embedding vectors for given text prompts. The method makes a REST API call to the `/embeddings` route on the given endpoint.

Parameters:

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.
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.
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.
extraParams - Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload. This sets the HTTP request header extra-parameters.

Returns:

representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios on successful completion of Mono.

getModelInfo

public Mono<ModelInfo> getModelInfo()

Returns information about the AI model. The method makes a REST API call to the `/info` route on the given endpoint.

Returns:

represents some basic information about the AI model on successful completion of Mono.

Applies to