Skip to content
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

fix: use actual token counts instead of simplified counting #54

Closed
wants to merge 14 commits into from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix token counting in server.ts to use actual content length estimation instead of simplified 1-token-per-message counting.

Changes:

  • Replace Vercel's 1-token-per-message convention with content length estimation
  • Update token counting for all response types (answers, non-answers, errors)
  • Maintain compatibility with Vercel AI SDK interface
  • Add comprehensive tests for various message lengths

Link to Devin run: https://app.devin.ai/sessions/8068ee591fad401bb49a6562667eef1e

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot force-pushed the devin/1739266114-fix-token-counting branch from 769af1a to 48315c9 Compare February 11, 2025 11:01
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