AIC Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command >

AIC Commands

AIC_---Artificial-Intelligenc2

Previous Top Next


Description

Short Name: etc

Estimate token count

Syntax

AIC_---Artificial-Intelligenc2(Text)

Parameters

Parameter

Type

Required

Description

Text

String

Yes

Text to estimate token count for

Return Value

Type

Description

Long

Returns estimated number of tokens

Remarks

·Uses GPT tokenizer approximation

·Roughly 4 characters = 1 token for English text

·Helps manage API costs and context limits

Example

' 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.

See Also

·AIC_GetContent

·AIC_---Artificial-Intelligenc2