Foundation Models Embedding API, REST: Embeddings.TextEmbedding

A method for obtaining embeddings from text data.

HTTP request

POST https://llm.api.cloud.yandex.net/foundationModels/v1/textEmbedding
        

Body parameters

{
          "modelUri": "string",
          "text": "string",
          "dim": "string"
        }
        

Request for the service to obtain text embeddings.

Field

Description

modelUri

string

The model URI to be used for obtaining text embeddings.

text

string

The input text for which the embedding is requested.

dim

string (int64)

Optional parameter to specify embedding dimension for models that support multi-dimensional outputs

Response

HTTP Code: 200 - OK

{
          "embedding": [
            "string"
          ],
          "numTokens": "string",
          "modelVersion": "string"
        }
        

Response containing generated text embedding.

Field

Description

embedding[]

string

A repeated list of double values representing the embedding.

numTokens

string (int64)

The number of tokens in the input text.

modelVersion

string

The model version changes with each new releases.

Предыдущая
Следующая