From 0fcc29c9af81f3490ef3bf359b475a894aac7f7e Mon Sep 17 00:00:00 2001 From: Clansty Date: Sat, 27 Dec 2025 21:16:59 +0800 Subject: [PATCH] fix --- src/adapter.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/adapter.js b/src/adapter.js index 8bff212..ed5d677 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -306,6 +306,15 @@ export class KiroApiServiceAdapter extends ApiServiceAdapter { } return this.kiroApiService.getUsageLimits(); } + + /** + * Count tokens for a message request (compatible with Anthropic API) + * @param {Object} requestBody - The request body containing model, messages, system, tools, etc. + * @returns {Object} { input_tokens: number } + */ + countTokens(requestBody) { + return this.kiroApiService.countTokens(requestBody); + } } // Qwen API 服务适配器