- 在 KiroApiService 中添加 countTokens 方法,支持计算 messages、system、tools 的 token 数
- 使用 @anthropic-ai/tokenizer 进行准确的 token 计算
- 支持 text、tool_use、tool_result、image、document 等内容类型
- 修改 request-handler.js 处理 POST /v1/messages/count_tokens 请求
- 返回格式与 Anthropic 官方 API 一致:{ input_tokens: number }
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| claude-core.js | ||
| claude-kiro.js | ||
| claude-strategy.js | ||