Skip to main content

composio-gemini

Adapts Composio tools to the google-genai SDK as Python callables compatible with Gemini's Automatic Function Calling.

Installation

pip install composio composio-gemini google-genai

Set COMPOSIO_API_KEY (create one at https://dashboard.composio.dev/settings) and GOOGLE_API_KEY (from https://aistudio.google.com/apikey) in your environment.

Quickstart

GeminiProvider wraps each Composio tool as a typed Python callable. Pass the callables to GenerateContentConfig(tools=...) and the google-genai SDK derives function declarations from their signatures and executes tool calls automatically inside the chat loop; there is no manual tool-call handling.

from composio import Composio
from composio_gemini import GeminiProvider
from google import genai
from google.genai import types

composio = Composio(provider=GeminiProvider())
client = genai.Client()

# Create a session for your user
session = composio.create(user_id="user_123")
tools = session.tools()

config = types.GenerateContentConfig(tools=tools)
chat = client.chats.create(model="gemini-3-pro-preview", config=config)

response = chat.send_message(
    "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'"
)
print(response.text)

If you disable Automatic Function Calling and handle function calls yourself, composio.provider.handle_response(response) executes the function calls in a Gemini response and returns Part objects ready to send back.

composio-gemini vs composio-google

This package targets the google-genai SDK (from google import genai). composio-google targets the older Vertex AI SDK (vertexai.generative_models). For new projects, Google recommends google-genai, so use this package.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

composio_gemini-0.18.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

composio_gemini-0.18.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file composio_gemini-0.18.2.tar.gz.

File metadata

  • Download URL: composio_gemini-0.18.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for composio_gemini-0.18.2.tar.gz
Algorithm Hash digest
SHA256 897261ea99134b6e53b35356fc90405673c579a136ab8daa8603d7da7f961e41
MD5 274e08a5fa5ad7ab42a019622a66601d
BLAKE2b-256 a1014c7db9420c5823893e7f206f77338fafaa23029fb0a7f70ad554c20d6e9e

See more details on using hashes here.

File details

Details for the file composio_gemini-0.18.2-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_gemini-0.18.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76517ee1eb27d47d800a31ccabb28b2bcf7f9a52788be6fd97b6dcd79246490c
MD5 7cee67cbabc71934a8135e69e691f0b0
BLAKE2b-256 835a1c868caa173c576c147ee646a8396b51e5b0ea4d85fcfd740b7f60aadb0b

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page