Skip to main content

composio-google

Adapts Composio tools to the Vertex AI SDK (vertexai.generative_models) as FunctionDeclaration objects for Gemini function calling.

Installation

pip install composio composio-google google-cloud-aiplatform

Set COMPOSIO_API_KEY (create one at https://dashboard.composio.dev/settings) in your environment. Vertex AI authenticates with Google Cloud credentials; run gcloud auth application-default login or set GOOGLE_APPLICATION_CREDENTIALS.

Quickstart

GoogleProvider is non-agentic: the model returns function calls, and composio.provider.handle_response executes every function call in the response and returns the results.

import vertexai
from vertexai.generative_models import GenerativeModel, Tool

from composio import Composio
from composio_google import GoogleProvider

vertexai.init(project="your-gcp-project", location="us-central1")

composio = Composio(provider=GoogleProvider())

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

model = GenerativeModel(
    "gemini-2.0-flash",
    tools=[Tool(function_declarations=tools)],
)
chat = model.start_chat()

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

# Execute the function calls the model requested
results = composio.provider.handle_response(user_id="user_123", response=response)
print(results)

To execute a single call instead of the whole response, use composio.provider.execute_tool_call(user_id="user_123", function_call=part.function_call).

composio-google vs composio-gemini

This package targets the Vertex AI SDK (vertexai.generative_models, installed via google-cloud-aiplatform). composio-gemini targets the newer google-genai SDK with Automatic Function Calling. For new projects, use composio-gemini.

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_google-0.19.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

composio_google-0.19.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file composio_google-0.19.0.tar.gz.

File metadata

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

File hashes

Hashes for composio_google-0.19.0.tar.gz
Algorithm Hash digest
SHA256 a8c93f5c08218efcfdce1e0efcb2528980383496c1105a9d95058c4364a01385
MD5 b0fbd11c311bf0e978608808d6718b16
BLAKE2b-256 381dad4a683d2f1d28f55443c2379ce60e6bb3fc3dbb7233dd442a4945ff64cd

See more details on using hashes here.

File details

Details for the file composio_google-0.19.0-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_google-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 015f16ccf8d80e5311fd3b1b4e8e2ec1db2362df471683c443922fcc86a265f6
MD5 985c861260fa216ecc0a354f3ef26740
BLAKE2b-256 108c4b5e4b83237bb6875f2e8e608ea4ea5ddc7ac1bf7cf7939fa4d52d976130

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 Sentry Error logging StatusPage Status page