[GH-ISSUE #19] token计算的能够复核一下 #17

Closed
opened 2026-03-13 14:19:58 +03:00 by kerem · 1 comment
Owner

Originally created by @Theo-jobs on GitHub (Mar 11, 2026).
Original GitHub issue: https://github.com/7836246/cursor2api/issues/19

Originally created by @Theo-jobs on GitHub (Mar 11, 2026). Original GitHub issue: https://github.com/7836246/cursor2api/issues/19
kerem closed this issue 2026-03-13 14:20:04 +03:00
Author
Owner

@7836246 commented on GitHub (Mar 12, 2026):

V2.5.6 📊 Token 估算优化

  • 提取 estimateInputTokens() 为独立函数,Anthropic 和 OpenAI handler 共用
  • 估算比例从 1/4 调整为 1/3(更适合中英文混合和代码场景)+ 10% 安全边距
  • 新增工具定义的 token 估算(每个压缩工具签名 ~200 chars + 1000 chars 指令开销)
  • 替代之前 input_tokens: 100 的硬编码占位符
<!-- gh-comment-id:4043540845 --> @7836246 commented on GitHub (Mar 12, 2026): V2.5.6 📊 Token 估算优化 - 提取 `estimateInputTokens()` 为独立函数,Anthropic 和 OpenAI handler 共用 - 估算比例从 1/4 调整为 **1/3**(更适合中英文混合和代码场景)+ 10% 安全边距 - 新增工具定义的 token 估算(每个压缩工具签名 ~200 chars + 1000 chars 指令开销) - 替代之前 `input_tokens: 100` 的硬编码占位符
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cursor2api#17
No description provided.