openai-scala-client
openai-scala-client copied to clipboard
Add support for Gemini "thinking budget" configuration
I noticed that CreateChatCompletionSettings includes ReasoningEffort, which is an enum.
Google's Gemini has a thinkingBudget parameter that can be set to a number. 0 means no thinking. Looks like the default behavior is "dynamic thinking" – Gemini determines how much thinking to do. My main use case would primarily be around switching between no thinking and dynamic thinking.
Generally speaking though, I see you have extra_params in CreateChatCompletionSettings which I think is nice. Any way to make that a general-purpose extension where certain "extra" parameters can be mapped to... I don't know, maybe a json object that can be deep-merged with the request body built by the library? Perhaps a similar mapping for adding extra query parameters? Something like this would allow including extra stuff/behavior in the API request that the client Scala code doesn't explicitly support (yet). These model vendors don't seem to try following a common pattern anyway so catching up and maintaining shared abstractions can be challenging
Hey @yahor-filipchyk , thanks for the suggestion! I will check the gemini documentation first to determine if some of the thinking/reasoning stuff can be generalized at a higher level.
Gemini API docs have this page where they show how, when Gemini is used via an OpenAI library (not sure which), the reasoning effort maps to the thinking budget. I thought this might be helpful