YandexGPT API, gRPC: EmbeddingsService.Embedding
Written by
Updated at October 17, 2024
RPC method to obtain embeddings for input text data.
gRPC request
rpc Embedding (EmbeddingRequest) returns (EmbeddingResponse)
EmbeddingRequest
{
"embeddingType": "EmbeddingType",
"model": "string",
"text": "string"
}
Represents a request to obtain embeddings for text data.
Field |
Description |
embeddingType |
enum EmbeddingType 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: |
text |
string The input text for which the embedding is requested. |
EmbeddingResponse
{
"embedding": [
"double"
],
"numTokens": "int64"
}
Represents a response containing embeddings for input text data.
Field |
Description |
embedding[] |
double A repeated list of double values representing the embedding. |
numTokens |
int64 The number of tokens in the input text. |