@devries-cameron20 / composio-1 / commits / c0970e2f3
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.

docs: update OpenAI Agents SDK provider page to Steps pattern

Simplified layout: removed ToolTypeFlow/MCP section, standardized to Install, Configure API Keys, Create session and run steps. Removed dotenv imports, updated user ID and email task for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 16:49 UTC c0970e2f39a5fa76367f5ac89e5d477d04db3e9e
1 file changed +19 -177
docs/content/docs/providers/openai-agents.mdx
+19 -177
@@ -1,17 +1,16 @@
1 ---
2 -title: OpenAI Agents
2 +title: OpenAI Agents SDK
3 description: Build an agent with OpenAI Agents SDK and enable it to use 800+ tools with Composio.
4 -keywords: [agents sdk]
4 +keywords: [openai agents sdk, agents sdk]
5 ---
6
7 -<ToolTypeFlow>
7 +The OpenAI Agents SDK provider transforms Composio tools into the [Agents SDK tool format](https://openai.github.io/openai-agents-python/) with built-in execution.
8
9 -<ToolTypeOption id="native" name="Native Tools" icon="native">
9 <Steps>
10 <Step>
11 **Install**
12
14 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
13 +<Tabs groupId="language" items={["Python", "TypeScript"]} persist>
14 <Tab value="Python">
15 ```bash
16 pip install composio composio-openai-agents openai-agents
@@ -19,7 +18,7 @@ pip install composio composio-openai-agents openai-agents
18 </Tab>
19 <Tab value="TypeScript">
20 ```bash
22 -npm install dotenv @composio/core @composio/openai-agents @openai/agents
21 +npm install @composio/core @composio/openai-agents @openai/agents
22 ```
23 </Tab>
24 </Tabs>
@@ -39,43 +38,32 @@ OPENAI_API_KEY=xxxxxxxxx
38 </Step>
39
40 <Step>
42 -**Create session and run agent**
41 +**Create session and run**
42
44 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
43 +<Tabs groupId="language" items={["Python", "TypeScript"]} persist>
44 <Tab value="Python">
45 ```python
46 import asyncio
48 -from dotenv import load_dotenv
49 -load_dotenv()
50 -
47 from composio import Composio
52 -from agents import Agent, Runner
48 from composio_openai_agents import OpenAIAgentsProvider
49 +from agents import Agent, Runner
50
55 -# Initialize Composio with OpenAI Agents provider
51 composio = Composio(provider=OpenAIAgentsProvider())
52
58 -external_user_id = "user_2nFh83Hde"
59 -recipient_email = "soham.g@composio.dev"
60 -
61 -# Create a session
62 -session = composio.create(user_id=external_user_id)
63 -
64 -# Get tools from the session
53 +# Create a session for your user
54 +session = composio.create(user_id="user_123")
55 tools = session.tools()
56
67 -# Create agent with tools
57 agent = Agent(
69 - name="Email Manager",
58 + name="Email Agent",
59 instructions="You are a helpful assistant.",
60 tools=tools,
61 )
62
74 -# Run the agent
63 async def main():
64 result = await Runner.run(
65 starting_agent=agent,
78 - input=f"Send an email to {recipient_email} with the subject 'Hello from Composio' and the body 'Hello from the other side!'",
66 + input="Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'",
67 )
68 print(result.final_output)
69
@@ -84,178 +72,32 @@ asyncio.run(main())
72 </Tab>
73 <Tab value="TypeScript">
74 ```typescript
87 -import "dotenv/config";
75 import { Composio } from "@composio/core";
89 -import { Agent, run } from "@openai/agents";
76 import { OpenAIAgentsProvider } from "@composio/openai-agents";
77 +import { Agent, run } from "@openai/agents";
78
92 -// Initialize Composio with OpenAI Agents provider
79 const composio = new Composio({
80 provider: new OpenAIAgentsProvider(),
81 });
82
97 -const externalUserId = "user_2nFh83Hde";
98 -const recipientEmail = "soham.g@composio.dev";
99 -
100 -// Create a session
101 -const session = await composio.create(externalUserId);
102 -
103 -// Get tools from the session
83 +// Create a session for your user
84 +const session = await composio.create("user_123");
85 const tools = await session.tools();
86
106 -// Create agent with tools
107 -const agent = new Agent({
108 - name: "Email Manager",
109 - instructions: "You are a helpful assistant.",
110 - tools: tools,
111 -});
112 -
113 -// Run the agent
114 -console.log("Running agent...");
115 -const result = await run(
116 - agent,
117 - `Send an email to ${recipientEmail} with the subject 'Hello from Composio' and the body 'This is a test email!'`
118 -);
119 -
120 -console.log("Received response from agent");
121 -if (result.finalOutput) {
122 - console.log(result.finalOutput);
123 -}
124 -```
125 -</Tab>
126 -</Tabs>
127 -</Step>
128 -</Steps>
129 -</ToolTypeOption>
130 -
131 -<ToolTypeOption id="mcp" name="MCP" icon="mcp">
132 -<Steps>
133 -<Step>
134 -**Install**
135 -
136 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
137 -<Tab value="Python">
138 -```bash
139 -pip install composio openai-agents
140 -```
141 -</Tab>
142 -<Tab value="TypeScript">
143 -```bash
144 -npm install dotenv @composio/core @openai/agents
145 -```
146 -</Tab>
147 -</Tabs>
148 -</Step>
149 -
150 -<Step>
151 -**Configure API Keys**
152 -
153 -<Callout type="info">
154 -Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/api-keys).
155 -</Callout>
156 -
157 -```txt title=".env"
158 -COMPOSIO_API_KEY=xxxxxxxxx
159 -OPENAI_API_KEY=xxxxxxxxx
160 -```
161 -</Step>
162 -
163 -<Step>
164 -**Create session and run agent**
165 -
166 -<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
167 -<Tab value="Python">
168 -```python
169 -import asyncio
170 -from dotenv import load_dotenv
171 -load_dotenv()
172 -
173 -from composio import Composio
174 -from agents import Agent, Runner, HostedMCPTool
175 -
176 -# Initialize Composio
177 -composio = Composio()
178 -
179 -external_user_id = "user_2nFh83Hde"
180 -recipient_email = "soham.g@composio.dev"
181 -
182 -# Create a session
183 -session = composio.create(user_id=external_user_id)
184 -
185 -# Create MCP tool
186 -composio_mcp = HostedMCPTool(
187 - tool_config={
188 - "type": "mcp",
189 - "server_label": "composio",
190 - "server_url": session.mcp.url,
191 - "require_approval": "never",
192 - "headers": session.mcp.headers,
193 - }
194 -)
195 -
196 -# Create agent with MCP tool
197 -agent = Agent(
198 - name="Email Manager",
199 - instructions="You are a helpful assistant.",
200 - tools=[composio_mcp],
201 -)
202 -
203 -# Run the agent
204 -async def main():
205 - result = await Runner.run(
206 - starting_agent=agent,
207 - input=f"Send an email to {recipient_email} with the subject 'Hello from Composio' and the body 'This is a test email!'",
208 - )
209 - print(result.final_output)
210 -
211 -asyncio.run(main())
212 -```
213 -</Tab>
214 -<Tab value="TypeScript">
215 -```typescript
216 -import "dotenv/config";
217 -import { Composio } from "@composio/core";
218 -import { Agent, run, hostedMcpTool } from "@openai/agents";
219 -
220 -// Initialize Composio
221 -const composio = new Composio();
222 -
223 -const externalUserId = "user_2nFh83Hde";
224 -const recipientEmail = "soham.g@composio.dev";
225 -
226 -// Create a session
227 -const session = await composio.create(externalUserId);
228 -
229 -// Create agent with MCP tool
87 const agent = new Agent({
231 - name: "Email Manager",
88 + name: "Email Agent",
89 instructions: "You are a helpful assistant.",
233 - tools: [
234 - hostedMcpTool({
235 - serverLabel: "composio",
236 - serverUrl: session.mcp.url,
237 - headers: session.mcp.headers,
238 - }),
239 - ],
90 + tools,
91 });
92
242 -// Run the agent
243 -console.log("Running agent...");
93 const result = await run(
94 agent,
246 - `Send an email to ${recipientEmail} with the subject 'Hello from Composio' and the body 'This is a test email!'`
95 + "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'"
96 );
97
249 -console.log("Received response from agent");
250 -if (result.finalOutput) {
251 - console.log(result.finalOutput);
252 -}
98 +console.log(result.finalOutput);
99 ```
100 </Tab>
101 </Tabs>
102 </Step>
103 </Steps>
258 -</ToolTypeOption>
259 -
260 -</ToolTypeFlow>
261 -