text
Creates, updates, deletes, gets or lists a text resource.
Overview
| Name | text |
| Type | Resource |
| Id | gemini.models.text |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_embed_text | exec | modelsId | Generates multiple embeddings from the model given input text in a synchronous call. | |
generate_text | exec | modelsId | Generates a response from the model given an input message. | |
embed_text | exec | modelsId | Generates an embedding from the model given an input message. | |
count_text_tokens | exec | modelsId | Runs a model's tokenizer on a text and returns the token count. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
modelsId | string |
Lifecycle Methods
- batch_embed_text
- generate_text
- embed_text
- count_text_tokens
Generates multiple embeddings from the model given input text in a synchronous call.
EXEC gemini.models.text.batch_embed_text
@modelsId='{{ modelsId }}' --required
@@json=
'{
"requests": "{{ requests }}",
"texts": "{{ texts }}"
}'
;
Generates a response from the model given an input message.
EXEC gemini.models.text.generate_text
@modelsId='{{ modelsId }}' --required
@@json=
'{
"topK": {{ topK }},
"maxOutputTokens": {{ maxOutputTokens }},
"safetySettings": "{{ safetySettings }}",
"candidateCount": {{ candidateCount }},
"temperature": {{ temperature }},
"topP": {{ topP }},
"stopSequences": "{{ stopSequences }}",
"prompt": "{{ prompt }}"
}'
;
Generates an embedding from the model given an input message.
EXEC gemini.models.text.embed_text
@modelsId='{{ modelsId }}' --required
@@json=
'{
"model": "{{ model }}",
"text": "{{ text }}"
}'
;
Runs a model's tokenizer on a text and returns the token count.
EXEC gemini.models.text.count_text_tokens
@modelsId='{{ modelsId }}' --required
@@json=
'{
"prompt": "{{ prompt }}"
}'
;