Centralize creation of the AI object
In #587 @NTaylorMullen was asking for centralization of our ai object so that we can track tokens in a single place. https://github.com/google-gemini/gemini-cli/pull/587#discussion_r2112915544 need to do that refactor to support different sub-agent tools.
@allenhutchison were you going to tackle this or should I leave up for grabs?
@NTaylorMullen @allenhutchison do you mean you want one GoogleGenAI object or once GeminiClient that wraps this? I assume GeminiClient and you would track all the tokens in this client
@NTaylorMullen @allenhutchison do you mean you want one GoogleGenAI object or once GeminiClient that wraps this? I assume GeminiClient and you would track all the tokens in this client
Ya I think 1 GeminiClient which indirectly will enforce 1 GoogleGenAI object. Currently the web fetch and google search tools use the GoolgeGenAI object directly which is probably a miss. We should expand our client object to allow more general requests. That way we can ensure we have centralized token counting
Yep.. just need to find how to inject the client through the system
Yep.. just need to find how to inject the client through the system
https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/config/config.ts is where I'd do it. In a way it's our "DI" container in a lot of ways 😄