Skip to content

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 Ahamad1c15be332dd5
diff --git a/README.md b/README.md
index ff63c508b..b2e7ecd79 100644
--- a/README.md
+++ b/README.md
@@ -43,42 +43,36 @@ const composio = new Composio({
});
```
-#### Simple Agent with OpenAI
+#### Simple Agent with OpenAI Agents
```bash
-npm install @composio/openai
+npm install @composio/openai-agents @openai/agents
```
```typescript
import { Composio } from '@composio/core';
-import { OpenAIResponsesProvider, OpenAIProvider } from '@composio/openai';
-import { OpenAI } from 'openai';
+import { OpenAIAgentsProvider } from '@composio/openai-agents';
+import { Agent, run } from '@openai/agents';
-const openai = new OpenAI();
-
-const composioForCompletions = new Composio({ provider: new OpenAIProvider() });
+const composio = new Composio({
+ provider: new OpenAIAgentsProvider(),
+});
-const userId = '[email protected]'
+const userId = '[email protected]';
-const toolsForCompletions = await composioForCompletions.tools.get(userId, {
+const tools = await composio.tools.get(userId, {
toolkits: ['HACKERNEWS'],
});
-const completion = await openai.chat.completions.create({
- model: 'gpt-5',
- messages: [
- {
- role: 'user',
- content: 'What is the latest hackernews post about?',
- },
- ],
- tools: toolsForCompletions,
+const agent = new Agent({
+ name: 'Hackernews assistant',
+ tools: tools,
});
-const newResult = await composioForCompletions.provider.handleToolCalls(userId, completion);
+const result = await run(agent, 'What is the latest hackernews post about?');
-console.log(JSON.stringify(newResult, null, 2));
-// will return the raw response from the HACKERNEWS API.
+console.log(JSON.stringify(result.finalOutput, null, 2));
+// will return the response from the agent with data from HACKERNEWS API.
```
### Python SDK Installation
@@ -101,36 +95,41 @@ composio = Composio(
)
```
-#### Simple Agent with OpenAI
+#### Simple Agent with OpenAI Agents
```bash
-pip install composio_openai>=0.8.0
+pip install composio_openai_agents openai-agents
```
```python
-from openai import OpenAI
+import asyncio
+from agents import Agent, Runner
from composio import Composio
-from composio_openai import OpenAIProvider
+from composio_openai_agents import OpenAIAgentsProvider
-# Initialize Composio client with OpenAI Provider
-composio = Composio(provider=OpenAIProvider())
-openai = OpenAI()
+# Initialize Composio client with OpenAI Agents Provider
+composio = Composio(provider=OpenAIAgentsProvider())
user_id = "[email protected]"
tools = composio.tools.get(user_id=user_id, toolkits=["HACKERNEWS"])
-response = openai.chat.completions.create(
- model="gpt-5",
+# Create an agent with the tools
+agent = Agent(
+ name="Hackernews Agent",
+ instructions="You are a helpful assistant.",
tools=tools,
- messages=[
- {"role": "user", "content": "What's the latest Hackernews post about?"},
- ],
)
-# Execute the function calls.
-result = composio.provider.handle_tool_calls(response=response, user_id=user_id)
-print(result)
-# will return the raw response from the HACKERNEWS API.
+# Run the agent
+async def main():
+ result = await Runner.run(
+ starting_agent=agent,
+ input="What's the latest Hackernews post about?",
+ )
+ print(result.final_output)
+
+asyncio.run(main())
+# will return the response from the agent with data from HACKERNEWS API.
```
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
For detailed information about the Python SDK, please refer to the [Python SDK Documentation](/python/README.md).
+## Provider Support
+
+The following table shows which AI frameworks and platforms are supported in each SDK:
+
+| Provider | TypeScript | Python |
+|----------|:----------:|:------:|
+| OpenAI | ✅ | ✅ |
+| OpenAI Agents | ✅ | ✅ |
+| Anthropic | ✅ | ✅ |
+| LangChain | ✅ | ✅ |
+| LangGraph | ✅* | ✅ |
+| LlamaIndex | ✅ | ✅ |
+| Vercel AI SDK | ✅ | ❌ |
+| Google Gemini | ✅ | ✅ |
+| Google ADK | ❌ | ✅ |
+| Mastra | ✅ | ❌ |
+| Cloudflare Workers AI | ✅ | ❌ |
+| CrewAI | ❌ | ✅ |
+| AutoGen | ❌ | ✅ |
+
+\* *LangGraph in TypeScript is supported via the `@composio/langchain` package.*
+
+> **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.
+
+## Packages
+
+### Core Packages
+
+| Package | Version |
+|---------|---------|
+| **TypeScript** | |
+| [@composio/core](https://www.npmjs.com/package/@composio/core) | ![npm version](https://img.shields.io/npm/v/@composio/core) |
+| **Python** | |
+| [composio](https://pypi.org/project/composio/) | ![PyPI version](https://img.shields.io/pypi/v/composio) |
+
+### Provider Packages
+
+| Package | Version |
+|---------|---------|
+| **TypeScript** | |
+| [@composio/openai](https://www.npmjs.com/package/@composio/openai) | ![npm version](https://img.shields.io/npm/v/@composio/openai) |
+| [@composio/openai-agents](https://www.npmjs.com/package/@composio/openai-agents) | ![npm version](https://img.shields.io/npm/v/@composio/openai-agents) |
+| [@composio/anthropic](https://www.npmjs.com/package/@composio/anthropic) | ![npm version](https://img.shields.io/npm/v/@composio/anthropic) |
+| [@composio/langchain](https://www.npmjs.com/package/@composio/langchain) | ![npm version](https://img.shields.io/npm/v/@composio/langchain) |
+| [@composio/llamaindex](https://www.npmjs.com/package/@composio/llamaindex) | ![npm version](https://img.shields.io/npm/v/@composio/llamaindex) |
+| [@composio/vercel](https://www.npmjs.com/package/@composio/vercel) | ![npm version](https://img.shields.io/npm/v/@composio/vercel) |
+| [@composio/google](https://www.npmjs.com/package/@composio/google) | ![npm version](https://img.shields.io/npm/v/@composio/google) |
+| [@composio/mastra](https://www.npmjs.com/package/@composio/mastra) | ![npm version](https://img.shields.io/npm/v/@composio/mastra) |
+| [@composio/cloudflare](https://www.npmjs.com/package/@composio/cloudflare) | ![npm version](https://img.shields.io/npm/v/@composio/cloudflare) |
+| **Python** | |
+| [composio-openai](https://pypi.org/project/composio-openai/) | ![PyPI version](https://img.shields.io/pypi/v/composio-openai) |
+| [composio-openai-agents](https://pypi.org/project/composio-openai-agents/) | ![PyPI version](https://img.shields.io/pypi/v/composio-openai-agents) |
+| [composio-anthropic](https://pypi.org/project/composio-anthropic/) | ![PyPI version](https://img.shields.io/pypi/v/composio-anthropic) |
+| [composio-langchain](https://pypi.org/project/composio-langchain/) | ![PyPI version](https://img.shields.io/pypi/v/composio-langchain) |
+| [composio-langgraph](https://pypi.org/project/composio-langgraph/) | ![PyPI version](https://img.shields.io/pypi/v/composio-langgraph) |
+| [composio-llamaindex](https://pypi.org/project/composio-llamaindex/) | ![PyPI version](https://img.shields.io/pypi/v/composio-llamaindex) |
+| [composio-crewai](https://pypi.org/project/composio-crewai/) | ![PyPI version](https://img.shields.io/pypi/v/composio-crewai) |
+| [composio-autogen](https://pypi.org/project/composio-autogen/) | ![PyPI version](https://img.shields.io/pypi/v/composio-autogen) |
+| [composio-gemini](https://pypi.org/project/composio-gemini/) | ![PyPI version](https://img.shields.io/pypi/v/composio-gemini) |
+| [composio-google](https://pypi.org/project/composio-google/) | ![PyPI version](https://img.shields.io/pypi/v/composio-google) |
+| [composio-google-adk](https://pypi.org/project/composio-google-adk/) | ![PyPI version](https://img.shields.io/pypi/v/composio-google-adk) |
+
+### Utility Packages
+
+| Package | Version |
+|---------|---------|
+| [@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) |
+| [@composio/ts-builders](https://www.npmjs.com/package/@composio/ts-builders) | ![npm version](https://img.shields.io/npm/v/@composio/ts-builders) |
+
_if you are looking for the older sdk, you can find them [here](https://github.com/ComposioHQ/composio/tree/master)_
## Rube