cohere_tokenize().
Samples
Detokenize tokens
'PostgreSQL is a powerful database'
Round-trip tokenization
Arguments
| 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 |
Returns
TEXT: The reconstructed text from the token IDs.
Related functions
cohere_tokenize(): convert text into tokens