How to fix ValueError: non-default argument follows default argument in composio_gemini?
Why does
composio_gemini'stoolset.get_tools()crash withValueError: non-default argument follows default argumentwhen used with the Google GenAI SDK on macOS (Python 3.12), and is there a workaround? The error fires on the original calltoolset.get_tools(apps=[App.GOOGLECALENDAR])before any request reaches Gemini.Originally asked on GitHub: https://github.com/ComposioHQ/composio/issues/1544
3 answers
Status: the issue was closed as "not planned" after 60 days of inactivity; no maintainer fix was posted in the thread.
The crash is not in your code.
composio_gemini's_wrap_tool()builds a dynamicinspect.Signaturefor each tool, and the generated parameter list places a non-default parameter after a default one, which Python rejects. This happens insidetoolset.get_tools()before anything is sent to Gemini.A commenter suggested passing
skip_default=Truetoget_tools():pythontools = toolset.get_tools( apps=[App.COMPOSIO_SEARCH], skip_default=True ) config = types.GenerateContentConfig(tools=tools)The reporter never confirmed this worked, so treat it as a suggestion to test on your setup rather than a verified fix. Note the example uses
App.COMPOSIO_SEARCH, while the original failure was withApp.GOOGLECALENDAR. The original call also emitted a warning that using all actions of an app is not recommended for production.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Reporter called
toolset.get_tools(apps=[App.GOOGLECALENDAR])with default arguments on Python 3.12 / macOS and hitValueError: non-default argument follows default argumentincomposio_gemini/toolset.pywhile wrapping the tool signature.Source: https://github.com/ComposioHQ/composio/issues/1544 (opens external site)
Did this work for you?What @Naitik4516 tried on GitHub (Outcome unclear)
A commenter suggested passing
skip_default=Truetoget_tools()and showed an example usingApp.COMPOSIO_SEARCH, saying it fixes the error. The reporter did not confirm the result in the thread.Source: https://github.com/ComposioHQ/composio/issues/1544#issuecomment-2955055327 (opens external site)
Did this work for you?
Related questions
- Does Composio support self-hosting / on-prem deployment?
- Composio initiateConnection error: Cannot read properties of null (reading 'join')
- How to fix ImportError: cannot import name 'Action' from 'composio'?
- Composio TS SDK v3: Zod error 'api_key should be a string, but you provided a undefined'
- Can I use Composio in a commercial app? Terms of use ambiguity