-
Notifications
You must be signed in to change notification settings - Fork 839
Labels
area-ai-evalMicrosoft.Extensions.AI.Evaluation and relatedMicrosoft.Extensions.AI.Evaluation and relatedenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one
Description
Currently IEvaluationTokenCounter
has a single int CountTokens(string message)
function that takes a string
and returns a token count. Ideally, this would also support other modalities like images, audio etc. We may also want to make the function asynchronous (to support cases where IO may be needed).
The proposal is to change the function to CountTokensAsync(AIContent content, CancellationToken cancellationToken)
with extension method overloads for counting tokens in IEnumerable<AIContent>
and ChatMessage
.
AIContent
already models all supported modalities so it seems like an ideal candidate.
Metadata
Metadata
Assignees
Labels
area-ai-evalMicrosoft.Extensions.AI.Evaluation and relatedMicrosoft.Extensions.AI.Evaluation and relatedenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one