@devries-cameron20 / composio-1 / commits / f68aed546
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: add openai-agents quickstart

angrybayblade committed Jun 18, 2025 at 14:30 UTC f68aed54612c1b40e401ac4848a63435236bd9ca
1 file changed +45 -2
fern/docs/get-started/quickstart.mdx
+45 -2
@@ -67,7 +67,7 @@ from openai import OpenAI
67
68 openai = OpenAI()
69 composio = Composio()
70 -user_id = "your@email.com"
70 +user_id = "user@email.com"
71
72 # Initialize connection request
73 connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
@@ -188,9 +188,52 @@ You may install the OpenAI Agents provider as well!
188 pip install composio[openai-agents]
189 ```
190
191 -{/* TODO: discuss the feature properly */}
191 ```python maxLines=60
192 +import asyncio
193
194 +from agents import Agent, Runner
195 +
196 +from composio import Composio
197 +from composio_openai_agents import OpenAIAgentsProvider
198 +
199 +# Initialize Composio toolset
200 +user_id = "user@email.com"
201 +composio = Composio(provider=OpenAIAgentsProvider())
202 +
203 +# Initialize connection request
204 +connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
205 +print(f"🔗 Visit the URL to authorize:\n👉 {connection_request.redirect_url}")
206 +
207 +# wait for the connection to be active
208 +connection_request.wait_for_connection()
209 +
210 +# Get all the tools
211 +tools = composio.tools.get(
212 + user_id=user_id,
213 + tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"],
214 +)
215 +
216 +# Create an agent with the tools
217 +agent = Agent(
218 + name="GitHub Agent",
219 + instructions="You are a helpful assistant that helps users with GitHub tasks.",
220 + tools=tools,
221 +)
222 +
223 +
224 +# Run the agent
225 +async def main():
226 + result = await Runner.run(
227 + starting_agent=agent,
228 + input=(
229 + "Star the repository composiohq/composio on GitHub. If done "
230 + "successfully, respond with 'Action executed successfully'"
231 + ),
232 + )
233 + print(result.final_output)
234 +
235 +
236 +asyncio.run(main())
237 ```
238 </Tab>
239 </Tabs>