- Gemini
- ADK
In Python, the Gemini provider (
composio_gemini) wraps Composio tools as typed callables, and the google-genai SDK’s Automatic Function Calling executes tool calls inside the chat loop for you. In TypeScript, the Google provider transforms Composio tools into Gemini function declarations, and you run the loop: execute each call with composio.provider.executeToolCall(session, functionCall), feed the result back, and repeat until the model replies with text.Object arguments that declare no properties preserve arbitrary nested keys in both providers. The TypeScript provider also adds type: "object" to schema nodes that declare properties without a type, which is the shape Gemini expects for object schemas.If you use the Python composio_google provider with a manual Gemini loop, pass the Session to composio.provider.execute_tool_call(session=session, function_call=function_call) or composio.provider.handle_response(session=session, response=response). Both helpers execute through that Session. Calls with user_id use direct execution for tools fetched with tools.get(). The composio_gemini callables in the example below already carry the Session.If you turn off Automatic Function Calling in composio_gemini, pass session=session to composio.provider.handle_response(response, session=session) for tools fetched with session.tools(). For tools fetched with composio.tools.get(user_id="alice", ...), use composio.provider.handle_response(response, user_id="alice"). Each call uses the selected fetch’s schema validation (including schema modifiers) and execution modifiers. Session calls also preserve session routing, so local custom tools in a COMPOSIO_MULTI_EXECUTE_TOOL batch run in process.1
Install
Install
- Python
- TypeScript
2
Configure API Keys
Configure API Keys
Set
COMPOSIO_API_KEY with your API key from Settings and GOOGLE_API_KEY with your Google API key..env
3
Create session and run
Create session and run
- Python
- TypeScript
Pass the session to
executeToolCall when the model received tools from session.tools(). The helper preserves the provider’s argument normalization and executes the call through that session, so session meta-tools such as COMPOSIO_SEARCH_TOOLS keep working. For tools fetched via tools.get, pass the user ID instead. Passing a session requires @composio/core ≥ 0.17.0 with @composio/google ≥ 0.12.0; on earlier versions, execute session tools with session.execute(). The Python Gemini tab needs neither: Automatic Function Calling runs provider-wrapped callables, which carry the session.