fix(infra): api_hook_client debug logging, gemini_cli_adapter streaming fixes, ai_client minor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user