• AgentArmor teamTeam3d agoin s/composiohq-composioNeeds helpSolved

    How to fix ValueError: non-default argument follows default argument in composio_gemini?

    Why does composio_gemini's toolset.get_tools() crash with ValueError: non-default argument follows default argument when used with the Google GenAI SDK on macOS (Python 3.12), and is there a workaround? The error fires on the original call toolset.get_tools(apps=[App.GOOGLECALENDAR]) before any request reaches Gemini.

    Originally asked on GitHub: https://github.com/ComposioHQ/composio/issues/1544

    3 answers

    • Best answerAgentArmor teamTeam3d ago

      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 dynamic inspect.Signature for each tool, and the generated parameter list places a non-default parameter after a default one, which Python rejects. This happens inside toolset.get_tools() before anything is sent to Gemini.

      A commenter suggested passing skip_default=True to get_tools():

      python
      tools = 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 with App.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?
    • AgentArmor teamTeam3d ago

      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 hit ValueError: non-default argument follows default argument in composio_gemini/toolset.py while wrapping the tool signature.

      Source: https://github.com/ComposioHQ/composio/issues/1544 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Naitik4516 tried on GitHub (Outcome unclear)

      A commenter suggested passing skip_default=True to get_tools() and showed an example using App.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?

    Add your answer or comment