Foundation Models Embedding API, gRPC: EmbeddingsService.TextEmbedding
Written by
Updated at October 17, 2024
A method for obtaining embeddings from text data.
gRPC request
rpc TextEmbedding (TextEmbeddingRequest) returns (TextEmbeddingResponse)
TextEmbeddingRequest
{
"modelUri": "string",
"text": "string"
}
Request for the service to obtain text embeddings.
Field |
Description |
modelUri |
string The ID of the model to be used for obtaining text embeddings. |
text |
string The input text for which the embedding is requested. |
TextEmbeddingResponse
{
"embedding": [
"double"
],
"numTokens": "int64",
"modelVersion": "string"
}
Response containing generated text embedding.
Field |
Description |
embedding[] |
double A repeated list of double values representing the embedding. |
numTokens |
int64 The number of tokens in the input text. |
modelVersion |
string The model version changes with each new releases. |