Thinking messages #4471
Replies: 1 comment
-
|
Hey, I was looking into this too because exposing those internal IDs and tool schemas is definitely a bad practice for production UIs. It seems like ThinkingConfig(include_thoughts=True) is designed to be 'all or nothing' right now—it just streams the raw model reasoning. Looking at the Gemini Thinking docs, it’s confirmed that these thoughts provide 'insights into the model's internal reasoning process,' which naturally includes the tool-call planning you’re seeing. The cleanest workaround I’ve found is to intercept the event stream in your runner. Instead of passing the raw stream to the frontend, you can wrap runner.run_async() and check if part.thought is true. If it is, just swap the content for a generic 'Thinking...' message before yielding it. It’s a bit manual, but until the ADK adds a native 'masking' or 'summary' layer to ThinkingConfig, filtering the events yourself seems to be the way. and check out these links : https://ai.google.dev/gemini-api/docs/thinking |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to enable thinking messages that don’t leak internals of the application? So more customer friendly thinking messages?
I have tried using ThinkingConfig and including thoughts but these return information about tool calls and use IDs etc that come from our APIs and expose internals of our APIs etc. Is there a way to make it more generic or tune it in a way?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions