Foundation Models Embedding API, gRPC: EmbeddingsService.TextEmbedding
Статья создана
Обновлена 26 ноября 2024 г.
A method for obtaining embeddings from text data.
gRPC request
rpc TextEmbedding (TextEmbeddingRequest) returns (TextEmbeddingResponse)
TextEmbeddingRequest
{
"model_uri": "string",
"text": "string"
}
Request for the service to obtain text embeddings.
Field |
Description |
model_uri |
string The model URI to be used for obtaining text embeddings. |
text |
string The input text for which the embedding is requested. |
TextEmbeddingResponse
{
"embedding": [
"double"
],
"num_tokens": "int64",
"model_version": "string"
}
Response containing generated text embedding.
Field |
Description |
embedding[] |
double A repeated list of double values representing the embedding. |
num_tokens |
int64 The number of tokens in the input text. |
model_version |
string The model version changes with each new releases. |