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.

docs: add openai-agents quickstart

angrybaybladef68aed54612c
diff --git a/fern/docs/get-started/quickstart.mdx b/fern/docs/get-started/quickstart.mdx
index db74cf3f1..f8e862a84 100644
--- a/fern/docs/get-started/quickstart.mdx
+++ b/fern/docs/get-started/quickstart.mdx
@@ -67,7 +67,7 @@ from openai import OpenAI
openai = OpenAI()
composio = Composio()
-user_id = "[email protected]"
+user_id = "[email protected]"
# Initialize connection request
connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
@@ -188,9 +188,52 @@ You may install the OpenAI Agents provider as well!
pip install composio[openai-agents]
```
-{/* TODO: discuss the feature properly */}
```python maxLines=60
+import asyncio
+from agents import Agent, Runner
+
+from composio import Composio
+from composio_openai_agents import OpenAIAgentsProvider
+
+# Initialize Composio toolset
+user_id = "[email protected]"
+composio = Composio(provider=OpenAIAgentsProvider())
+
+# Initialize connection request
+connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
+print(f"🔗 Visit the URL to authorize:\n👉 {connection_request.redirect_url}")
+
+# wait for the connection to be active
+connection_request.wait_for_connection()
+
+# Get all the tools
+tools = composio.tools.get(
+ user_id=user_id,
+ tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"],
+)
+
+# Create an agent with the tools
+agent = Agent(
+ name="GitHub Agent",
+ instructions="You are a helpful assistant that helps users with GitHub tasks.",
+ tools=tools,
+)
+
+
+# Run the agent
+async def main():
+ result = await Runner.run(
+ starting_agent=agent,
+ input=(
+ "Star the repository composiohq/composio on GitHub. If done "
+ "successfully, respond with 'Action executed successfully'"
+ ),
+ )
+ print(result.final_output)
+
+
+asyncio.run(main())
```
</Tab>
</Tabs>