Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
responses example
Sushmithamallesh committed
Oct 7, 2025 at 16:14 UTC
951eb04fbcdbe6de34ff20c51692678de267421d
1 file changed
+28
fern/snippets/providers/python/openai-responses-provider.py
new
+28
@@ -0,0 +1,28 @@
1
+from openai import OpenAI
2
+from composio import Composio
3
+from composio_openai import OpenAIResponsesProvider
4
+
5
+# Initialize Composio client with OpenAI Provider
6
+composio = Composio(provider=OpenAIResponsesProvider())
7
+openai = OpenAI()
8
+
9
+# Make sure to create an auth config and a connected account for the user with gmail toolkit
10
+# Make sure to replace "your-user-id" with the actual user ID
11
+user_id = "your-user-id"
12
+
13
+tools = composio.tools.get(user_id=user_id, tools=["GMAIL_SEND_EMAIL"])
14
+
15
+response = openai.responses.create(
16
+ model="gpt-5",
17
+ tools=tools,
18
+ input=[
19
+ {
20
+ "role": "user",
21
+ "content": "Send an email to soham.g@composio.dev with the subject 'Running OpenAI Provider snippet' and body 'Hello from the code snippet in openai docs'"
22
+ }
23
+ ]
24
+)
25
+
26
+# Execute the function calls
27
+result = composio.provider.handle_tool_calls(response=response, user_id=user_id)
28
+print(result)