YandexGPT API, REST: Embeddings.embedding
Статья создана
Обновлена 6 декабря 2023 г.
RPC method to obtain embeddings for input text data.
HTTP request
POST https://llm.api.cloud.yandex.net/llm/v1alpha/embedding
Body parameters
{
"embeddingType": "string",
"model": "string",
"text": "string"
}
Represents a request to obtain embeddings for text data.
Field | Description |
---|---|
embeddingType | string The type of embedding to be generated. Enum to specify the type of embedding to be generated.
|
model | string The name or identifier of the model to be used for embedding. Possible value for now: The maximum string length in characters is 50. |
text | string The input text for which the embedding is requested. |
Response
HTTP Code: 200 - OK
{
"embedding": [
"number"
],
"numTokens": "string"
}
Represents a response containing embeddings for input text data.
Field | Description |
---|---|
embedding[] | number (double) A repeated list of double values representing the embedding. |
numTokens | string (int64) The number of tokens in the input text. |