python/providers/gemini/README.md
Streamline the integration of Composio with Google AI Python to enhance the capabilities of Gemini models, allowing them to interact directly with external applications and expanding their operational scope.
Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities.
# Install Composio Gemini package
pip install composio-gemini
# Connect your GitHub account
composio add github
# View available applications you can connect with
composio apps
Prepare your environment by initializing necessary imports from Google AI Python and setting up your client.
from google import genai
# Create google client
client = genai.Client()
This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for Google AI Python operations.
from google.genai import types
from composio_gemini import Action, ComposioToolSet
# Create composio client
toolset = ComposioToolSet()
# Create tools
tools = toolset.get_tools(
actions=[
Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER,
]
)
# Create genai client config
config = types.GenerateContentConfig(
tools=tools, # type: ignore
)
This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.
# Use the chat interface.
chat = client.chats.create(model="gemini-2.0-flash", config=config)
response = chat.send_message(
"Can you star composiohq/composio repository on github",
)
print(response.text)