|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AIC Commands |
Short Name: etc
Estimate token count
AIC_---Artificial-Intelligenc2(Text)
Parameter |
Type |
Required |
Description |
Text |
String |
Yes |
Text to estimate token count for |
Type |
Description |
Long |
Returns estimated number of tokens |
·Uses GPT tokenizer approximation
·Roughly 4 characters = 1 token for English text
·Helps manage API costs and context limits
' Estimate tokens for a promptDim prompt As Stringprompt = "Explain quantum computing"tokens = AIC_---Artificial-Intelligenc2(prompt)Print "Estimated tokens: " & tokens
Calculates the approximate token count for the given text to estimate API usage.