get_tokens | R Documentation |
Converts text to tokens
get_tokens(text, model)
text |
a character string to encode to tokens, can be a vector |
model |
a model to use for tokenization, either a model name, e.g., |
a vector of tokens for the given text as integer
model_to_tokenizer()
, decode_tokens()
get_tokens("Hello World", "gpt-4o")
get_tokens("Hello World", "o200k_base")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.