@devries-cameron20 / composio-1 / commits / 1c15be332
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Chore: Update readme with openai agents example (#2069)

Musthaq Ahamad committed Oct 17, 2025 at 13:09 UTC 1c15be332dd59322d48f2f1a4b93cbddb835583b
1 file changed +105 -37
README.md
+105 -37
@@ -43,42 +43,36 @@ const composio = new Composio({
43 });
44 ```
45
46 -#### Simple Agent with OpenAI
46 +#### Simple Agent with OpenAI Agents
47
48 ```bash
49 -npm install @composio/openai
49 +npm install @composio/openai-agents @openai/agents
50 ```
51
52 ```typescript
53 import { Composio } from '@composio/core';
54 -import { OpenAIResponsesProvider, OpenAIProvider } from '@composio/openai';
55 -import { OpenAI } from 'openai';
54 +import { OpenAIAgentsProvider } from '@composio/openai-agents';
55 +import { Agent, run } from '@openai/agents';
56
57 -const openai = new OpenAI();
58 -
59 -const composioForCompletions = new Composio({ provider: new OpenAIProvider() });
57 +const composio = new Composio({
58 + provider: new OpenAIAgentsProvider(),
59 +});
60
61 -const userId = 'user@acme.org'
61 +const userId = 'user@acme.org';
62
63 -const toolsForCompletions = await composioForCompletions.tools.get(userId, {
63 +const tools = await composio.tools.get(userId, {
64 toolkits: ['HACKERNEWS'],
65 });
66
67 -const completion = await openai.chat.completions.create({
68 - model: 'gpt-5',
69 - messages: [
70 - {
71 - role: 'user',
72 - content: 'What is the latest hackernews post about?',
73 - },
74 - ],
75 - tools: toolsForCompletions,
67 +const agent = new Agent({
68 + name: 'Hackernews assistant',
69 + tools: tools,
70 });
71
78 -const newResult = await composioForCompletions.provider.handleToolCalls(userId, completion);
72 +const result = await run(agent, 'What is the latest hackernews post about?');
73
80 -console.log(JSON.stringify(newResult, null, 2));
81 -// will return the raw response from the HACKERNEWS API.
74 +console.log(JSON.stringify(result.finalOutput, null, 2));
75 +// will return the response from the agent with data from HACKERNEWS API.
76 ```
77
78 ### Python SDK Installation
@@ -101,36 +95,41 @@ composio = Composio(
95 )
96 ```
97
104 -#### Simple Agent with OpenAI
98 +#### Simple Agent with OpenAI Agents
99
100 ```bash
107 -pip install composio_openai>=0.8.0
101 +pip install composio_openai_agents openai-agents
102 ```
103
104 ```python
111 -from openai import OpenAI
105 +import asyncio
106 +from agents import Agent, Runner
107 from composio import Composio
113 -from composio_openai import OpenAIProvider
108 +from composio_openai_agents import OpenAIAgentsProvider
109
115 -# Initialize Composio client with OpenAI Provider
116 -composio = Composio(provider=OpenAIProvider())
117 -openai = OpenAI()
110 +# Initialize Composio client with OpenAI Agents Provider
111 +composio = Composio(provider=OpenAIAgentsProvider())
112
113 user_id = "user@acme.org"
114 tools = composio.tools.get(user_id=user_id, toolkits=["HACKERNEWS"])
115
122 -response = openai.chat.completions.create(
123 - model="gpt-5",
116 +# Create an agent with the tools
117 +agent = Agent(
118 + name="Hackernews Agent",
119 + instructions="You are a helpful assistant.",
120 tools=tools,
125 - messages=[
126 - {"role": "user", "content": "What's the latest Hackernews post about?"},
127 - ],
121 )
122
130 -# Execute the function calls.
131 -result = composio.provider.handle_tool_calls(response=response, user_id=user_id)
132 -print(result)
133 -# will return the raw response from the HACKERNEWS API.
123 +# Run the agent
124 +async def main():
125 + result = await Runner.run(
126 + starting_agent=agent,
127 + input="What's the latest Hackernews post about?",
128 + )
129 + print(result.final_output)
130 +
131 +asyncio.run(main())
132 +# will return the response from the agent with data from HACKERNEWS API.
133 ```
134
135 For more detailed usage instructions and examples, please refer to each SDK's specific documentation.
@@ -162,6 +161,75 @@ The Python SDK offers a Pythonic interface to Composio's services, making it eas
161
162 For detailed information about the Python SDK, please refer to the [Python SDK Documentation](/python/README.md).
163
164 +## Provider Support
165 +
166 +The following table shows which AI frameworks and platforms are supported in each SDK:
167 +
168 +| Provider | TypeScript | Python |
169 +|----------|:----------:|:------:|
170 +| OpenAI | ✅ | ✅ |
171 +| OpenAI Agents | ✅ | ✅ |
172 +| Anthropic | ✅ | ✅ |
173 +| LangChain | ✅ | ✅ |
174 +| LangGraph | ✅* | ✅ |
175 +| LlamaIndex | ✅ | ✅ |
176 +| Vercel AI SDK | ✅ | ❌ |
177 +| Google Gemini | ✅ | ✅ |
178 +| Google ADK | ❌ | ✅ |
179 +| Mastra | ✅ | ❌ |
180 +| Cloudflare Workers AI | ✅ | ❌ |
181 +| CrewAI | ❌ | ✅ |
182 +| AutoGen | ❌ | ✅ |
183 +
184 +\* *LangGraph in TypeScript is supported via the `@composio/langchain` package.*
185 +
186 +> **Don't see your provider?** Learn how to [build a custom provider](https://docs.composio.dev/sdk/typescript/custom-providers) to integrate with any AI framework.
187 +
188 +## Packages
189 +
190 +### Core Packages
191 +
192 +| Package | Version |
193 +|---------|---------|
194 +| **TypeScript** | |
195 +| [@composio/core](https://www.npmjs.com/package/@composio/core) | ![npm version](https://img.shields.io/npm/v/@composio/core) |
196 +| **Python** | |
197 +| [composio](https://pypi.org/project/composio/) | ![PyPI version](https://img.shields.io/pypi/v/composio) |
198 +
199 +### Provider Packages
200 +
201 +| Package | Version |
202 +|---------|---------|
203 +| **TypeScript** | |
204 +| [@composio/openai](https://www.npmjs.com/package/@composio/openai) | ![npm version](https://img.shields.io/npm/v/@composio/openai) |
205 +| [@composio/openai-agents](https://www.npmjs.com/package/@composio/openai-agents) | ![npm version](https://img.shields.io/npm/v/@composio/openai-agents) |
206 +| [@composio/anthropic](https://www.npmjs.com/package/@composio/anthropic) | ![npm version](https://img.shields.io/npm/v/@composio/anthropic) |
207 +| [@composio/langchain](https://www.npmjs.com/package/@composio/langchain) | ![npm version](https://img.shields.io/npm/v/@composio/langchain) |
208 +| [@composio/llamaindex](https://www.npmjs.com/package/@composio/llamaindex) | ![npm version](https://img.shields.io/npm/v/@composio/llamaindex) |
209 +| [@composio/vercel](https://www.npmjs.com/package/@composio/vercel) | ![npm version](https://img.shields.io/npm/v/@composio/vercel) |
210 +| [@composio/google](https://www.npmjs.com/package/@composio/google) | ![npm version](https://img.shields.io/npm/v/@composio/google) |
211 +| [@composio/mastra](https://www.npmjs.com/package/@composio/mastra) | ![npm version](https://img.shields.io/npm/v/@composio/mastra) |
212 +| [@composio/cloudflare](https://www.npmjs.com/package/@composio/cloudflare) | ![npm version](https://img.shields.io/npm/v/@composio/cloudflare) |
213 +| **Python** | |
214 +| [composio-openai](https://pypi.org/project/composio-openai/) | ![PyPI version](https://img.shields.io/pypi/v/composio-openai) |
215 +| [composio-openai-agents](https://pypi.org/project/composio-openai-agents/) | ![PyPI version](https://img.shields.io/pypi/v/composio-openai-agents) |
216 +| [composio-anthropic](https://pypi.org/project/composio-anthropic/) | ![PyPI version](https://img.shields.io/pypi/v/composio-anthropic) |
217 +| [composio-langchain](https://pypi.org/project/composio-langchain/) | ![PyPI version](https://img.shields.io/pypi/v/composio-langchain) |
218 +| [composio-langgraph](https://pypi.org/project/composio-langgraph/) | ![PyPI version](https://img.shields.io/pypi/v/composio-langgraph) |
219 +| [composio-llamaindex](https://pypi.org/project/composio-llamaindex/) | ![PyPI version](https://img.shields.io/pypi/v/composio-llamaindex) |
220 +| [composio-crewai](https://pypi.org/project/composio-crewai/) | ![PyPI version](https://img.shields.io/pypi/v/composio-crewai) |
221 +| [composio-autogen](https://pypi.org/project/composio-autogen/) | ![PyPI version](https://img.shields.io/pypi/v/composio-autogen) |
222 +| [composio-gemini](https://pypi.org/project/composio-gemini/) | ![PyPI version](https://img.shields.io/pypi/v/composio-gemini) |
223 +| [composio-google](https://pypi.org/project/composio-google/) | ![PyPI version](https://img.shields.io/pypi/v/composio-google) |
224 +| [composio-google-adk](https://pypi.org/project/composio-google-adk/) | ![PyPI version](https://img.shields.io/pypi/v/composio-google-adk) |
225 +
226 +### Utility Packages
227 +
228 +| Package | Version |
229 +|---------|---------|
230 +| [@composio/json-schema-to-zod](https://www.npmjs.com/package/@composio/json-schema-to-zod) | ![npm version](https://img.shields.io/npm/v/@composio/json-schema-to-zod) |
231 +| [@composio/ts-builders](https://www.npmjs.com/package/@composio/ts-builders) | ![npm version](https://img.shields.io/npm/v/@composio/ts-builders) |
232 +
233 _if you are looking for the older sdk, you can find them [here](https://github.com/ComposioHQ/composio/tree/master)_
234
235 ## Rube