Generates an embedding from the model given an input message.
HTTP request
POST https://generativelanguage.googleapis.com/v1beta/{model=models/*}:embedText
Path parameters
Parameters | |
---|---|
model |
Required. The model name to use with the format model=models/{model}. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "text": string } |
Fields | |
---|---|
text |
Optional. The free-form input text that the model will turn into an embedding. |
Response body
The response to a EmbedTextRequest.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"embedding": {
object ( |
Fields | |
---|---|
embedding |
Output only. The embedding generated from the input text. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/generative-language
https://www.googleapis.com/auth/generative-language.tuning
https://www.googleapis.com/auth/generative-language.tuning.readonly
https://www.googleapis.com/auth/generative-language.retriever
https://www.googleapis.com/auth/generative-language.retriever.readonly
For more information, see the Authentication Overview.