Skip to content

Better Token Counting #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Better Token Counting #187

wants to merge 2 commits into from

Conversation

DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Jul 10, 2025

This PR enhances the token counting capabilities using tiktoken-rs library.

Example Ouput

2025-07-10T16:36:40.602741Z  INFO Tool GetAlerts loaded with a character count of 552. Estimated tokens: 139 OpenAI tokens
2025-07-10T16:36:41.070129Z  INFO Tool GetForecast loaded with a character count of 902. Estimated tokens: 206 OpenAI tokens
2025-07-10T16:36:41.532066Z  INFO Tool GetAllWeatherData loaded with a character count of 1388. Estimated tokens: 321 OpenAI tokens

@DaleSeo DaleSeo self-assigned this Jul 10, 2025
@DaleSeo DaleSeo requested a review from a team as a code owner July 10, 2025 16:39
@apollo-librarian
Copy link

apollo-librarian bot commented Jul 10, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 7 changed, 0 removed
* (developer-tools)/apollo-mcp-server/(latest)/command-reference.mdx
* (developer-tools)/apollo-mcp-server/(latest)/quickstart.mdx
* (developer-tools)/apollo-mcp-server/(latest)/guides/index.mdx
* graphos/routing/(latest)/operations/subscriptions/configuration.mdx
* graphos/routing/(latest)/performance/caching/entity.mdx
* graphos/routing/v1/customization/native-plugins.mdx
* graphos/routing/v1/graphos-reporting.mdx

Build ID: a2d7e71e11f61e23f1380234

URL: https://www.apollographql.com/docs/deploy-preview/a2d7e71e11f61e23f1380234

@DaleSeo DaleSeo marked this pull request as draft July 10, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant