cohere_tokenize().
Samples
Detokenize tokens
'PostgreSQL is a powerful database'
Round-trip tokenization
Arguments
Returns
TEXT: The reconstructed text from the token IDs.
Related functions
cohere_tokenize(): convert text into tokens
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Convert token IDs back into text
cohere_tokenize().
SELECT ai.cohere_detokenize(
'embed-english-v3.0',
ARRAY[5432, 8754, 389, 264, 8147, 4729]
);
'PostgreSQL is a powerful database'
SELECT ai.cohere_detokenize(
'embed-english-v3.0',
ai.cohere_tokenize('embed-english-v3.0', 'Hello, world!')
);
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
model | TEXT | - | ✔ | Cohere model for detokenization |
tokens | INT[] | - | ✔ | Array of token IDs to convert |
api_key | TEXT | NULL | ✖ | Cohere API key |
api_key_name | TEXT | NULL | ✖ | Name of secret containing the API key |
verbose | BOOLEAN | FALSE | ✖ | Enable verbose logging |
TEXT: The reconstructed text from the token IDs.
cohere_tokenize(): convert text into tokens