From e11f44bfd966493bcf570032ece87ed056f40a0a Mon Sep 17 00:00:00 2001 From: Zen Agent Date: Sat, 25 Apr 2026 06:30:17 +0000 Subject: [PATCH 1/5] docs(python): remove legacy v0 SDK references from package READMEs Rewrites the Python package READMEs that ship to PyPI so new users land on the current SDK pattern instead of the legacy v0 (`composio-core`, `ComposioToolSet`, `Action.X`/`App.X` enums) one. - python/README.md: drop the `pip install composio-core` alternative, add a note marking it as legacy, refresh the provider install list, rewrite the LangChain example to use `LangchainProvider` + `composio.tools.get`, and fix the `OpenAIProvider` import path in the configuration snippet. - python/providers/openai/README.md: rewrite to `OpenAIProvider` + `composio.tools.get` + `composio.provider.handle_tool_calls`. - python/providers/anthropic/README.md: fix wrong package name (`composio-claude` -> `composio-anthropic`, `composio_claude` -> `composio_anthropic`) and rewrite to `AnthropicProvider`. - python/providers/google/README.md: rewrite to `GoogleProvider` + `handle_response`. - python/providers/gemini/README.md: rewrite to `GeminiProvider` with string tool slugs. - python/providers/langgraph/README.md: rewrite to `LanggraphProvider` with string tool slugs and `bind_tools(tools)`. - python/providers/openai_agents/README.md: rewrite to `OpenAIAgentsProvider` with string tool slugs. Co-Authored-By: Claude Opus 4.7 Co-authored-by: palash --- python/README.md | 67 ++++++++++++---------- python/providers/anthropic/README.md | 52 +++++++++-------- python/providers/gemini/README.md | 49 ++++++++-------- python/providers/google/README.md | 45 ++++++++------- python/providers/langgraph/README.md | 71 +++++++++++------------- python/providers/openai/README.md | 54 ++++++++++-------- python/providers/openai_agents/README.md | 26 ++++++--- 7 files changed, 195 insertions(+), 169 deletions(-) diff --git a/python/README.md b/python/README.md index 7c83f70822..9ca7f09659 100644 --- a/python/README.md +++ b/python/README.md @@ -20,31 +20,48 @@ The Composio Python SDK allows you to interact with the Composio Platform. It pr ```bash pip install composio -# or -pip install composio-core ``` +> **Note:** `composio-core` is the legacy SDK and is no longer maintained. Install `composio` for the current SDK. + ### Provider-Specific Installations -For specific AI framework integrations: +For specific AI framework integrations, install the matching provider package alongside `composio`: ```bash # OpenAI integration -pip install composio-openai +pip install composio composio-openai + +# OpenAI Agents SDK integration +pip install composio composio-openai-agents + +# Anthropic (Claude) integration +pip install composio composio-anthropic + +# Claude Agent SDK integration +pip install composio composio-claude-agent-sdk -# LangChain integration -pip install composio-langchain +# LangChain integration +pip install composio composio-langchain + +# LangGraph integration +pip install composio composio-langgraph # CrewAI integration -pip install composio-crewai +pip install composio composio-crewai -# Anthropic integration -pip install composio-anthropic +# LlamaIndex integration +pip install composio composio-llamaindex -# AutoGen integration -pip install composio-autogen +# Google GenAI / Gemini integration +pip install composio composio-google +pip install composio composio-gemini + +# Google ADK integration +pip install composio composio-google-adk -# And many more... +# AutoGen integration +pip install composio composio-autogen ``` ## Getting Started @@ -162,33 +179,25 @@ print(result) #### LangChain Integration ```python -from composio_langchain import ComposioToolSet +from composio import Composio +from composio_langchain import LangchainProvider +from langchain.agents import create_agent from langchain_openai import ChatOpenAI -# Initialize the toolset -toolset = ComposioToolSet() +# Initialize Composio with the LangChain provider +composio = Composio(provider=LangchainProvider()) # Get tools for a specific toolkit -tools = toolset.get_tools(toolkits=["GITHUB"]) +tools = composio.tools.get(user_id="default", toolkits=["GITHUB"]) # Initialize LLM llm = ChatOpenAI(model="gpt-4o") # Create agent with tools -from langchain.agents import create_openai_functions_agent, AgentExecutor -from langchain.prompts import ChatPromptTemplate - -prompt = ChatPromptTemplate.from_messages([ - ("system", "You are a helpful assistant"), - ("user", "{input}"), - ("assistant", "{agent_scratchpad}") -]) - -agent = create_openai_functions_agent(llm, tools, prompt) -agent_executor = AgentExecutor(agent=agent, tools=tools) +agent = create_agent(model=llm, tools=tools, system_prompt="You are a helpful assistant") # Execute task -result = agent_executor.invoke({"input": "Star the composiohq/composio repository"}) +result = agent.invoke({"messages": [{"role": "user", "content": "Star the composiohq/composio repository"}]}) print(result) ``` @@ -198,7 +207,7 @@ The Composio constructor accepts the following configuration options: ```python from composio import Composio -from composio.core.provider import OpenAIProvider +from composio_openai import OpenAIProvider composio = Composio( api_key="your-api-key", # Your Composio API key diff --git a/python/providers/anthropic/README.md b/python/providers/anthropic/README.md index ce0987cb00..4a253d856a 100644 --- a/python/providers/anthropic/README.md +++ b/python/providers/anthropic/README.md @@ -1,71 +1,77 @@ ## πŸš€πŸ”— Leveraging Claude with Composio -Facilitate the integration of Claude with Composio to empower Claude models to directly interact with external applications, broadening their capabilities and application scope. +Facilitate the integration of Anthropic's Claude with Composio to empower Claude models to directly interact with external applications, broadening their capabilities and application scope. ### Objective -- **Automate starring a GitHub repository** using conversational instructions via Claude Function Calls. +- **Automate starring a GitHub repository** using conversational instructions via Claude tool use. ### Installation and Setup Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio LangChain package -pip install composio-claude +# Install Composio core and the Anthropic provider +pip install composio composio-anthropic anthropic # Connect your GitHub account -composio-cli add github +composio add github -# View available applications you can connect with -composio-cli show-apps +# View available toolkits you can connect with +composio toolkits ``` +> Looking for the Claude Agent SDK? See `composio-claude-agent-sdk` instead. + ### Usage Steps #### 1. Import Base Packages -Prepare your environment by initializing necessary imports from Claude and setting up your client. +Prepare your environment by initializing necessary imports from Anthropic and Composio. ```python import anthropic +from composio import Composio +from composio_anthropic import AnthropicProvider + # Initialize Claude client client = anthropic.Anthropic() + +# Initialize Composio with the Anthropic provider +composio = Composio(provider=AnthropicProvider()) ``` ### Step 2: Integrating GitHub Tools with Composio -This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for LangChain operations. -```python -from composio_claude import App, ComposioToolSet +Fetch GitHub tools for the user from Composio. Tools are returned in the Claude tool-use format, ready to pass to `messages.create`. -toolset = ComposioToolSet() -actions = toolset.get_tools(tools=App.GITHUB) +```python +tools = composio.tools.get(user_id="default", toolkits=["GITHUB"]) ``` ### Step 3: Agent Execution -This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository. +Send a request to Claude with the Composio-provided tools. ```python -my_task = "Star a repo composiohq/composio on GitHub" +task = "Star me composiohq/composio repo in github." -# Create a chat completion request to decide on the action -response = client.beta.tools.messages.create( +response = client.messages.create( model="claude-3-opus-20240229", max_tokens=1024, - tools= actions, - messages=[{"role": "user", "content": "Star me composiohq/composio repo in github."}], + tools=tools, + messages=[{"role": "user", "content": task}], ) -pprint(response) + +print(response) ``` ### Step 4: Validate Execution Response -Execute the following code to validate the response, ensuring that the intended task has been successfully completed. +Have Composio handle any tool calls the model produced and return the results. ```python -result = toolset.handle_tool_calls(response) -pprint(result) +result = composio.provider.handle_tool_calls(user_id="default", response=response) +print(result) ``` diff --git a/python/providers/gemini/README.md b/python/providers/gemini/README.md index 55ee8bc5c5..acd6ce1c04 100644 --- a/python/providers/gemini/README.md +++ b/python/providers/gemini/README.md @@ -1,69 +1,64 @@ ## πŸš€πŸ”— Integrating Composio with Google's Gemini SDK -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. +Streamline the integration of Composio with the Google GenAI (Gemini) SDK to enhance the capabilities of Gemini models, allowing them to interact directly with external applications and expanding their operational scope. ### Objective -- **Automate starring a GitHub repository** using conversational instructions via Google AI Python's Function Calling feature. +- **Automate starring a GitHub repository** using conversational instructions via Gemini's function-calling feature. ### Installation and Setup Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio Gemini package -pip install composio-gemini +# Install Composio core and the Gemini provider +pip install composio composio-gemini google-genai # Connect your GitHub account composio add github -# View available applications you can connect with -composio apps +# View available toolkits you can connect with +composio toolkits ``` ### Usage Steps #### 1. Import Base Packages -Prepare your environment by initializing necessary imports from Google AI Python and setting up your client. +Prepare your environment by initializing necessary imports from Google's GenAI SDK and Composio. ```python from google import genai +from google.genai import types + +from composio import Composio +from composio_gemini import GeminiProvider + +# Initialize Composio with the Gemini provider +composio = Composio(provider=GeminiProvider()) -# Create google client +# Create the Google GenAI client client = genai.Client() ``` ### Step 2: Integrating GitHub Tools with Composio -This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for Google AI Python operations. -```python -from google.genai import types - -from composio_gemini import Action, ComposioToolSet - -# Create composio client -toolset = ComposioToolSet() +Fetch a specific GitHub tool from Composio and attach it to a Gemini config. -# Create tools -tools = toolset.get_tools( - actions=[ - Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER, - ] -) - -# Create genai client config +```python config = types.GenerateContentConfig( - tools=tools, # type: ignore + tools=composio.tools.get( + user_id="default", + tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"], + ) ) ``` ### Step 3: Agent Execution -This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository. +Use the chat interface to talk to Gemini. ```python -# 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", diff --git a/python/providers/google/README.md b/python/providers/google/README.md index 17fd750581..1a1823b67a 100644 --- a/python/providers/google/README.md +++ b/python/providers/google/README.md @@ -1,66 +1,71 @@ -## πŸš€πŸ”— Integrating Composio with Google AI Python +## πŸš€πŸ”— Integrating Composio with Google AI Python (Vertex AI) -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. +Streamline the integration of Composio with Google AI Python to enhance the capabilities of Gemini models on Vertex AI, allowing them to interact directly with external applications and expanding their operational scope. ### Objective -- **Automate starring a GitHub repository** using conversational instructions via Google AI Python's Function Calling feature. +- **Automate starring a GitHub repository** using conversational instructions via Gemini's function-calling feature on Vertex AI. ### Installation and Setup Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio LangChain package -pip install composio-google +# Install Composio core and the Google (Vertex AI) provider +pip install composio composio-google google-cloud-aiplatform # Connect your GitHub account -composio-cli add github +composio add github -# View available applications you can connect with -composio-cli show-apps +# View available toolkits you can connect with +composio toolkits ``` +> Using the standalone `google-genai` SDK instead? See the `composio-gemini` provider. + ### Usage Steps #### 1. Import Base Packages -Prepare your environment by initializing necessary imports from Google AI Python and setting up your client. +Prepare your environment by initializing necessary imports from Google AI Python and Composio. ```python from vertexai.generative_models import GenerativeModel -# Initialize Google AI Python client -model = GenerativeModel("gemini-pro") +from composio import Composio +from composio_google import GoogleProvider + +# Initialize Composio with the Google provider +composio = Composio(provider=GoogleProvider()) ``` ### Step 2: Integrating GitHub Tools with Composio -This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for Google AI Python operations. +Fetch GitHub tools for the user from Composio and attach them to a Gemini model. + ```python -from composio_google import App, ComposioToolset +tool = composio.tools.get(user_id="default", toolkits=["GITHUB"]) -toolset = ComposioToolset() -actions = toolset.get_tools(apps=[App.GITHUB]) +model = GenerativeModel("gemini-1.5-pro", tools=[tool]) +chat = model.start_chat() ``` ### Step 3: Agent Execution -This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository. +Send a message to Gemini. ```python -# Define task task = "Star a repo composiohq/composio on GitHub" -# Send a message to the model response = chat.send_message(task) +print(response) ``` ### Step 4: Validate Execution Response -Execute the following code to validate the response, ensuring that the intended task has been successfully completed. +Have Composio handle any tool calls the model produced and return the results. ```python -result = composio_toolset.handle_response(response) +result = composio.provider.handle_response(user_id="default", response=response) print("Function call result:", result) ``` diff --git a/python/providers/langgraph/README.md b/python/providers/langgraph/README.md index 8dd22917ff..ea11a1e539 100644 --- a/python/providers/langgraph/README.md +++ b/python/providers/langgraph/README.md @@ -1,31 +1,31 @@ ## πŸ¦œπŸ•ΈοΈ Using Composio With LangGraph -Integrate Composio with LangGraph Agentic workflows & enable them to interact seamlessly with external apps, enhancing their functionality and reach. +Integrate Composio with LangGraph agentic workflows and enable them to interact seamlessly with external apps, enhancing their functionality and reach. ### Goal -- **Star a repository on GitHub** using natural language commands through a LangGraph Agent. +- **Star a repository on GitHub** using natural-language commands through a LangGraph agent. ### Installation and Setup Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio LangGraph package -pip install composio-langgraph +# Install Composio core and the LangGraph provider +pip install composio composio-langgraph langgraph langchain_openai # Connect your GitHub account -composio-cli add github +composio add github -# View available applications you can connect with -composio-cli show-apps +# View available toolkits you can connect with +composio toolkits ``` ### Usage Steps #### 1. Import Base Packages -Prepare your environment by initializing necessary imports from LangGraph & LangChain for setting up your agent. +Prepare your environment by initializing necessary imports from LangGraph, LangChain, and Composio. ```python from typing import Literal @@ -33,36 +33,40 @@ from typing import Literal from langchain_openai import ChatOpenAI from langgraph.graph import MessagesState, StateGraph from langgraph.prebuilt import ToolNode + +from composio import Composio +from composio_langgraph import LanggraphProvider ``` -#### 2. Fetch GitHub LangGraph Tools via Composio +#### 2. Fetch GitHub Tools via Composio -Access GitHub tools provided by Composio for LangGraph, initialize a `ToolNode` with necessary tools obtaned from `ComposioToolSet`. +Initialize Composio with the `LanggraphProvider` and fetch the GitHub tools you want the agent to use, then wrap them in a `ToolNode`. ```python -from composio_langgraph import Action, ComposioToolSet - -# Initialize the toolset for GitHub -composio_toolset = ComposioToolSet() -tools = composio_toolset.get_actions( - actions=[ - Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER, - Action.GITHUB_USERS_GET_AUTHENTICATED, - ]) +composio = Composio(provider=LanggraphProvider()) + +tools = composio.tools.get( + user_id="default", + tools=[ + "GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER", + "GITHUB_GET_THE_AUTHENTICATED_USER", + ], +) tool_node = ToolNode(tools) ``` -#### 3. Prepare the model +#### 3. Prepare the Model -Initialize the LLM class and bind obtained tools to the model. +Initialize the LLM and bind the Composio-provided tools to it. ```python model = ChatOpenAI(temperature=0, streaming=True) -model_with_tools = model.bind_tools(functions) +model_with_tools = model.bind_tools(tools) ``` + #### 4. Define the Graph Nodes -LangGraph expects you to define different nodes of the agentic workflow as separate functions. Here we define a node for calling the LLM model. +LangGraph expects each agentic step to be a function. Define the LLM-call node here. ```python def call_model(state: MessagesState): @@ -70,9 +74,10 @@ def call_model(state: MessagesState): response = model_with_tools.invoke(messages) return {"messages": [response]} ``` -#### 5. Define the Graph Nodes and Edges -To establish the agent's workflow, we begin by initializing the workflow with `agent` and `tools` node, followed by specifying the connecting edges between nodes, finally compiling the workflow. These edges can be straightforward or conditional, depending on the workflow requirements. +#### 5. Wire Up the Graph + +Add the `agent` and `tools` nodes, connect them with edges, and compile. ```python def should_continue(state: MessagesState) -> Literal["tools", "__end__"]: @@ -84,33 +89,23 @@ def should_continue(state: MessagesState) -> Literal["tools", "__end__"]: workflow = StateGraph(MessagesState) - -# Define the two nodes we will cycle between workflow.add_node("agent", call_model) workflow.add_node("tools", tool_node) workflow.add_edge("__start__", "agent") -workflow.add_conditional_edges( - "agent", - should_continue, -) +workflow.add_conditional_edges("agent", should_continue) workflow.add_edge("tools", "agent") app = workflow.compile() ``` -#### 6. Invoke & Check Response -After the compilation of workflow, we invoke the LLM with a task, and stream the response. +#### 6. Invoke and Stream the Response ```python for chunk in app.stream( { "messages": [ - ( - "human", - # "Star the Github Repository composiohq/composio", - "Get my information.", - ) + ("human", "Star the GitHub repository composiohq/composio"), ] }, stream_mode="values", diff --git a/python/providers/openai/README.md b/python/providers/openai/README.md index 3409c37253..e75143179d 100644 --- a/python/providers/openai/README.md +++ b/python/providers/openai/README.md @@ -11,63 +11,69 @@ Facilitate the integration of OpenAI with Composio to empower OpenAI models to d Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio LangChain package -pip install composio-openai +# Install Composio core and the OpenAI provider +pip install composio composio-openai openai # Connect your GitHub account -composio-cli add github +composio add github -# View available applications you can connect with -composio-cli show-apps +# View available toolkits you can connect with +composio toolkits ``` ### Usage Steps #### 1. Import Base Packages -Prepare your environment by initializing necessary imports from OpenAI and setting up your client. +Prepare your environment by initializing necessary imports from OpenAI and Composio. ```python from openai import OpenAI +from composio import Composio +from composio_openai import OpenAIProvider + # Initialize OpenAI client openai_client = OpenAI() + +# Initialize Composio with the OpenAI provider +composio = Composio(provider=OpenAIProvider()) ``` +> Tip: For OpenAI's Responses API, swap `OpenAIProvider` for `OpenAIResponsesProvider` (also exported from `composio_openai`). + ### Step 2: Integrating GitHub Tools with Composio -This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for LangChain operations. -```python -from composio_openai import App, ComposioToolSet +Fetch GitHub tools for the user from Composio. Tools are returned in OpenAI's function-calling format, ready to pass to `chat.completions.create`. -toolset = ComposioToolSet() -actions = toolset.get_tools(apps=[App.GITHUB]) +```python +tools = composio.tools.get(user_id="default", toolkits=["GITHUB"]) ``` ### Step 3: Agent Execution -This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository. +Send a request to OpenAI with the Composio-provided tools. ```python -my_task = "Star a repo composiohq/composio on GitHub" +task = "Star a repo composiohq/composio on GitHub" -# Create a chat completion request to decide on the action -response = openai_client.chat.completions.create(model="gpt-5", - tools=actions, # Passing actions we fetched earlier. +response = openai_client.chat.completions.create( + model="gpt-4o-mini", + tools=tools, messages=[ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": my_task} - ] - ) + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": task}, + ], +) -pprint(response) +print(response) ``` ### Step 4: Validate Execution Response -Execute the following code to validate the response, ensuring that the intended task has been successfully completed. +Have Composio handle any tool calls the model produced and return the results. ```python -result = toolset.handle_tool_calls(response) -pprint(result) +result = composio.provider.handle_tool_calls(response=response, user_id="default") +print(result) ``` diff --git a/python/providers/openai_agents/README.md b/python/providers/openai_agents/README.md index b772a7ea55..7b7bb6216b 100644 --- a/python/providers/openai_agents/README.md +++ b/python/providers/openai_agents/README.md @@ -5,26 +5,31 @@ This package integrates the OpenAI Agents framework with Composio, allowing you ## Installation ```bash -pip install composio_openai_agents +pip install composio composio-openai-agents openai-agents ``` ## Usage ```python import asyncio + import dotenv from agents import Agent, Runner -from composio_openai_agents import Action, ComposioToolSet +from composio import Composio +from composio_openai_agents import OpenAIAgentsProvider # Load environment variables from .env dotenv.load_dotenv() -# Initialize Composio toolset -composio_toolset = ComposioToolSet() +# Initialize Composio with the OpenAI Agents provider +composio = Composio(provider=OpenAIAgentsProvider()) # Get all the tools -tools = composio_toolset.get_tools(actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]) +tools = composio.tools.get( + user_id="default", + tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"], +) # Create an agent with the tools agent = Agent( @@ -33,11 +38,16 @@ agent = Agent( tools=tools, ) + # Run the agent async def main(): - result = await Runner.run(agent, "Star the repository composiohq/composio on GitHub") + result = await Runner.run( + starting_agent=agent, + input="Star the repository composiohq/composio on GitHub", + ) print(result.final_output) + asyncio.run(main()) ``` @@ -51,10 +61,10 @@ asyncio.run(main()) ## Requirements -- Python 3.9+ +- Python 3.10+ - OpenAI Agents framework - Composio (with valid API key) ## License -Apache 2.0 \ No newline at end of file +Apache 2.0 From 90cd934c722f0f9a6a573168cd0292d6a4bab38d Mon Sep 17 00:00:00 2001 From: Zen Agent Date: Sat, 25 Apr 2026 06:36:59 +0000 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20address=20codex=20review=20=E2=80=94?= =?UTF-8?q?=20use=20real=20CLI=20command=20for=20account=20linking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex flagged that the introduced setup commands `composio add github` and `composio toolkits` are not valid CLI subcommands. The real top-level command for linking a connected account is `composio link `, and toolkit discovery only exists under developer mode (`composio dev toolkits …`). Replace the broken pair with the working `composio link` command and a parenthetical pointing to the dashboard, so users on the default (non-dev) CLI mode can follow the quickstarts end-to-end. Co-Authored-By: Claude Opus 4.7 Co-authored-by: palash --- python/providers/anthropic/README.md | 7 ++----- python/providers/gemini/README.md | 7 ++----- python/providers/google/README.md | 7 ++----- python/providers/langgraph/README.md | 7 ++----- python/providers/openai/README.md | 7 ++----- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/python/providers/anthropic/README.md b/python/providers/anthropic/README.md index 4a253d856a..b8809cc069 100644 --- a/python/providers/anthropic/README.md +++ b/python/providers/anthropic/README.md @@ -14,11 +14,8 @@ Ensure you have the necessary packages installed and connect your GitHub account # Install Composio core and the Anthropic provider pip install composio composio-anthropic anthropic -# Connect your GitHub account -composio add github - -# View available toolkits you can connect with -composio toolkits +# Connect your GitHub account (also available in the dashboard) +composio link github ``` > Looking for the Claude Agent SDK? See `composio-claude-agent-sdk` instead. diff --git a/python/providers/gemini/README.md b/python/providers/gemini/README.md index acd6ce1c04..2fe56d5a1a 100644 --- a/python/providers/gemini/README.md +++ b/python/providers/gemini/README.md @@ -14,11 +14,8 @@ Ensure you have the necessary packages installed and connect your GitHub account # Install Composio core and the Gemini provider pip install composio composio-gemini google-genai -# Connect your GitHub account -composio add github - -# View available toolkits you can connect with -composio toolkits +# Connect your GitHub account (also available in the dashboard) +composio link github ``` ### Usage Steps diff --git a/python/providers/google/README.md b/python/providers/google/README.md index 1a1823b67a..9521d7d1f1 100644 --- a/python/providers/google/README.md +++ b/python/providers/google/README.md @@ -14,11 +14,8 @@ Ensure you have the necessary packages installed and connect your GitHub account # Install Composio core and the Google (Vertex AI) provider pip install composio composio-google google-cloud-aiplatform -# Connect your GitHub account -composio add github - -# View available toolkits you can connect with -composio toolkits +# Connect your GitHub account (also available in the dashboard) +composio link github ``` > Using the standalone `google-genai` SDK instead? See the `composio-gemini` provider. diff --git a/python/providers/langgraph/README.md b/python/providers/langgraph/README.md index ea11a1e539..79b4dff305 100644 --- a/python/providers/langgraph/README.md +++ b/python/providers/langgraph/README.md @@ -14,11 +14,8 @@ Ensure you have the necessary packages installed and connect your GitHub account # Install Composio core and the LangGraph provider pip install composio composio-langgraph langgraph langchain_openai -# Connect your GitHub account -composio add github - -# View available toolkits you can connect with -composio toolkits +# Connect your GitHub account (also available in the dashboard) +composio link github ``` ### Usage Steps diff --git a/python/providers/openai/README.md b/python/providers/openai/README.md index e75143179d..f38f6d03d2 100644 --- a/python/providers/openai/README.md +++ b/python/providers/openai/README.md @@ -14,11 +14,8 @@ Ensure you have the necessary packages installed and connect your GitHub account # Install Composio core and the OpenAI provider pip install composio composio-openai openai -# Connect your GitHub account -composio add github - -# View available toolkits you can connect with -composio toolkits +# Connect your GitHub account (also available in the dashboard) +composio link github ``` ### Usage Steps From 4c4f6c060982807246f07b14d167d92579cd1f2d Mon Sep 17 00:00:00 2001 From: Zen Agent Date: Sat, 25 Apr 2026 06:39:34 +0000 Subject: [PATCH 3/5] fix: address codex review iteration 2 - google README: composio.tools.get() already returns a list of FunctionDeclaration; wrapping it again in `tools=[tool]` produced a nested list. Pass `tools=tools` directly so GenerativeModel receives the function declarations at the right depth. - openai_agents README: revert "Python 3.10+" back to "Python 3.9+" to match `python/providers/openai_agents/pyproject.toml` and `setup.py`, which still declare `>=3.9`. Documented floor was over-restrictive. Co-Authored-By: Claude Opus 4.7 Co-authored-by: palash --- python/providers/google/README.md | 4 ++-- python/providers/openai_agents/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/providers/google/README.md b/python/providers/google/README.md index 9521d7d1f1..b2035689d7 100644 --- a/python/providers/google/README.md +++ b/python/providers/google/README.md @@ -41,9 +41,9 @@ composio = Composio(provider=GoogleProvider()) Fetch GitHub tools for the user from Composio and attach them to a Gemini model. ```python -tool = composio.tools.get(user_id="default", toolkits=["GITHUB"]) +tools = composio.tools.get(user_id="default", toolkits=["GITHUB"]) -model = GenerativeModel("gemini-1.5-pro", tools=[tool]) +model = GenerativeModel("gemini-1.5-pro", tools=tools) chat = model.start_chat() ``` diff --git a/python/providers/openai_agents/README.md b/python/providers/openai_agents/README.md index 7b7bb6216b..2cb70f1839 100644 --- a/python/providers/openai_agents/README.md +++ b/python/providers/openai_agents/README.md @@ -61,7 +61,7 @@ asyncio.run(main()) ## Requirements -- Python 3.10+ +- Python 3.9+ - OpenAI Agents framework - Composio (with valid API key) From bbc5c6b0267630986f3d5003a1ec0fb2d31edd6f Mon Sep 17 00:00:00 2001 From: Zen Agent Date: Sat, 25 Apr 2026 06:43:31 +0000 Subject: [PATCH 4/5] fix: address codex review iteration 3 - All provider READMEs: drop the `composio link github` setup step. The `composio` CLI is shipped via the TypeScript package only, so on a Python-only install it's unavailable and users would hit `composio: command not found`. Point readers at the Composio dashboard for connecting accounts instead. - google README: wrap the FunctionDeclaration list returned by `composio.tools.get()` in `vertexai.generative_models.Tool` before passing to `GenerativeModel(tools=...)`. Vertex AI validates each entry as a `Tool`, so the previous snippet would raise `TypeError: Unexpected tool type` at model construction. Co-Authored-By: Claude Opus 4.7 Co-authored-by: palash --- python/providers/anthropic/README.md | 6 ++---- python/providers/gemini/README.md | 6 ++---- python/providers/google/README.md | 19 +++++++++++-------- python/providers/langgraph/README.md | 6 ++---- python/providers/openai/README.md | 6 ++---- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/python/providers/anthropic/README.md b/python/providers/anthropic/README.md index b8809cc069..52fe37d60c 100644 --- a/python/providers/anthropic/README.md +++ b/python/providers/anthropic/README.md @@ -11,13 +11,11 @@ Facilitate the integration of Anthropic's Claude with Composio to empower Claude Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio core and the Anthropic provider pip install composio composio-anthropic anthropic - -# Connect your GitHub account (also available in the dashboard) -composio link github ``` +Connect your GitHub account from the [Composio dashboard](https://platform.composio.dev/) before running the example. + > Looking for the Claude Agent SDK? See `composio-claude-agent-sdk` instead. ### Usage Steps diff --git a/python/providers/gemini/README.md b/python/providers/gemini/README.md index 2fe56d5a1a..ca6b16085c 100644 --- a/python/providers/gemini/README.md +++ b/python/providers/gemini/README.md @@ -11,13 +11,11 @@ Streamline the integration of Composio with the Google GenAI (Gemini) SDK to enh Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio core and the Gemini provider pip install composio composio-gemini google-genai - -# Connect your GitHub account (also available in the dashboard) -composio link github ``` +Connect your GitHub account from the [Composio dashboard](https://platform.composio.dev/) before running the example. + ### Usage Steps #### 1. Import Base Packages diff --git a/python/providers/google/README.md b/python/providers/google/README.md index b2035689d7..39a72dbd75 100644 --- a/python/providers/google/README.md +++ b/python/providers/google/README.md @@ -11,13 +11,11 @@ Streamline the integration of Composio with Google AI Python to enhance the capa Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio core and the Google (Vertex AI) provider pip install composio composio-google google-cloud-aiplatform - -# Connect your GitHub account (also available in the dashboard) -composio link github ``` +Connect your GitHub account from the [Composio dashboard](https://platform.composio.dev/) before running the example. + > Using the standalone `google-genai` SDK instead? See the `composio-gemini` provider. ### Usage Steps @@ -27,7 +25,7 @@ composio link github Prepare your environment by initializing necessary imports from Google AI Python and Composio. ```python -from vertexai.generative_models import GenerativeModel +from vertexai.generative_models import GenerativeModel, Tool from composio import Composio from composio_google import GoogleProvider @@ -38,12 +36,17 @@ composio = Composio(provider=GoogleProvider()) ### Step 2: Integrating GitHub Tools with Composio -Fetch GitHub tools for the user from Composio and attach them to a Gemini model. +Fetch GitHub tools for the user from Composio. `GoogleProvider` returns +`vertexai.generative_models.FunctionDeclaration` objects, so wrap them in a +`Tool` before handing them to `GenerativeModel`. ```python -tools = composio.tools.get(user_id="default", toolkits=["GITHUB"]) +declarations = composio.tools.get(user_id="default", toolkits=["GITHUB"]) -model = GenerativeModel("gemini-1.5-pro", tools=tools) +model = GenerativeModel( + "gemini-1.5-pro", + tools=[Tool(function_declarations=declarations)], +) chat = model.start_chat() ``` diff --git a/python/providers/langgraph/README.md b/python/providers/langgraph/README.md index 79b4dff305..c771f2d119 100644 --- a/python/providers/langgraph/README.md +++ b/python/providers/langgraph/README.md @@ -11,13 +11,11 @@ Integrate Composio with LangGraph agentic workflows and enable them to interact Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio core and the LangGraph provider pip install composio composio-langgraph langgraph langchain_openai - -# Connect your GitHub account (also available in the dashboard) -composio link github ``` +Connect your GitHub account from the [Composio dashboard](https://platform.composio.dev/) before running the example. + ### Usage Steps #### 1. Import Base Packages diff --git a/python/providers/openai/README.md b/python/providers/openai/README.md index f38f6d03d2..e23b1c67f9 100644 --- a/python/providers/openai/README.md +++ b/python/providers/openai/README.md @@ -11,13 +11,11 @@ Facilitate the integration of OpenAI with Composio to empower OpenAI models to d Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities. ```bash -# Install Composio core and the OpenAI provider pip install composio composio-openai openai - -# Connect your GitHub account (also available in the dashboard) -composio link github ``` +Connect your GitHub account from the [Composio dashboard](https://platform.composio.dev/) before running the example. + ### Usage Steps #### 1. Import Base Packages From 957db630b96a3e9d724bff26684c18a56d014e54 Mon Sep 17 00:00:00 2001 From: Zen Agent Date: Sat, 25 Apr 2026 06:46:00 +0000 Subject: [PATCH 5/5] fix: address codex review iteration 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - python/README.md Configuration block: drop the `from composio_openai import OpenAIProvider` line so this generic SDK-config example works on a base `pip install composio` install (composio_openai ships in the separate `composio-openai` package). OpenAIProvider is the default so the constructor still works without it; left a comment pointing to the package for users who want to import it explicitly. - python/README.md provider list: split the merged "Google GenAI / Gemini integration" entry into two separate entries because `composio-google` is the Vertex AI provider and `composio-gemini` is the google-genai provider β€” installing the wrong one for the example you copy-paste produces ModuleNotFoundError. Co-Authored-By: Claude Opus 4.7 Co-authored-by: palash --- python/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/README.md b/python/README.md index 9ca7f09659..08586e7d4e 100644 --- a/python/README.md +++ b/python/README.md @@ -53,8 +53,10 @@ pip install composio composio-crewai # LlamaIndex integration pip install composio composio-llamaindex -# Google GenAI / Gemini integration +# Google Vertex AI integration pip install composio composio-google + +# Google GenAI / Gemini integration pip install composio composio-gemini # Google ADK integration @@ -207,7 +209,6 @@ The Composio constructor accepts the following configuration options: ```python from composio import Composio -from composio_openai import OpenAIProvider composio = Composio( api_key="your-api-key", # Your Composio API key @@ -216,7 +217,7 @@ composio = Composio( max_retries=3, # Maximum number of retries allow_tracking=True, # Enable/disable telemetry (default: True) file_download_dir="./downloads", # Directory for file downloads - provider=OpenAIProvider(), # Custom provider (default: OpenAIProvider) + # provider=OpenAIProvider(), # Default; install `composio-openai` to import explicitly toolkit_versions={ "github": "12202025_01" } # Toolkit versions to use ) ```