fix(infra): api_hook_client debug logging, gemini_cli_adapter streaming fixes, ai_client minor

This commit is contained in:
2026-03-02 10:15:28 -05:00
parent fc9634fd73
commit 89e82f1134
3 changed files with 13 additions and 3 deletions

View File

@@ -130,3 +130,11 @@ class GeminiCliAdapter:
"tool_calls": tool_calls,
"stderr": stderr_final
}
def count_tokens(self, contents: list[str]) -> int:
"""
Provides a character-based token estimation for the Gemini CLI.
Uses 4 chars/token as a conservative average.
"""
total_chars = len("\n".join(contents))
return total_chars // 4