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.18.2.tar.gz (3.7 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.18.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: composio_google-0.18.2.tar.gz
  • Upload date:
  • Size: 3.7 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.18.2.tar.gz
Algorithm Hash digest
SHA256 ee862ffa521e13fba75e34f751a41292617982b93fc4c33c814461f18b67ad52
MD5 5c8366e49c408d0392b2b92449d5de72
BLAKE2b-256 617cbd0792f24482d5dc106de90734c88cfc8793d6f24b6c9cbcf803c844ffba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for composio_google-0.18.2-py3-none-any.whl
Algorithm Hash digest
SHA256 689505e187166af85bd08db0b67a2d715570f30f9c41c9ebb7f25d735b223c95
MD5 c8c38847251bf61c8475ad0d0e9cde20
BLAKE2b-256 533cad3a7f81fa8f95d9e82da376cda6dfb22ba30279a3ead12558528a260e27

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