Skip to content

Conversation

shyamnamboodiripad
Copy link
Contributor

@shyamnamboodiripad shyamnamboodiripad commented Apr 18, 2025

This change is being made because there is still some uncertainty around what a general-purpose token counting abstraction (that supports all kinds of future models, and all kinds of input modalities) should look like at the moment. We do not want to bake in an API that only supports text-based inputs for the models and use cases that are prevalent today, since it would be a potential breaking change to change this API after we release a stable version of the evaluation APIs.

We can always reintroduce the token counting support in a non-breaking fashion in the future if and when there is more clarity on what a general-purpose token counting abstraction should look like, or if and when a general-purpose token counting abstraction is introduced in a lower layer (Microsoft.Extensions.AI) in the future.

In the meanwhile, callers should still be able to use the Microsoft.ML.Tokenizers library directly to count tokens in text-based content and trim down the conversation history before calling EvaluateAsync() if needed.

Fixes #6234

Microsoft Reviewers: Open in CodeFlow

@shyamnamboodiripad shyamnamboodiripad requested a review from a team as a code owner April 18, 2025 08:55
@github-actions github-actions bot added the area-ai-eval Microsoft.Extensions.AI.Evaluation and related label Apr 18, 2025
@shyamnamboodiripad shyamnamboodiripad force-pushed the counter branch 2 times, most recently from 7511ebe to f93c418 Compare April 18, 2025 21:35
@shyamnamboodiripad shyamnamboodiripad force-pushed the counter branch 2 times, most recently from bd3f9b0 to 987b057 Compare April 22, 2025 21:05
This change is being made because there is still some uncertainty around what a general purpose token counting abstraction (that supports all kinds of future models, and all kinds of input modalities) should look like at the moment. We do not want to bake in an API that only supports text based inputs for the models and use cases that are prevalent today, since it would be a potential breaking change to change this API after we release a stable version of the evaluation APIs.

We can always reintroduce the token counting support in a non-breaking fashion in the future if and when there is more clarity on what a general purpose token counting abstraction should look like, or if and when a general purpose token counting abstraction is introduced in a lower layer (Microsoft.Extensions.AI) in the future.

In the meanwhile, callers should still be able to use the Microsoft.ML.Tokenizers library directly to count tokens in text-based content and trim down the conversation history before calling EvaluateAsync() if needed.
@shyamnamboodiripad shyamnamboodiripad merged commit 44eaa2e into dotnet:main Apr 23, 2025
6 checks passed
@shyamnamboodiripad shyamnamboodiripad deleted the counter branch April 23, 2025 17:44
@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai-eval Microsoft.Extensions.AI.Evaluation and related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AI Evaluation] Rationalize IEvaluationTokenCounter interface
2 participants