Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 23:15 UTC
wip: moving and testing snippets
balyan.sid@gmail.com committed
Jun 19, 2025 at 20:24 UTC
784033c7c72eda20510d84a27e3b5bfe0f737412
41 files changed
+1090
-613
fern/fern.config.json
+1
-1
@@ -1,4 +1,4 @@
1
{
2
"organization": "composio",
3
- "version": "0.63.7"
3
+ "version": "0.64.14"
4
}
\ No newline at end of file
fern/package.json
+7
-1
@@ -23,7 +23,9 @@
23
"build": "echo 'Build orchestrated by Turbo'",
24
"preview": "fern generate --docs --preview --log-level debug",
25
"publish": "fern generate --docs",
26
- "generate": "pnpm tools:generate && pnpm sdkdocs"
26
+ "generate": "pnpm tools:generate && pnpm sdkdocs",
27
+ "snippet:new": "bun run scripts/snippet-new.ts",
28
+ "doc:new": "bun run scripts/doc-new.ts"
29
},
30
"dependencies": {
31
"fern-api": "^0.51.39",
@@ -31,14 +33,17 @@
33
"supergateway": "^2.8.3"
34
},
35
"devDependencies": {
36
+ "@ai-sdk/anthropic": "^1.2.12",
37
"@anthropic-ai/sdk": "^0.52.0",
38
"@composio/core": "workspace:*",
39
+ "@composio/openai": "workspace:*",
40
"@composio/vercel": "workspace:*",
41
"@types/convict": "^6.1.6",
42
"@types/glob": "^8.1.0",
43
"@types/node": "^20.17.57",
44
"@types/react": "^18.3.23",
45
"@types/yaml": "^1.9.7",
46
+ "ai": "^4.3.8",
47
"composio-core": "^0.5.39",
48
"hono": "^4.7.11",
49
"next": "^15.3.3",
@@ -50,6 +55,7 @@
55
"typedoc-plugin-markdown": "^4.6.4",
56
"typedoc-plugin-zod": "^1.4.1",
57
"typescript": "^5.8.3",
58
+ "uuid": "^11.1.0",
59
"vitest": "^3.1.4",
60
"yaml": "^2.8.0"
61
}
fern/pages/src/examples/sample-script.mdx
+1
-1
@@ -18,7 +18,7 @@ pip install composio
18
Here's a complete Python example that demonstrates the Composio SDK:
19
20
<SnippetCode
21
- src="fern/snippets/sample-script/sample-script.py"
21
+ src="fern/snippets/examples/sample-script/sample-script.py"
22
startLine={1}
23
title="Setting up Composio and OpenAI"
24
highlightStart={17}
fern/pages/src/examples/tool-generator/tool-generator.mdx
+1
-1
@@ -34,7 +34,7 @@ For building something like this, we need to use the raw tool definition.
34
Of course, you need to initiate the `Composio` sdk first and use a `COMPOSIO_API_KEY` environment variable.
35
36
37
-<SnippetCode src="fern/generators/tool_doc_generator/main.py" path="tool_doc_generator/main.py" startLine={518} endLine={520} relativeHighlightStart={2} relativeHighlightEnd={2} wordWrap />
37
+<SnippetCode src="fern/generators/tool_doc_generator/main.py" path="tool_doc_generator/main.py" startLine={532} endLine={534} relativeHighlightStart={2} relativeHighlightEnd={2} wordWrap />
38
39
40
Let us see an example output for a raw `GMAIL` toolkit, with all of its tools.
fern/pages/src/get-started/quickstart.mdx
+20
-144
@@ -61,41 +61,11 @@ composio = Composio(
61
<Tabs>
62
<Tab title="OpenAI (Python)">
63
Composio ships with support for OpenAI provider out of the box.
64
-```python maxLines=60
65
-from composio import Composio
66
-from openai import OpenAI
67
-
68
-openai = OpenAI()
69
-composio = Composio()
70
-user_id = "user@email.com"
71
-
72
-# Initialize connection request
73
-connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
74
-print(f"🔗 Visit the URL to authorize:\n👉 {connection_request.redirect_url}")
75
-
76
-# wait for the connection to be active
77
-connection_request.wait_for_connection()
78
-
79
-# Fetch tools
80
-tools = composio.tools.get(user_id=user_id, toolkits=["GMAIL"])
81
-
82
-# Invoke agent
83
-completion = openai.chat.completions.create(
84
- model="gpt-4o",
85
- messages=[
86
- {
87
- "role": "user",
88
- "content": "say 'hi from the composio quickstart' to sid@composio.dev",
89
- # we'll ship you free merch if you do ;)
90
- },
91
- ],
92
- tools=tools,
93
-)
94
-
95
-# Handle Result from tool call
96
-result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
97
-print(result)
98
-```
64
+<SnippetCode
65
+ src="fern/snippets/get-started/python/quickstart.py"
66
+ startLine={1}
67
+ endLine={30}
68
+/>
69
</Tab>
70
<Tab title="Anthropic (Typescript)">
71
You may install the Anthropic provider as well!
@@ -105,38 +75,12 @@ You may install the Anthropic provider as well!
75
npm install @composio/anthropic
76
```
77
108
-```typescript maxLines=60
109
-import { Composio } from "@composio/core";
110
-import { AnthropicProvider } from "@composio/anthropic";
111
-import Anthropic from "@anthropic-ai/sdk";
78
+<SnippetCode
79
+ src="fern/snippets/get-started/typescript/quickstart.ts"
80
+ startLine={1}
81
+ endLine={30}
82
+/>
83
113
-const anthropic = new Anthropic();
114
-const composio = new Composio({
115
- provider: new AnthropicProvider(),
116
-});
117
-
118
-const userId = "user@example.com";
119
-const connection = await composio.toolkits.authorize(userId, "GITHUB");
120
-console.log(
121
- `🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`
122
-);
123
-
124
-await connection.waitForConnection();
125
-const msg = await anthropic.messages.create({
126
- model: "claude-3-7-sonnet-latest",
127
- tools: tools,
128
- messages: [
129
- {
130
- role: "user",
131
- content: "Star the composiohq/composio repository",
132
- },
133
- ],
134
- max_tokens: 1024,
135
-});
136
-
137
-const result = await composio.provider.handleToolCalls(userId, msg);
138
-console.log("✅ Tool results:", result);
139
-```
84
</Tab>
85
<Tab title="Vercel AI SDK (Typescript)">
86
You may install the Vercel AI provider as well!
@@ -146,39 +90,12 @@ You may install the Vercel AI provider as well!
90
npm install @composio/vercel
91
```
92
149
-```typescript maxLines=60
150
-import { Composio } from "@composio/core";
151
-import { generateText } from "ai";
152
-import { anthropic } from "@ai-sdk/anthropic";
153
-import { VercelProvider } from "@composio/vercel";
154
-import { v4 as uuidv4 } from "uuid";
155
-
156
-const userId = uuidv4(); // The user's ID.
157
-const composio = new Composio({
158
- apiKey: process.env.COMPOSIO_API_KEY,
159
- provider: new VercelProvider(),
160
-});
93
+<SnippetCode
94
+ src="fern/snippets/get-started/typescript/vercel-quickstart.ts"
95
+ startLine={1}
96
+ endLine={34}
97
+/>
98
162
-const [connection, tools] = await composio.toolkits.authorize(userId, "gmail");
163
-console.log(
164
- `🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`
165
-);
166
-
167
-await connection.waitForConnection();
168
-const { text } = await generateText({
169
- model: anthropic("claude-3-7-sonnet-20250219"),
170
- messages: [
171
- {
172
- role: "user",
173
- content: "say 'hi from the composio quickstart' to sid@composio.dev", // we'll ship you free merch if you do ;)
174
- },
175
- ],
176
- tools,
177
- maxSteps: 1,
178
-});
179
-
180
-console.log(text);
181
-```
99
</Tab>
100
<Tab title="OpenAI Agents (Python)">
101
You may install the OpenAI Agents provider as well!
@@ -188,53 +105,12 @@ You may install the OpenAI Agents provider as well!
105
pip install composio[openai-agents]
106
```
107
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}")
108
+<SnippetCode
109
+ src="fern/snippets/get-started/python/quickstart-openai-agents.py"
110
+ startLine={1}
111
+ endLine={30}
112
+/>
113
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
-```
114
</Tab>
115
</Tabs>
116
fern/pages/src/providers/anthropic.mdx
+2
-2
@@ -13,11 +13,11 @@ The Anthropic Provider transforms Composio tools into a format compatible with A
13
Anthropic provider can be installed for both the SDKs.
14
15
<CodeGroup>
16
-```typescript TypeScript maxLines=60 wordWrap
16
+```bash title="TypeScript" for="typescript" maxLines=60 wordWrap
17
npm install @composio/anthropic @anthropic-ai/sdk
18
```
19
20
-```python Python maxLines=60 wordWrap
20
+```bash title="Python" for="python" maxLines=60 wordWrap
21
pip install composio[anthropic]
22
```
23
</CodeGroup>
fern/pages/src/providers/langchain.mdx
+1
-1
@@ -16,6 +16,6 @@ pip install composio[langchain] langchain
16
## Usage
17
18
<SnippetCode
19
- src="fern/snippets/python/langchain-provider.py"
19
+ src="fern/snippets/providers/python/langchain-provider.py"
20
title="langchain-provider.py"
21
/>
\ No newline at end of file
fern/pages/src/providers/openai.mdx
+32
-72
@@ -12,92 +12,56 @@ The OpenAI Provider is the default provider for the Composio SDK. It transforms
12
By default the OpenAI Provider is installed when you install the Composio SDK. You can also install it manually:
13
14
<CodeGroup>
15
-```typescript TypeScript
15
+```bash title="TypeScript" for="typescript"
16
npm install @composio/openai
17
```
18
-```python Python
18
+```bash title="Python" for="python"
19
pip install composio[openai]
20
```
21
</CodeGroup>
22
The OpenAI Provider is used by default when you initialize the Composio SDK but you can explicitly specify it.
23
24
<CodeGroup>
25
-```typescript
26
-import { Composio } from "@composio/core";
27
-import { OpenAIProvider } from "@composio/openai";
28
-import { OpenAI } from "openai";
29
-
30
-const composio = new Composio({
31
- apiKey: "your-composio-api-key",
32
- provider: new OpenAIProvider(),
33
-});
25
+<SnippetCode
26
+ src="fern/snippets/providers/typescript/openai.ts"
27
+ startLine={1}
28
+ endLine={7}
29
+/>
30
+<SnippetCode
31
+ src="fern/snippets/providers/python/openai-provider.py"
32
+ startLine={1}
33
+ endLine={8}
34
+/>
35
+</CodeGroup>
36
35
-const openai = new OpenAI();
36
-```
37
+## Responses API
38
+The Responses API is the recommended way to build more agentic flows with the OpenAI API. Read more about it in the [OpenAI documentation](https://platform.openai.com/docs/guides/responses-vs-chat-completions)
39
40
+<CodeGroup>
41
+<SnippetCode
42
+ src="fern/snippets/providers/typescript/openai.ts"
43
+ startLine={5}
44
+ endLine={24}
45
+/>
46
```python
39
-from openai import OpenAI
40
-from composio import Composio
41
-from composio_openai import OpenAIProvider
47
43
-# Initialize tools.
44
-openai_client = OpenAI()
45
-composio = Composio(provider=OpenAIProvider())
48
```
49
</CodeGroup>
50
49
-
50
-## Responses API
51
-
52
-> Handling tool calls from the Responses API
53
-- [ ] Pending on SDK
54
-
55
-### Streaming
56
-> Handling streaming responses from the Responses API
57
-- [ ] Pending on SDK
58
-
51
## Chat Completion API
52
+Chat Completion API is the industry standard for building LLM-powered applications. Chat completions is also adopted and used by many other LLM providers apart from OpenAI.
53
54
<CodeGroup>
62
-```typescript {15}
63
-const userId = "your@example.com";
64
-const tools = await composio.tools.get(userId, "HACKERNEWS");
65
-
66
-const completion = await openai.chat.completions.create({
67
- model: "gpt-4o",
68
- messages: [
69
- {
70
- role: "user",
71
- content: "What is the latest hackernews post about?",
72
- },
73
- ],
74
- tools: tools,
75
-});
76
-
77
-const result = await composio.provider.handleToolCall(userId, completion);
78
-
79
-console.log(result);
80
-```
81
-```python
82
-# Get GitHub tools that are pre-configured
83
-tools = composio.tools.get(user_id="default", toolkits=["GITHUB"])
84
-
85
-# Get response from the LLM
86
-response = openai_client.chat.completions.create(
87
- model="gpt-4o",
88
- tools=tools,
89
- messages=[
90
- {"role": "system", "content": "You are a helpful assistant."},
91
- {"role": "user", "content": task},
92
- ],
93
-)
94
-print(response)
95
-
96
-# Execute the function calls.
97
-# import ipdb; ipdb.set_trace()
98
-result = composio.provider.handle_tool_calls(response=response, user_id="default")
99
-print(result)
100
-```
55
+<SnippetCode
56
+ src="fern/snippets/providers/typescript/openai.ts"
57
+ startLine={26}
58
+ endLine={45}
59
+/>
60
+<SnippetCode
61
+ src="fern/snippets/providers/python/openai-provider.py"
62
+ startLine={10}
63
+ endLine={24}
64
+/>
65
66
</CodeGroup>
67
@@ -140,10 +104,6 @@ if (toolCall) {
104
```
105
</CodeGroup> */}
106
143
-### Streaming
144
-> Handling streaming responses from the Chat Completion API
145
-- [ ] Pending on SDK
146
-
107
## Modifiers
108
Modifiers are functions that can be used to intercept and optionally **modify** the schema, the tool call request and the response from the tool call.
109
fern/pages/src/tool-calling/authenticating-tools.mdx
+24
-71
@@ -64,46 +64,18 @@ The dashboard offers a guided process for all app types.
64
Here's how to authenticate a toolkit for a given user using the OAuth flow.
65
66
<CodeGroup>
67
-```typescript TypeScript maxLines=60 {3, 8-11}
68
-import { Composio } from "@composio/core";
69
-
70
-const composio = new Composio();
71
-const linearAuthConfigId = "ac_1234";
72
-const userId = "your@email.com";
73
-
74
-// Initiate the OAuth connection request
75
-const connRequest = await composio.connectedAccounts.initiate(userId, linearAuthConfigId);
76
-
77
-// Destructure redirectUrl for easier access
78
-const { redirectUrl, id } = connRequest;
79
-console.log(redirectUrl);
80
-
81
-// Wait for the connection to be established
82
-await connRequest.waitForConnection();
83
-
84
-// If you only have the connection request ID, you can also wait using:
85
-await composio.connectedAccounts.waitForConnection(id);
86
-
87
-```
88
-```python Python maxLines=60 wordWrap
89
-from composio import Composio
90
-
91
-linear_auth_config_id = "ac_1234"
92
-user_id = "user@email.com"
93
-composio = Composio()
94
-
95
-# Create a new connected account
96
-connection_request = composio.connected_accounts.initiate(
97
- user_id=user_id,
98
- auth_config_id=linear_auth_config_id,
99
-)
100
-print(connection_request.redirect_url)
101
-
102
-# Wait for the connection to be established
103
-connected_account = connection_request.wait_for_connection()
104
-print(connected_account)
105
-```
106
-
67
+<SnippetCode
68
+ src="fern/snippets/tool-calling/typescript/auth-tools.ts"
69
+ startLine={1}
70
+ endLine={21}
71
+ title="TypeScript"
72
+/>
73
+<SnippetCode
74
+ src="fern/snippets/tool-calling/python/auth-tools.py"
75
+ startLine={1}
76
+ endLine={21}
77
+ title="Python"
78
+/>
79
</CodeGroup>
80
81
## Connecting to an API Key toolkit
@@ -115,37 +87,18 @@ For API key based toolkits, you can either request the user to provide the API k
87
If you know the required authentication fields for your toolkit (like `apiKey` for most API-based services), you can directly create the connection:
88
89
<CodeGroup>
118
-```typescript TypeScript maxLines=60
119
-const authConfigId = "ac_1234"; // For example, auth config id of Serp API
120
-
121
-const connectionRequest = await composio.connectedAccounts.initiate(
122
- userId,
123
- authConfigId,
124
- {
125
- data: {
126
- apiKey: "sk_1234567890", // The field name for the API key/token
127
- },
128
- }
129
-);
130
-
131
-```
132
-```python Python maxLines=60 wordWrap
133
-from composio.types import auth_scheme
134
-
135
-auth_config_id = "ac_1234"
136
-
137
-connection_request = composio.connected_accounts.initiate(
138
- user_id=user_id,
139
- auth_config_id=auth_config_id,
140
- config=auth_scheme.api_key(
141
- options={
142
- "api_key": "sk_1234567890",
143
- },
144
- ),
145
-)
146
-print(connection_request)
147
-```
148
-
90
+<SnippetCode
91
+ src="fern/snippets/tool-calling/typescript/auth-tools.ts"
92
+ startLine={25}
93
+ endLine={34}
94
+ title="TypeScript"
95
+/>
96
+<SnippetCode
97
+ src="fern/snippets/tool-calling/python/auth-tools.py"
98
+ startLine={1}
99
+ endLine={21}
100
+ title="Python"
101
+/>
102
</CodeGroup>
103
104
### Fetching the field name
fern/pages/src/tool-calling/executing-tools.mdx
+26
-131
@@ -15,67 +15,19 @@ This approach works consistently across all supported non-agent providers.
15
To learn how to setup these providers, see [Providers](/providers).
16
17
<CodeGroup>
18
-```typescript TypeScript (Anthropic) maxLines=60
19
-import { Composio } from "@composio/core";
20
-import { AnthropicProvider } from "@composio/anthropic";
21
-
22
-const userId = "user@acme.com"; // User's UUID
23
-
24
-const anthropic = new Anthropic();
25
-const composio = new Composio({
26
- apiKey: process.env.COMPOSIO_API_KEY,
27
- provider: new AnthropicProvider(),
28
-});
29
-
30
-const tools = await composio.tools.get(userId, {
31
- tools: ["GITHUB_GET_THE_ZEN_OF_GITHUB"],
32
-});
33
-
34
-const msg = await anthropic.messages.create({
35
- model: "claude-3-7-sonnet-latest",
36
- tools: tools,
37
- messages: [
38
- {
39
- role: "user",
40
- content: "gimme me some zen!!",
41
- },
42
- ],
43
- max_tokens: 1024,
44
-});
45
-
46
-
47
-const result = await composio.provider.handleToolCalls(userId, msg);
48
-console.log(result);
49
-```
50
-
51
-```python Python (Google) maxLines=60
52
-import anthropic
53
-
54
-from composio import Composio
55
-from composio_anthropic import AnthropicProvider
56
-
57
-
58
-# Initialize tools.
59
-anthropic_client = anthropic.Anthropic()
60
-composio = Composio(provider=AnthropicProvider())
61
-
62
-# Get GitHub tools that are pre-configured
63
-tools = composio.tools.get(user_id="default", tools=["GITHUB_GET_THE_ZEN_OF_GITHUB"])
64
-
65
-# Get response from the LLM
66
-response = anthropic_client.messages.create(
67
- model="claude-3-opus-20240229",
68
- max_tokens=1024,
69
- tools=tools,
70
- messages=[
71
- {"role": "user", "content": "gimme me some zen"},
72
- ],
73
-)
74
-
75
-# Execute the function calls.
76
-result = composio.provider.handle_tool_calls(user_id="default", response=response)
77
-print(result)
78
-```
18
+<SnippetCode
19
+ src="fern/snippets/tool-calling/typescript/exec-tool-completions.ts"
20
+ startLine={1}
21
+ endLine={30}
22
+ title="TypeScript (Anthropic)"
23
+/>
24
+
25
+<SnippetCode
26
+ src="fern/snippets/tool-calling/python/exec-tool-completions.py"
27
+ startLine={1}
28
+ endLine={25}
29
+ title="Python (Google)"
30
+/>
31
</CodeGroup>
32
33
@@ -88,76 +40,19 @@ Here, the tool execution is handled by the agentic framework. Composio makes sur
40
</Tip>
41
42
<CodeGroup>
91
-```typescript TypeScript (Vercel) maxLines=60 wordWrap
92
-import { Composio } from "@composio/core";
93
-import { generateText } from "ai";
94
-import { anthropic } from "@ai-sdk/anthropic";
95
-import { VercelProvider } from "@composio/vercel";
96
-
97
-const userId = "0000";
98
-
99
-const composio = new Composio({
100
- apiKey: process.env.COMPOSIO_API_KEY,
101
- provider: new VercelProvider(),
102
-});
103
-
104
-const tools = await composio.tools.get(userId, {
105
- toolkits: ["LINEAR"],
106
- limit: 15,
107
-});
108
-
109
-const { text } = await generateText({
110
- model: anthropic("claude-3-7-sonnet-20250219"),
111
- messages: [
112
- {
113
- role: "user",
114
- content:
115
- "Fetch all my projects",
116
- },
117
- ],
118
- tools,
119
- maxSteps: 5,
120
-});
121
-
122
-console.log(text);
123
-```
124
-
125
-```python Python (OpenAI Agents SDK)maxLines=60 wordWrap
126
-import asyncio
127
-from agents import Agent, Runner
128
-from composio import Composio
129
-from composio_openai_agents import OpenAIAgentsProvider
130
-
131
-user_id = "0000"
132
-
133
-# Initialize Composio toolset
134
-composio = Composio(provider=OpenAIAgentsProvider())
135
-
136
-# Get all the tools
137
-tools = composio.tools.get(
138
- user_id=user_id,
139
- tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"],
140
-)
141
-
142
-# Create an agent with the tools
143
-agent = Agent(
144
- name="GitHub Agent",
145
- instructions="You are a helpful assistant.",
146
- tools=tools,
147
-)
148
-
149
-# Run the agent
150
-async def main():
151
- result = await Runner.run(
152
- starting_agent=agent,
153
- input=(
154
- "Star the repository composiohq/composio on GitHub."
155
- ),
156
- )
157
- print(result.final_output)
158
-
159
-asyncio.run(main())
160
-```
43
+<SnippetCode
44
+ src="fern/snippets/tool-calling/typescript/exec-tool-agentic.ts"
45
+ startLine={1}
46
+ endLine={30}
47
+ title="TypeScript (Anthropic)"
48
+/>
49
+
50
+<SnippetCode
51
+ src="fern/snippets/tool-calling/python/exec-tool-agentic.py"
52
+ startLine={1}
53
+ endLine={37}
54
+ title="Python (OpenAI Agents SDK)"
55
+/>
56
</CodeGroup>
57
58
## Tools are scoped to a user
fern/pages/src/tool-calling/fetching-tools.mdx
+2
-2
@@ -98,13 +98,13 @@ To examine the raw schema definitition of a tool to understand the input/output
98
99
<CodeGroup>
100
<SnippetCode
101
- src="fern/snippets/typescript/raw_tools.ts"
101
+ src="fern/snippets/tool-calling/typescript/raw_tools.ts"
102
startLine={1}
103
endLine={15}
104
title="TypeScript"
105
/>
106
<SnippetCode
107
- src="fern/snippets/python/raw_tools.py"
107
+ src="fern/snippets/tool-calling/python/raw_tools.py"
108
startLine={1}
109
endLine={15}
110
title="Python"
fern/pages/src/triggers/using-triggers.mdx
+5
-5
@@ -45,7 +45,7 @@ First, you can view the required configuration to make the trigger too as follow
45
46
<CodeGroup>
47
<SnippetCode
48
- src="fern/snippets/typescript/triggers.ts"
48
+ src="fern/snippets/triggers/typescript/triggers.ts"
49
startLine={1}
50
endLine={27}
51
title="TypeScript (new)"
@@ -57,7 +57,7 @@ To create a trigger, first fetch the user's connection ID, then use it along wit
57
58
<CodeGroup>
59
<SnippetCode
60
- src="fern/snippets/typescript/triggers.ts"
60
+ src="fern/snippets/triggers/typescript/triggers.ts"
61
startLine={28}
62
endLine={40}
63
title="TypeScript (new)"
@@ -86,7 +86,7 @@ This method uses websockets to subscribe to the trigger.
86
87
<CodeGroup>
88
<SnippetCode
89
-src="fern/snippets/typescript/triggers.ts"
89
+src="fern/snippets/triggers/typescript/triggers.ts"
90
startLine={42}
91
endLine={53}
92
title="TypeScript (new)"
@@ -128,12 +128,12 @@ To receive trigger events via webhooks, you need to configure a publicly accessi
128
<CodeGroup>
129
130
<SnippetCode
131
- src="fern/snippets/typescript/trigger-webhook.ts"
131
+ src="fern/snippets/triggers/typescript/trigger-webhook.ts"
132
title="app/api/webhook/route.ts"
133
/>
134
135
<SnippetCode
136
- src="fern/snippets/python/trigger-webhook.py"
136
+ src="fern/snippets/triggers/python/trigger-webhook.py"
137
title="app/route.py"
138
/>
139
fern/pyproject.toml
+13
-1
@@ -41,5 +41,17 @@ build-backend = "hatchling.build"
41
[tool.hatch.build.targets.wheel]
42
packages = ["generators"]
43
44
+[tool.uv.sources]
45
+composio-openai-agents = { workspace = true }
46
+composio-gemini = { workspace = true }
47
+
48
[dependency-groups]
45
-dev = ["composio", "composio-langchain", "langchain>=0.3.25"]
49
+dev = [
50
+ "composio",
51
+ "composio-gemini",
52
+ "composio-langchain",
53
+ "composio-openai-agents",
54
+ "google-genai>=1.20.0",
55
+ "langchain>=0.3.25",
56
+ "openai-agents>=0.0.19",
57
+]
fern/scripts/doc-new.ts
new
+287
@@ -0,0 +1,287 @@
1
+#!/usr/bin/env bun
2
+
3
+import fs from 'fs';
4
+import path from 'path';
5
+import { parseArgs } from 'util';
6
+import readline from 'readline';
7
+
8
+const PAGES_SRC_DIR = path.join(import.meta.dir, '../pages/src');
9
+const SNIPPETS_DIR = path.join(import.meta.dir, '../snippets');
10
+
11
+const FEATURES = [
12
+ 'get-started',
13
+ 'tool-calling',
14
+ 'authentication',
15
+ 'triggers',
16
+ 'providers',
17
+ 'examples',
18
+ 'migration',
19
+ 'mcp',
20
+];
21
+
22
+const DOC_TYPES = ['guide', 'example', 'provider', 'reference'];
23
+
24
+const DOC_TEMPLATES: Record<string, (name: string) => string> = {
25
+ guide: (name: string) => `---
26
+title: ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')}
27
+description: ""
28
+keywords: ""
29
+subtitle: ""
30
+hide-nav-links: false
31
+---
32
+
33
+## Introduction
34
+
35
+[Add your introduction here]
36
+
37
+## Getting Started
38
+
39
+[Add getting started content]
40
+
41
+## Examples
42
+
43
+[Add examples here]
44
+
45
+## Next Steps
46
+
47
+[Add next steps]
48
+`,
49
+ example: (name: string) => `---
50
+title: ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')}
51
+description: ""
52
+keywords: ""
53
+subtitle: ""
54
+hide-nav-links: true
55
+---
56
+
57
+This example demonstrates...
58
+
59
+## Prerequisites
60
+
61
+- [List prerequisites]
62
+
63
+## Implementation
64
+
65
+[Add implementation details]
66
+
67
+## Running the Example
68
+
69
+[Add instructions]
70
+
71
+## Next Steps
72
+
73
+[Add next steps]
74
+`,
75
+ provider: (name: string) => `---
76
+title: ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')} Provider
77
+slug: /providers/${name}
78
+image: "https://og.composio.dev/api/og?title=${encodeURIComponent(name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' '))}%20Provider"
79
+keywords: ""
80
+hide-nav-links: false
81
+---
82
+
83
+The ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')} Provider transforms Composio tools into a format compatible with ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')}'s function calling capabilities.
84
+
85
+## Setup
86
+
87
+<CodeGroup>
88
+\`\`\`typescript TypeScript
89
+npm install @composio/${name}
90
+\`\`\`
91
+\`\`\`python Python
92
+pip install composio[${name}]
93
+\`\`\`
94
+</CodeGroup>
95
+
96
+## Usage
97
+
98
+<Tabs>
99
+<Tab title="TypeScript">
100
+<SnippetCode
101
+ src="fern/snippets/providers/typescript/${name}.ts"
102
+ title="${name}-provider.ts"
103
+/>
104
+</Tab>
105
+<Tab title="Python">
106
+<SnippetCode
107
+ src="fern/snippets/providers/python/${name}.py"
108
+ title="${name}-provider.py"
109
+/>
110
+</Tab>
111
+</Tabs>
112
+`,
113
+ reference: (name: string) => `---
114
+title: ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')}
115
+description: ""
116
+keywords: ""
117
+subtitle: ""
118
+hide-nav-links: false
119
+---
120
+
121
+## Overview
122
+
123
+[Add overview]
124
+
125
+## API Reference
126
+
127
+[Add API reference]
128
+
129
+## Examples
130
+
131
+[Add examples]
132
+`,
133
+};
134
+
135
+const rl = readline.createInterface({
136
+ input: process.stdin,
137
+ output: process.stdout,
138
+});
139
+
140
+function question(prompt: string): Promise<string> {
141
+ return new Promise((resolve) => {
142
+ rl.question(prompt, resolve);
143
+ });
144
+}
145
+
146
+function validateFeature(feature: string): boolean {
147
+ return FEATURES.includes(feature);
148
+}
149
+
150
+function validateDocType(type: string): boolean {
151
+ return DOC_TYPES.includes(type);
152
+}
153
+
154
+async function createDoc(feature: string, name: string, type: string) {
155
+ if (!validateFeature(feature)) {
156
+ console.error(`❌ Invalid feature: ${feature}`);
157
+ console.log(`Valid features: ${FEATURES.join(', ')}`);
158
+ process.exit(1);
159
+ }
160
+
161
+ if (!validateDocType(type)) {
162
+ console.error(`❌ Invalid type: ${type}`);
163
+ console.log(`Valid types: ${DOC_TYPES.join(', ')}`);
164
+ process.exit(1);
165
+ }
166
+
167
+ const featureDir = path.join(PAGES_SRC_DIR, feature);
168
+ const fileName = `${name}.mdx`;
169
+ const filePath = path.join(featureDir, fileName);
170
+
171
+ // Create directory if it doesn't exist
172
+ if (!fs.existsSync(featureDir)) {
173
+ fs.mkdirSync(featureDir, { recursive: true });
174
+ console.log(`📁 Created directory: ${path.relative(PAGES_SRC_DIR, featureDir)}`);
175
+ }
176
+
177
+ // Check if file already exists
178
+ if (fs.existsSync(filePath)) {
179
+ console.error(`❌ File already exists: ${path.relative(PAGES_SRC_DIR, filePath)}`);
180
+ process.exit(1);
181
+ }
182
+
183
+ // Write the template
184
+ const template = DOC_TEMPLATES[type];
185
+ fs.writeFileSync(filePath, template(name));
186
+ console.log(`✅ Created doc: ${path.relative(PAGES_SRC_DIR, filePath)}`);
187
+
188
+ // Ask about creating snippet files
189
+ if (type === 'provider' || type === 'example') {
190
+ const createSnippets = await question('\n📝 Create matching snippet files? (y/n): ');
191
+ if (createSnippets.toLowerCase() === 'y') {
192
+ await createMatchingSnippets(feature, name);
193
+ }
194
+ }
195
+
196
+ // Show navigation update suggestion
197
+ console.log(`\n📋 To add this to navigation, update fern/docs.yml:`);
198
+ console.log(` - page: ${name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')}`);
199
+ console.log(` path: pages/dist/${feature}/${fileName}`);
200
+ if (type === 'provider') {
201
+ console.log(` slug: ${name}`);
202
+ }
203
+
204
+ rl.close();
205
+}
206
+
207
+async function createMatchingSnippets(feature: string, name: string) {
208
+ const languages = ['python', 'typescript'];
209
+ const extensions = { python: 'py', typescript: 'ts' };
210
+
211
+ for (const lang of languages) {
212
+ const snippetFeatureDir = path.join(SNIPPETS_DIR, feature, lang);
213
+ const snippetFileName = `${name}.${extensions[lang]}`;
214
+ const snippetFilePath = path.join(snippetFeatureDir, snippetFileName);
215
+
216
+ // Create directory if it doesn't exist
217
+ if (!fs.existsSync(snippetFeatureDir)) {
218
+ fs.mkdirSync(snippetFeatureDir, { recursive: true });
219
+ }
220
+
221
+ // Skip if file exists
222
+ if (fs.existsSync(snippetFilePath)) {
223
+ console.log(`⚠️ Snippet already exists: ${path.relative(SNIPPETS_DIR, snippetFilePath)}`);
224
+ continue;
225
+ }
226
+
227
+ // Create snippet with boilerplate
228
+ const boilerplate = lang === 'python'
229
+ ? `from composio import Composio\n\n# Initialize Composio client\ncomposio = Composio()\n\n# TODO: Add ${name} provider example\n`
230
+ : `import { Composio } from '@composio/core';\n\n// Initialize Composio client\nconst composio = new Composio();\n\n// TODO: Add ${name} provider example\n`;
231
+
232
+ fs.writeFileSync(snippetFilePath, boilerplate);
233
+ console.log(`✅ Created snippet: ${path.relative(SNIPPETS_DIR, snippetFilePath)}`);
234
+ }
235
+}
236
+
237
+function showHelp() {
238
+ console.log(`
239
+Usage: pnpm doc:new --feature=<feature> --name=<name> --type=<type>
240
+
241
+Options:
242
+ --feature The feature category (required)
243
+ Valid values: ${FEATURES.join(', ')}
244
+
245
+ --name The name of the doc file (required)
246
+ Will be saved as <name>.mdx
247
+
248
+ --type The type of documentation (required)
249
+ Valid values: ${DOC_TYPES.join(', ')}
250
+
251
+ --help Show this help message
252
+
253
+Examples:
254
+ pnpm doc:new --feature=providers --name=gemini --type=provider
255
+ pnpm doc:new --feature=examples --name=calendar-sync --type=example
256
+ pnpm doc:new --feature=authentication --name=oauth-flow --type=guide
257
+`);
258
+}
259
+
260
+async function main() {
261
+ const { values } = parseArgs({
262
+ args: process.argv.slice(2),
263
+ options: {
264
+ feature: { type: 'string' },
265
+ name: { type: 'string' },
266
+ type: { type: 'string' },
267
+ help: { type: 'boolean' },
268
+ },
269
+ });
270
+
271
+ if (values.help) {
272
+ showHelp();
273
+ process.exit(0);
274
+ }
275
+
276
+ const { feature, name, type } = values;
277
+
278
+ if (!feature || !name || !type) {
279
+ console.error('❌ Missing required arguments');
280
+ showHelp();
281
+ process.exit(1);
282
+ }
283
+
284
+ await createDoc(feature, name, type);
285
+}
286
+
287
+main();
\ No newline at end of file
fern/scripts/snippet-new.ts
new
+140
@@ -0,0 +1,140 @@
1
+#!/usr/bin/env bun
2
+
3
+import fs from 'fs';
4
+import path from 'path';
5
+import { parseArgs } from 'util';
6
+
7
+const SNIPPETS_DIR = path.join(import.meta.dir, '../snippets');
8
+
9
+const FEATURES = [
10
+ 'get-started',
11
+ 'tool-calling',
12
+ 'authentication',
13
+ 'triggers',
14
+ 'providers',
15
+ 'examples',
16
+ 'migration',
17
+ 'mcp',
18
+];
19
+
20
+const LANGUAGES = ['python', 'typescript'];
21
+
22
+const LANGUAGE_EXTENSIONS: Record<string, string> = {
23
+ python: 'py',
24
+ typescript: 'ts',
25
+};
26
+
27
+const LANGUAGE_BOILERPLATES: Record<string, string> = {
28
+ python: `from composio import Composio
29
+
30
+# Initialize Composio client
31
+composio = Composio()
32
+
33
+# TODO: Add your code here
34
+`,
35
+ typescript: `import { Composio } from '@composio/core';
36
+
37
+// Initialize Composio client
38
+const composio = new Composio();
39
+
40
+// TODO: Add your code here
41
+`,
42
+};
43
+
44
+function validateFeature(feature: string): boolean {
45
+ return FEATURES.includes(feature);
46
+}
47
+
48
+function validateLanguage(lang: string): boolean {
49
+ return LANGUAGES.includes(lang);
50
+}
51
+
52
+function createSnippet(feature: string, name: string, lang: string) {
53
+ if (!validateFeature(feature)) {
54
+ console.error(`❌ Invalid feature: ${feature}`);
55
+ console.log(`Valid features: ${FEATURES.join(', ')}`);
56
+ process.exit(1);
57
+ }
58
+
59
+ if (!validateLanguage(lang)) {
60
+ console.error(`❌ Invalid language: ${lang}`);
61
+ console.log(`Valid languages: ${LANGUAGES.join(', ')}`);
62
+ process.exit(1);
63
+ }
64
+
65
+ const extension = LANGUAGE_EXTENSIONS[lang];
66
+ const boilerplate = LANGUAGE_BOILERPLATES[lang];
67
+
68
+ const featureDir = path.join(SNIPPETS_DIR, feature, lang);
69
+ const fileName = `${name}.${extension}`;
70
+ const filePath = path.join(featureDir, fileName);
71
+
72
+ // Create directory if it doesn't exist
73
+ if (!fs.existsSync(featureDir)) {
74
+ fs.mkdirSync(featureDir, { recursive: true });
75
+ console.log(`📁 Created directory: ${path.relative(SNIPPETS_DIR, featureDir)}`);
76
+ }
77
+
78
+ // Check if file already exists
79
+ if (fs.existsSync(filePath)) {
80
+ console.error(`❌ File already exists: ${path.relative(SNIPPETS_DIR, filePath)}`);
81
+ process.exit(1);
82
+ }
83
+
84
+ // Write the boilerplate
85
+ fs.writeFileSync(filePath, boilerplate);
86
+ console.log(`✅ Created snippet: ${path.relative(SNIPPETS_DIR, filePath)}`);
87
+ console.log(`\nYou can now reference this snippet in your docs with:`);
88
+ console.log(`<SnippetCode src="fern/snippets/${feature}/${lang}/${fileName}" />`);
89
+}
90
+
91
+function showHelp() {
92
+ console.log(`
93
+Usage: pnpm snippet:new --feature=<feature> --name=<name> --lang=<language>
94
+
95
+Options:
96
+ --feature The feature category (required)
97
+ Valid values: ${FEATURES.join(', ')}
98
+
99
+ --name The name of the snippet file (required)
100
+ Will be saved as <name>.<extension>
101
+
102
+ --lang The programming language (required)
103
+ Valid values: ${LANGUAGES.join(', ')}
104
+
105
+ --help Show this help message
106
+
107
+Examples:
108
+ pnpm snippet:new --feature=providers --name=anthropic --lang=python
109
+ pnpm snippet:new --feature=triggers --name=slack-events --lang=typescript
110
+`);
111
+}
112
+
113
+function main() {
114
+ const { values } = parseArgs({
115
+ args: process.argv.slice(2),
116
+ options: {
117
+ feature: { type: 'string' },
118
+ name: { type: 'string' },
119
+ lang: { type: 'string' },
120
+ help: { type: 'boolean' },
121
+ },
122
+ });
123
+
124
+ if (values.help) {
125
+ showHelp();
126
+ process.exit(0);
127
+ }
128
+
129
+ const { feature, name, lang } = values;
130
+
131
+ if (!feature || !name || !lang) {
132
+ console.error('❌ Missing required arguments');
133
+ showHelp();
134
+ process.exit(1);
135
+ }
136
+
137
+ createSnippet(feature, name, lang);
138
+}
139
+
140
+main();
\ No newline at end of file
fern/snippets/authentication/typescript/custom-auth-injection.ts
renamed
fern/snippets/examples/sample-script/sample-script.py
renamed
fern/snippets/get-started/python/quickstart-openai-agents.py
new
+45
@@ -0,0 +1,45 @@
1
+import asyncio
2
+
3
+from agents import Agent, Runner
4
+
5
+from composio import Composio
6
+from composio_openai_agents import OpenAIAgentsProvider
7
+
8
+# Initialize Composio toolset
9
+user_id = "user@email.com"
10
+composio = Composio(provider=OpenAIAgentsProvider())
11
+
12
+# Initialize connection request
13
+connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
14
+print(f"🔗 Visit the URL to authorize:\n👉 {connection_request.redirect_url}")
15
+
16
+# wait for the connection to be active
17
+connection_request.wait_for_connection()
18
+
19
+# Get all the tools
20
+tools = composio.tools.get(
21
+ user_id=user_id,
22
+ tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"],
23
+)
24
+
25
+# Create an agent with the tools
26
+agent = Agent(
27
+ name="GitHub Agent",
28
+ instructions="You are a helpful assistant that helps users with GitHub tasks.",
29
+ tools=tools,
30
+)
31
+
32
+
33
+# Run the agent
34
+async def main():
35
+ result = await Runner.run(
36
+ starting_agent=agent,
37
+ input=(
38
+ "Star the repository composiohq/composio on GitHub. If done "
39
+ "successfully, respond with 'Action executed successfully'"
40
+ ),
41
+ )
42
+ print(result.final_output)
43
+
44
+
45
+asyncio.run(main())
fern/snippets/get-started/python/quickstart.py
new
+33
@@ -0,0 +1,33 @@
1
+from composio import Composio
2
+from openai import OpenAI
3
+
4
+openai = OpenAI()
5
+composio = Composio()
6
+user_id = "user@email.com"
7
+
8
+# Initialize connection request
9
+connection_request = composio.toolkits.authorize(user_id=user_id, toolkit="gmail")
10
+print(f"🔗 Visit the URL to authorize:\n👉 {connection_request.redirect_url}")
11
+
12
+# wait for the connection to be active
13
+connection_request.wait_for_connection()
14
+
15
+# Fetch tools
16
+tools = composio.tools.get(user_id=user_id, toolkits=["GMAIL"])
17
+
18
+# Invoke agent
19
+completion = openai.chat.completions.create(
20
+ model="gpt-4o",
21
+ messages=[
22
+ {
23
+ "role": "user",
24
+ "content": "say 'hi from the composio quickstart' to sid@composio.dev",
25
+ # we'll ship you free merch if you do ;)
26
+ },
27
+ ],
28
+ tools=tools,
29
+)
30
+
31
+# Handle Result from tool call
32
+result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
33
+print(result)
fern/snippets/get-started/typescript/quickstart.ts
new
+28
@@ -0,0 +1,28 @@
1
+import { Composio } from '@composio/core';
2
+import { AnthropicProvider } from '@composio/anthropic';
3
+import Anthropic from '@anthropic-ai/sdk';
4
+
5
+const anthropic = new Anthropic();
6
+const composio = new Composio({ provider: new AnthropicProvider() });
7
+const userId = 'user@example.com';
8
+
9
+const connection = await composio.toolkits.authorize(userId, 'LINEAR');
10
+console.log(`🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`);
11
+
12
+const tools = await composio.tools.get(userId, { toolkits: ['LINEAR'] });
13
+await connection.waitForConnection();
14
+
15
+const msg = await anthropic.messages.create({
16
+ model: 'claude-3-7-sonnet-latest',
17
+ tools: tools,
18
+ messages: [
19
+ {
20
+ role: 'user',
21
+ content: 'Get my linear projects',
22
+ },
23
+ ],
24
+ max_tokens: 1024,
25
+});
26
+
27
+const result = await composio.provider.handleToolCalls(userId, msg);
28
+console.log('✅ Tool results:', result);
fern/snippets/get-started/typescript/vercel-quickstart.ts
new
+32
@@ -0,0 +1,32 @@
1
+import { Composio } from '@composio/core';
2
+import { generateText } from 'ai';
3
+import { anthropic } from '@ai-sdk/anthropic';
4
+import { VercelProvider } from '@composio/vercel';
5
+import { v4 as uuidv4 } from 'uuid';
6
+
7
+const userId = uuidv4(); // The user's ID.
8
+const composio = new Composio({
9
+ apiKey: process.env.COMPOSIO_API_KEY,
10
+ provider: new VercelProvider(),
11
+});
12
+
13
+const connection = await composio.toolkits.authorize(userId, 'gmail');
14
+console.log(`🔗 Visit the URL to authorize:\n👉 ${connection.redirectUrl}`);
15
+
16
+await connection.waitForConnection();
17
+
18
+const tools = await composio.tools.get(userId, { tools: ['GMAIL_SEND_EMAIL'] });
19
+
20
+const { text } = await generateText({
21
+ model: anthropic('claude-3-7-sonnet-20250219'),
22
+ messages: [
23
+ {
24
+ role: 'user',
25
+ content: "say 'hi from the composio quickstart' to sid@composio.dev", // we'll ship you free merch if you do ;)
26
+ },
27
+ ],
28
+ tools,
29
+ maxSteps: 3,
30
+});
31
+
32
+console.log(text);
fern/snippets/providers/python/anthropic.py
new
+6
@@ -0,0 +1,6 @@
1
+from composio import Composio
2
+
3
+# Initialize Composio client
4
+composio = Composio()
5
+
6
+# TODO: Add your code here
fern/snippets/providers/python/langchain-provider.py
renamed
fern/snippets/providers/python/openai-provider.py
new
+23
@@ -0,0 +1,23 @@
1
+from openai import OpenAI
2
+from composio import Composio
3
+from composio_openai import OpenAIProvider
4
+
5
+# Initialize Composio client with OpenAI Provider
6
+composio = Composio(provider=OpenAIProvider())
7
+openai = OpenAI()
8
+
9
+user_id = "user@acme.org"
10
+tools = composio.tools.get(user_id=user_id, toolkits=["HACKERNEWS"])
11
+
12
+response = openai.chat.completions.create(
13
+ model="gpt-4.1",
14
+ tools=tools,
15
+ messages=[
16
+ {"role": "user", "content": "What's the latest Hackernews post about?"},
17
+ ],
18
+)
19
+
20
+# Execute the function calls.
21
+result = composio.provider.handle_tool_calls(response=response, user_id=user_id)
22
+print(result)
23
+# will return the raw response from the HACKERNEWS API.
\ No newline at end of file
fern/snippets/providers/typescript/anthropic.ts
new
+32
@@ -0,0 +1,32 @@
1
+import { Composio } from '@composio/core';
2
+import { AnthropicProvider } from '@composio/anthropic';
3
+import { Anthropic } from '@anthropic-ai/sdk';
4
+
5
+const composio = new Composio({
6
+ provider: new AnthropicProvider({
7
+ cacheTools: false, // default
8
+ }),
9
+});
10
+
11
+const anthropic = new Anthropic();
12
+
13
+const userId = 'user@acme.com';
14
+const tools = await composio.tools.get(userId, {
15
+ tools: ['GITHUB_GET_OCTOCAT', 'GITHUB_GET_THE_ZEN_OF_GITHUB'],
16
+});
17
+
18
+const msg = await anthropic.messages.create({
19
+ model: 'claude-3-5-sonnet-20240620',
20
+ messages: [
21
+ {
22
+ role: 'user',
23
+ content: 'Get me the GitHub Octocat',
24
+ },
25
+ ],
26
+ tools: tools,
27
+ max_tokens: 1000,
28
+});
29
+
30
+const res = await composio.provider.handleToolCalls(userId, msg);
31
+
32
+console.log(JSON.parse(res[0]).details);
fern/snippets/providers/typescript/openai.ts
new
+45
@@ -0,0 +1,45 @@
1
+import { Composio } from '@composio/core';
2
+import { OpenAIResponsesProvider, OpenAIProvider } from '@composio/openai';
3
+import { OpenAI } from 'openai';
4
+
5
+// Initialise Composio client with the OpenAI provider.
6
+const composioForResponses = new Composio({ provider: new OpenAIResponsesProvider() });
7
+const openai = new OpenAI();
8
+
9
+const userId = 'your@example.com';
10
+const toolsForResponses = await composioForResponses.tools.get(userId, {
11
+ toolkits: ['HACKERNEWS'],
12
+});
13
+
14
+const response = await openai.responses.create({
15
+ model: 'gpt-4.1',
16
+ input: "What's the lates Hackernews post about?",
17
+ tools: toolsForResponses,
18
+});
19
+
20
+const result = await composioForResponses.provider.handleResponse(userId, response);
21
+
22
+console.log('RESPONSE API');
23
+console.log(JSON.stringify(result, null, 2));
24
+// will return the raw response from the HACKERNEWS API.
25
+
26
+const composioForCompletions = new Composio({ provider: new OpenAIProvider() });
27
+const toolsForCompletions = await composioForCompletions.tools.get(userId, {
28
+ toolkits: ['HACKERNEWS'],
29
+});
30
+
31
+const completion = await openai.chat.completions.create({
32
+ model: 'gpt-4o',
33
+ messages: [
34
+ {
35
+ role: 'user',
36
+ content: 'What is the latest hackernews post about?',
37
+ },
38
+ ],
39
+ tools: toolsForCompletions,
40
+});
41
+
42
+const newResult = await composioForCompletions.provider.handleToolCalls(userId, completion);
43
+
44
+console.log(JSON.stringify(newResult, null, 2));
45
+// will return the raw response from the HACKERNEWS API.
fern/snippets/tool-calling/python/auth-tools.py
new
+34
@@ -0,0 +1,34 @@
1
+from composio import Composio
2
+from composio.types import auth_scheme
3
+
4
+linear_auth_config_id = "ac_dqYN9oElNVlg"
5
+user_id = "0000-1111-2222"
6
+composio = Composio()
7
+
8
+# Create a new connected account
9
+connection_request = composio.connected_accounts.initiate(
10
+ user_id=user_id,
11
+ auth_config_id=linear_auth_config_id,
12
+ config=auth_scheme.oauth2()
13
+)
14
+print(connection_request.redirect_url)
15
+
16
+# Wait for the connection to be established
17
+connected_account = connection_request.wait_for_connection()
18
+
19
+# If you only have the connection request ID, you can also wait using:
20
+
21
+connected_account = composio.connected_accounts.wait_for_connection(connection_request.id)
22
+# Recommended for when connection_request object is destroyed
23
+
24
+# API key based toolkit
25
+serp_auth_config_id = "ac_VWmFEC55Zgv6"
26
+
27
+# Retrieved from the user
28
+user_api_key = "sk_1234567890"
29
+
30
+connection_request = composio.connected_accounts.initiate(
31
+ user_id=user_id,
32
+ auth_config_id=serp_auth_config_id,
33
+ config=auth_scheme.api_key(user_api_key)
34
+)
fern/snippets/tool-calling/python/exec-tool-agentic.py
new
+35
@@ -0,0 +1,35 @@
1
+import asyncio
2
+from agents import Agent, Runner
3
+from composio import Composio
4
+from composio_openai_agents import OpenAIAgentsProvider
5
+from uuid import uuid4
6
+
7
+user_id = uuid4()
8
+
9
+# Initialize Composio toolset
10
+composio = Composio(provider=OpenAIAgentsProvider())
11
+
12
+# Get all the tools
13
+tools = composio.tools.get(
14
+ user_id=user_id,
15
+ toolkits=["COMPOSIO_SEARCH"],
16
+)
17
+
18
+# Create an agent with the tools
19
+agent = Agent(
20
+ name="Deep Researcher",
21
+ instructions="You are an investigative journalist.",
22
+ tools=tools,
23
+)
24
+
25
+
26
+# Run the agent
27
+async def main():
28
+ result = await Runner.run(
29
+ starting_agent=agent,
30
+ input=("Do a thorought DEEP research on Ilya Sutskever"),
31
+ )
32
+ print(result.final_output)
33
+
34
+
35
+asyncio.run(main())
fern/snippets/tool-calling/python/exec-tool-completions.py
new
+28
@@ -0,0 +1,28 @@
1
+from composio import Composio
2
+from composio_gemini import GeminiProvider
3
+from google import genai
4
+from google.genai import types
5
+from uuid import uuid4
6
+
7
+user_id = uuid4()
8
+
9
+# Create composio client
10
+composio = Composio(provider=GeminiProvider())
11
+
12
+# Create google client
13
+client = genai.Client()
14
+
15
+# Create genai client config
16
+config = types.GenerateContentConfig(
17
+ tools=composio.tools.get(
18
+ user_id=user_id,
19
+ tools=[
20
+ "COMPOSIO_SEARCH_DUCK_DUCK_GO_SEARCH",
21
+ ],
22
+ )
23
+)
24
+
25
+# Use the chat interface.
26
+chat = client.chats.create(model="gemini-2.0-flash", config=config)
27
+response = chat.send_message("What's new happening with Cluely?")
28
+print(response.text)
fern/snippets/tool-calling/python/raw_tools.py
renamed
fern/snippets/tool-calling/typescript/auth-tools.ts
new
+36
@@ -0,0 +1,36 @@
1
+import { Composio } from '@composio/core';
2
+import { AuthScheme } from '@composio/core';
3
+
4
+const composio = new Composio();
5
+const linearAuthConfigId = 'ac_dqYN9oElNVlg';
6
+
7
+const userId = '0000-1111-2222-3333';
8
+
9
+// Initiate the OAuth connection request
10
+// const connRequest = await composio.connectedAccounts.initiate(userId, linearAuthConfigId);
11
+
12
+// // Destructure redirectUrl for easier access
13
+// const { redirectUrl, id } = connRequest;
14
+// console.log(redirectUrl);
15
+
16
+// // Wait for the connection to be established
17
+// await connRequest.waitForConnection();
18
+
19
+// // If you only have the connection request ID, you can also wait using:
20
+// // Recommended for when connRequest object is destroyed
21
+// await composio.connectedAccounts.waitForConnection(id);
22
+
23
+// API Key based toolkit
24
+
25
+const serpAuthConfigId = 'ac_VWmFEC55Zgv6';
26
+
27
+// Retrieved from the user
28
+const userApiKey = 'sk_1234567890';
29
+
30
+const serpConnectionRequest = await composio.connectedAccounts.initiate(userId, serpAuthConfigId, {
31
+ config: AuthScheme.APIKey({
32
+ api_key: userApiKey,
33
+ }),
34
+});
35
+
36
+console.log(JSON.stringify(serpConnectionRequest, null, 2));
fern/snippets/tool-calling/typescript/exec-tool-agentic.ts
new
+30
@@ -0,0 +1,30 @@
1
+import { Composio } from '@composio/core';
2
+import { generateText } from 'ai';
3
+import { anthropic } from '@ai-sdk/anthropic';
4
+import { VercelProvider } from '@composio/vercel';
5
+
6
+const userId = '0000-1111-2222-3333';
7
+
8
+const composio = new Composio({
9
+ apiKey: process.env.COMPOSIO_API_KEY,
10
+ provider: new VercelProvider(),
11
+});
12
+
13
+const tools = await composio.tools.get(userId, {
14
+ toolkits: ['COMPOSIO_SEARCH'],
15
+ limit: 10,
16
+});
17
+
18
+const { text } = await generateText({
19
+ model: anthropic('claude-3-7-sonnet-20250219'),
20
+ messages: [
21
+ {
22
+ role: 'user',
23
+ content: 'Do a thorough DEEP research on Ilya Sutskever',
24
+ },
25
+ ],
26
+ tools,
27
+ maxSteps: 5,
28
+});
29
+
30
+console.log(text);
fern/snippets/tool-calling/typescript/exec-tool-completions.ts
new
+30
@@ -0,0 +1,30 @@
1
+import { Composio } from '@composio/core';
2
+import { AnthropicProvider } from '@composio/anthropic';
3
+import { Anthropic } from '@anthropic-ai/sdk';
4
+
5
+const userId = '0000-1111-2222-3333'; // User's UUID
6
+
7
+const anthropic = new Anthropic();
8
+const composio = new Composio({
9
+ apiKey: process.env.COMPOSIO_API_KEY,
10
+ provider: new AnthropicProvider(),
11
+});
12
+
13
+const tools = await composio.tools.get(userId, {
14
+ tools: ['COMPOSIO_SEARCH_DUCK_DUCK_GO_SEARCH'],
15
+});
16
+
17
+const msg = await anthropic.messages.create({
18
+ model: 'claude-3-7-sonnet-latest',
19
+ tools: tools,
20
+ messages: [
21
+ {
22
+ role: 'user',
23
+ content: "What's new with OpenAI?",
24
+ },
25
+ ],
26
+ max_tokens: 1024,
27
+});
28
+
29
+const result = await composio.provider.handleToolCalls(userId, msg);
30
+console.log(result);
fern/snippets/tool-calling/typescript/raw_tools.ts
renamed
fern/snippets/triggers/python/trigger-webhook.py
renamed
fern/snippets/triggers/python/triggers.py
renamed
fern/snippets/triggers/typescript/trigger-webhook.ts
renamed
fern/snippets/triggers/typescript/triggers.ts
renamed
package.json
+3
-3
@@ -36,6 +36,9 @@
36
"packageManager": "pnpm@10.8.0",
37
"devDependencies": {
38
"@changesets/cli": "^2.29.4",
39
+ "@composio/anthropic": "workspace:*",
40
+ "@composio/core": "workspace:*",
41
+ "@composio/openai": "workspace:*",
42
"@types/node": "^22.15.18",
43
"@vitest/ui": "^3.1.4",
44
"eslint": "^9.25.1",
@@ -57,8 +60,5 @@
60
"ts/packages/**/*.{ts,tsx,js,jsx,json,md}": [
61
"prettier --write"
62
]
60
- },
61
- "dependencies": {
62
- "@composio/anthropic": "^0.1.26"
63
}
64
}
pnpm-lock.yaml
+80
-177
@@ -7,14 +7,19 @@ settings:
7
importers:
8
9
.:
10
- dependencies:
11
- '@composio/anthropic':
12
- specifier: ^0.1.26
13
- version: 0.1.26(@anthropic-ai/sdk@0.52.0)(@composio/core@0.1.26(ws@8.18.2))
10
devDependencies:
11
'@changesets/cli':
12
specifier: ^2.29.4
13
version: 2.29.4
14
+ '@composio/anthropic':
15
+ specifier: workspace:*
16
+ version: link:ts/packages/providers/anthropic
17
+ '@composio/core':
18
+ specifier: workspace:*
19
+ version: link:ts/packages/core
20
+ '@composio/openai':
21
+ specifier: workspace:*
22
+ version: link:ts/packages/providers/openai
23
'@types/node':
24
specifier: ^22.15.18
25
version: 22.15.32
@@ -67,12 +72,18 @@ importers:
72
specifier: ^2.8.3
73
version: 2.8.3
74
devDependencies:
75
+ '@ai-sdk/anthropic':
76
+ specifier: ^1.2.12
77
+ version: 1.2.12(zod@3.25.67)
78
'@anthropic-ai/sdk':
79
specifier: ^0.52.0
80
version: 0.52.0
81
'@composio/core':
82
specifier: workspace:*
83
version: link:../ts/packages/core
84
+ '@composio/openai':
85
+ specifier: workspace:*
86
+ version: link:../ts/packages/providers/openai
87
'@composio/vercel':
88
specifier: workspace:*
89
version: link:../ts/packages/providers/vercel
@@ -91,6 +102,9 @@ importers:
102
'@types/yaml':
103
specifier: ^1.9.7
104
version: 1.9.7
105
+ ai:
106
+ specifier: ^4.3.8
107
+ version: 4.3.16(react@18.3.1)(zod@3.25.67)
108
composio-core:
109
specifier: ^0.5.39
110
version: 0.5.39(@ai-sdk/openai@1.3.22(zod@3.25.67))(@cloudflare/workers-types@4.20250619.0)(@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.67)))(@langchain/openai@0.5.13(@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.67)))(ws@8.18.2))(ai@4.3.16(react@18.3.1)(zod@3.25.67))(langchain@0.3.28(@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.67)))(axios@1.10.0)(openai@4.104.0(ws@8.18.2)(zod@3.25.67))(ws@8.18.2))(openai@4.104.0(ws@8.18.2)(zod@3.25.67))
@@ -124,6 +138,9 @@ importers:
138
typescript:
139
specifier: ^5.8.3
140
version: 5.8.3
141
+ uuid:
142
+ specifier: ^11.1.0
143
+ version: 11.1.0
144
vitest:
145
specifier: ^3.1.4
146
version: 3.2.4(@types/node@20.19.1)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
@@ -373,28 +390,6 @@ importers:
390
specifier: ^5.8.3
391
version: 5.8.3
392
376
- ts/examples/telemetry:
377
- dependencies:
378
- '@ai-sdk/openai':
379
- specifier: ^1.3.16
380
- version: 1.3.22(zod@3.25.67)
381
- '@composio/core':
382
- specifier: workspace:*
383
- version: link:../../packages/core
384
- '@composio/vercel':
385
- specifier: workspace:*
386
- version: link:../../packages/providers/vercel
387
- ai:
388
- specifier: ^4.3.8
389
- version: 4.3.16(react@18.3.1)(zod@3.25.67)
390
- devDependencies:
391
- '@types/bun':
392
- specifier: ^1.2.9
393
- version: 1.2.16
394
- typescript:
395
- specifier: ^5.8.3
396
- version: 5.8.3
397
-
393
ts/examples/toolkits:
394
dependencies:
395
'@ai-sdk/openai':
@@ -408,7 +403,7 @@ importers:
403
version: link:../../packages/providers/vercel
404
ai:
405
specifier: ^4.3.8
411
- version: 4.3.16(react@18.3.1)(zod@3.25.62)
406
+ version: 4.3.16(react@18.3.1)(zod@3.25.67)
407
devDependencies:
408
'@types/bun':
409
specifier: ^1.2.9
@@ -502,7 +497,7 @@ importers:
497
version: 3.16.8
498
effect-errors:
499
specifier: ^1.10.11
505
- version: 1.10.11(ff5edfb43a1891ed491370151a2c33b9)
500
+ version: 1.10.11(belzt22ekwptqr7tzcbumfngca)
501
indent-string:
502
specifier: ^5.0.0
503
version: 5.0.0
@@ -673,7 +668,7 @@ importers:
668
dependencies:
669
'@langchain/core':
670
specifier: ^0.3.44
676
- version: 0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
671
+ version: 0.3.58(openai@5.5.1(zod@3.25.67))
672
devDependencies:
673
'@composio/core':
674
specifier: workspace:*
@@ -785,6 +780,12 @@ importers:
780
781
packages:
782
783
+ '@ai-sdk/anthropic@1.2.12':
784
+ resolution: {integrity: sha512-YSzjlko7JvuiyQFmI9RN1tNZdEiZxc+6xld/0tq/VkJaHpEzGAb1yiNxxvmYVcjvfu/PcvCxAAYXmTYQQ63IHQ==}
785
+ engines: {node: '>=18'}
786
+ peerDependencies:
787
+ zod: ^3.0.0
788
+
789
'@ai-sdk/openai@1.3.22':
790
resolution: {integrity: sha512-QwA+2EkG0QyjVR+7h6FE7iOu2ivNqAVMm9UJZkVxxTk5OIq5fFJDTEI/zICEMuHImTTXR2JjsL6EirJ28Jc4cw==}
791
engines: {node: '>=18'}
@@ -1038,24 +1039,12 @@ packages:
1039
'@cloudflare/workers-types@4.20250619.0':
1040
resolution: {integrity: sha512-OYmVTA45rEEsOmchtltDnrG6BBaOPB7LUGKoyE8AwkfanUOc3/wwuMZ50i1jq6NKrV1TZLsKUKzrwe1NtVGOzQ==}
1041
1041
- '@composio/anthropic@0.1.26':
1042
- resolution: {integrity: sha512-HNd/i0OZSJC5ecc0jIkN7tcw4d8aV07BP2XFVYS+KbH1GJQ9O0/sWPH/IdNep7UkcztZ7nyS9B+tCmEIAABVVw==}
1043
- peerDependencies:
1044
- '@anthropic-ai/sdk': ^0.52.0
1045
- '@composio/core': 0.1.26
1046
-
1042
'@composio/client@0.1.0-alpha.17':
1043
resolution: {integrity: sha512-iNCDSgdwfFVsjbbyZIMknMPy4uO8Xw5+MP2aI+yoQo34VXF17Fi6ZHYirrJPf8RbdoRROZTDJjC/rU18mMzC2Q==}
1044
1050
- '@composio/client@0.1.0-alpha.22':
1051
- resolution: {integrity: sha512-b9KCO5gy0EsCG+nXikOdm17PiZZ85rw3vwu9aNRIse9rEj2FA1SScpP+P9GN4G0lQHl+QPyDuVvGa6U9AATFeg==}
1052
-
1045
'@composio/client@0.1.0-alpha.24':
1046
resolution: {integrity: sha512-CC8drumVzTNZP6Hh9eR69MTwXR2UBmsPPgLgvTZUtBI5qVatjpEl018prMQXuWIzDa9eOKhQnUDNjU52cqo4sQ==}
1047
1056
- '@composio/core@0.1.26':
1057
- resolution: {integrity: sha512-+a3HYUkjVzBc6HduMvI3ZM5hYZr8X34Rds2yg1cs2sLK2t0ALsMr/W7H5wKPYQBdqu1afUWr50S9nhlXfLUhPQ==}
1058
-
1048
'@composio/json-schema-to-zod@0.1.9':
1049
resolution: {integrity: sha512-uDOAPPkaMWM2DJLCFCW6/rxTgair6EmQ4Ojo6RDayzIl2BRUro0wGkpof4Za8sJPrmdTfSqteRMDy46xPnOYhw==}
1050
@@ -1632,6 +1621,10 @@ packages:
1621
'@jsdevtools/ono@7.1.3':
1622
resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==}
1623
1624
+ '@langchain/core@0.3.58':
1625
+ resolution: {integrity: sha512-HLkOtVofgBHefaUae/+2fLNkpMLzEjHSavTmUF0YC7bDa5NPIZGlP80CGrSFXAeJ+WCPd8rIK8K/p6AW94inUQ==}
1626
+ engines: {node: '>=18'}
1627
+
1628
'@langchain/core@0.3.59':
1629
resolution: {integrity: sha512-YAvnx0z3A8z5MvyjZzjC9ZxXZYM20ivFdUeLzANSPCoPCNIQ1/EppWP82RI24PcmWkNtuXsFVaj5juWiIpZvxg==}
1630
engines: {node: '>=18'}
@@ -4229,6 +4222,14 @@ packages:
4222
typeorm:
4223
optional: true
4224
4225
+ langsmith@0.3.31:
4226
+ resolution: {integrity: sha512-9lwuLZuN3tXFYQ6eMg0rmbBw7oxQo4bu1NYeylbjz27bOdG1XB9XNoxaiIArkK4ciLdOIOhPMBXP4bkvZOgHRw==}
4227
+ peerDependencies:
4228
+ openai: '*'
4229
+ peerDependenciesMeta:
4230
+ openai:
4231
+ optional: true
4232
+
4233
langsmith@0.3.33:
4234
resolution: {integrity: sha512-imNIaBL6+ElE5eMzNHYwFxo6W/6rHlqcaUjCYoIeGdCYWlARxE3CTGKul5DJnaUgGP2CTLFeNXyvRx5HWC/4KQ==}
4235
peerDependencies:
@@ -5717,6 +5718,12 @@ packages:
5718
5719
snapshots:
5720
5721
+ '@ai-sdk/anthropic@1.2.12(zod@3.25.67)':
5722
+ dependencies:
5723
+ '@ai-sdk/provider': 1.1.3
5724
+ '@ai-sdk/provider-utils': 2.2.8(zod@3.25.67)
5725
+ zod: 3.25.67
5726
+
5727
'@ai-sdk/openai@1.3.22(zod@3.25.67)':
5728
dependencies:
5729
'@ai-sdk/provider': 1.1.3
@@ -6368,32 +6375,10 @@ snapshots:
6375
6376
'@cloudflare/workers-types@4.20250619.0': {}
6377
6371
- '@composio/anthropic@0.1.26(@anthropic-ai/sdk@0.52.0)(@composio/core@0.1.26(ws@8.18.2))':
6372
- dependencies:
6373
- '@anthropic-ai/sdk': 0.52.0
6374
- '@composio/core': 0.1.26(ws@8.18.2)
6375
-
6378
'@composio/client@0.1.0-alpha.17': {}
6379
6378
- '@composio/client@0.1.0-alpha.22': {}
6379
-
6380
'@composio/client@0.1.0-alpha.24': {}
6381
6382
- '@composio/core@0.1.22(ws@8.18.2)':
6383
- dependencies:
6384
- '@composio/client': 0.1.0-alpha.23
6385
- '@composio/json-schema-to-zod': 0.1.9
6386
- chalk: 5.4.1
6387
- openai: 4.104.0(ws@8.18.2)(zod@3.25.67)
6388
- pusher-js: 8.4.0
6389
- semver: 7.7.2
6390
- uuid: 11.1.0
6391
- zod: 3.25.67
6392
- zod-to-json-schema: 3.24.5(zod@3.25.67)
6393
- transitivePeerDependencies:
6394
- - encoding
6395
- - ws
6396
-
6382
'@composio/json-schema-to-zod@0.1.9':
6383
dependencies:
6384
'@types/json-schema': 7.0.15
@@ -6927,14 +6912,14 @@ snapshots:
6912
6913
'@jsdevtools/ono@7.1.3': {}
6914
6930
- '@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.32))':
6915
+ '@langchain/core@0.3.58(openai@5.5.1(zod@3.25.67))':
6916
dependencies:
6917
'@cfworker/json-schema': 4.1.1
6918
ansi-styles: 5.2.0
6919
camelcase: 6.3.0
6920
decamelize: 1.2.0
6921
js-tiktoken: 1.0.20
6937
- langsmith: 0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.32))
6922
+ langsmith: 0.3.31(openai@5.5.1(zod@3.25.67))
6923
mustache: 4.2.0
6924
p-queue: 6.6.2
6925
p-retry: 4.6.2
@@ -6944,14 +6929,14 @@ snapshots:
6929
transitivePeerDependencies:
6930
- openai
6931
6947
- '@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.67))':
6932
+ '@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.32))':
6933
dependencies:
6934
'@cfworker/json-schema': 4.1.1
6935
ansi-styles: 5.2.0
6936
camelcase: 6.3.0
6937
decamelize: 1.2.0
6938
js-tiktoken: 1.0.20
6954
- langsmith: 0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.67))
6939
+ langsmith: 0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.32))
6940
mustache: 4.2.0
6941
p-queue: 6.6.2
6942
p-retry: 4.6.2
@@ -6961,14 +6946,14 @@ snapshots:
6946
transitivePeerDependencies:
6947
- openai
6948
6964
- '@langchain/core@0.3.58(openai@5.3.0(ws@8.18.2)(zod@3.25.62))':
6949
+ '@langchain/core@0.3.59(openai@4.104.0(ws@8.18.2)(zod@3.25.67))':
6950
dependencies:
6951
'@cfworker/json-schema': 4.1.1
6952
ansi-styles: 5.2.0
6953
camelcase: 6.3.0
6954
decamelize: 1.2.0
6955
js-tiktoken: 1.0.20
6971
- langsmith: 0.3.31(openai@5.3.0(ws@8.18.2)(zod@3.25.62))
6956
+ langsmith: 0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.67))
6957
mustache: 4.2.0
6958
p-queue: 6.6.2
6959
p-retry: 4.6.2
@@ -8668,13 +8653,21 @@ snapshots:
8653
chai: 5.2.0
8654
tinyrainbow: 2.0.0
8655
8671
- '@vitest/mocker@3.2.3(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))':
8656
+ '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
8657
dependencies:
8658
'@vitest/spy': 3.2.4
8659
estree-walker: 3.0.3
8660
magic-string: 0.30.17
8661
optionalDependencies:
8677
- vite: 6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
8662
+ vite: 6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
8663
+
8664
+ '@vitest/mocker@3.2.4(vite@6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
8665
+ dependencies:
8666
+ '@vitest/spy': 3.2.4
8667
+ estree-walker: 3.0.3
8668
+ magic-string: 0.30.17
8669
+ optionalDependencies:
8670
+ vite: 6.3.5(@types/node@22.15.32)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
8671
8672
'@vitest/mocker@3.2.4(vite@6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))':
8673
dependencies:
@@ -8713,13 +8706,7 @@ snapshots:
8706
sirv: 3.0.1
8707
tinyglobby: 0.2.14
8708
tinyrainbow: 2.0.0
8716
- vitest: 3.2.3(@types/node@22.15.31)(@vitest/ui@3.2.3)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
8717
-
8718
- '@vitest/utils@3.2.3':
8719
- dependencies:
8720
- '@vitest/pretty-format': 3.2.3
8721
- loupe: 3.1.3
8722
- tinyrainbow: 2.0.0
8709
+ vitest: 3.2.4(@types/node@22.15.32)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
8710
8711
'@vitest/utils@3.2.4':
8712
dependencies:
@@ -9200,7 +9187,7 @@ snapshots:
9187
9188
ee-first@1.1.1: {}
9189
9203
- effect-errors@1.10.11(ff5edfb43a1891ed491370151a2c33b9):
9190
+ effect-errors@1.10.11(belzt22ekwptqr7tzcbumfngca):
9191
dependencies:
9192
'@effect/cluster': 0.39.4(@effect/platform@0.84.11(effect@3.16.8))(@effect/rpc@0.62.4(@effect/platform@0.84.11(effect@3.16.8))(effect@3.16.8))(@effect/sql@0.38.2(@effect/experimental@0.49.2(@effect/platform@0.84.11(effect@3.16.8))(effect@3.16.8))(@effect/platform@0.84.11(effect@3.16.8))(effect@3.16.8))(@effect/workflow@0.2.4(@effect/platform@0.84.11(effect@3.16.8))(@effect/rpc@0.62.4(@effect/platform@0.84.11(effect@3.16.8))(effect@3.16.8))(effect@3.16.8))(effect@3.16.8)
9193
'@effect/platform': 0.84.11(effect@3.16.8)
@@ -9996,7 +9983,7 @@ snapshots:
9983
- openai
9984
- ws
9985
9999
- langsmith@0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.32)):
9986
+ langsmith@0.3.31(openai@5.5.1(zod@3.25.67)):
9987
dependencies:
9988
'@types/uuid': 10.0.0
9989
chalk: 4.1.2
@@ -10006,9 +9993,9 @@ snapshots:
9993
semver: 7.7.2
9994
uuid: 10.0.0
9995
optionalDependencies:
10009
- openai: 4.104.0(ws@8.18.2)(zod@3.25.32)
9996
+ openai: 5.5.1(ws@8.18.2)(zod@3.25.67)
9997
10011
- langsmith@0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.67)):
9998
+ langsmith@0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.32)):
9999
dependencies:
10000
'@types/uuid': 10.0.0
10001
chalk: 4.1.2
@@ -10018,9 +10005,9 @@ snapshots:
10005
semver: 7.7.2
10006
uuid: 10.0.0
10007
optionalDependencies:
10021
- openai: 4.104.0(ws@8.18.2)(zod@3.25.67)
10008
+ openai: 4.104.0(ws@8.18.2)(zod@3.25.32)
10009
10023
- langsmith@0.3.31(openai@5.3.0(ws@8.18.2)(zod@3.25.62)):
10010
+ langsmith@0.3.33(openai@4.104.0(ws@8.18.2)(zod@3.25.67)):
10011
dependencies:
10012
'@types/uuid': 10.0.0
10013
chalk: 4.1.2
@@ -10030,7 +10017,7 @@ snapshots:
10017
semver: 7.7.2
10018
uuid: 10.0.0
10019
optionalDependencies:
10033
- openai: 5.5.1(ws@8.18.2)(zod@3.25.67)
10020
+ openai: 4.104.0(ws@8.18.2)(zod@3.25.67)
10021
10022
levn@0.4.1:
10023
dependencies:
@@ -11438,13 +11425,13 @@ snapshots:
11425
vitest@3.2.4(@types/node@20.19.1)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0):
11426
dependencies:
11427
'@types/chai': 5.2.2
11441
- '@vitest/expect': 3.2.3
11442
- '@vitest/mocker': 3.2.3(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))
11443
- '@vitest/pretty-format': 3.2.3
11444
- '@vitest/runner': 3.2.3
11445
- '@vitest/snapshot': 3.2.3
11446
- '@vitest/spy': 3.2.3
11447
- '@vitest/utils': 3.2.3
11428
+ '@vitest/expect': 3.2.4
11429
+ '@vitest/mocker': 3.2.4(vite@6.3.5(@types/node@20.19.1)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0))
11430
+ '@vitest/pretty-format': 3.2.4
11431
+ '@vitest/runner': 3.2.4
11432
+ '@vitest/snapshot': 3.2.4
11433
+ '@vitest/spy': 3.2.4
11434
+ '@vitest/utils': 3.2.4
11435
chai: 5.2.0
11436
debug: 4.4.1
11437
expect-type: 1.2.1
@@ -11519,91 +11506,7 @@ snapshots:
11506
- tsx
11507
- yaml
11508
11522
- vitest@3.2.3(@types/node@24.0.3)(@vitest/ui@3.2.3)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0):
11523
- dependencies:
11524
- '@types/chai': 5.2.2
11525
- '@vitest/expect': 3.2.3
11526
- '@vitest/mocker': 3.2.3(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))
11527
- '@vitest/pretty-format': 3.2.3
11528
- '@vitest/runner': 3.2.3
11529
- '@vitest/snapshot': 3.2.3
11530
- '@vitest/spy': 3.2.3
11531
- '@vitest/utils': 3.2.3
11532
- chai: 5.2.0
11533
- debug: 4.4.1
11534
- expect-type: 1.2.1
11535
- magic-string: 0.30.17
11536
- pathe: 2.0.3
11537
- picomatch: 4.0.2
11538
- std-env: 3.9.0
11539
- tinybench: 2.9.0
11540
- tinyexec: 0.3.2
11541
- tinyglobby: 0.2.14
11542
- tinypool: 1.1.0
11543
- tinyrainbow: 2.0.0
11544
- vite: 6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
11545
- vite-node: 3.2.3(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0)
11546
- why-is-node-running: 2.3.0
11547
- optionalDependencies:
11548
- '@types/node': 24.0.3
11549
- '@vitest/ui': 3.2.3(vitest@3.2.3)
11550
- transitivePeerDependencies:
11551
- - jiti
11552
- - less
11553
- - lightningcss
11554
- - msw
11555
- - sass
11556
- - sass-embedded
11557
- - stylus
11558
- - sugarss
11559
- - supports-color
11560
- - terser
11561
- - tsx
11562
- - yaml
11563
-
11564
- vitest@3.2.3(@types/node@24.0.3)(@vitest/ui@3.2.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0):
11565
- dependencies:
11566
- '@types/chai': 5.2.2
11567
- '@vitest/expect': 3.2.3
11568
- '@vitest/mocker': 3.2.3(vite@6.3.5(@types/node@22.15.31)(jiti@1.21.7)(tsx@4.20.1)(yaml@2.8.0))
11569
- '@vitest/pretty-format': 3.2.3
11570
- '@vitest/runner': 3.2.3
11571
- '@vitest/snapshot': 3.2.3
11572
- '@vitest/spy': 3.2.3
11573
- '@vitest/utils': 3.2.3
11574
- chai: 5.2.0
11575
- debug: 4.4.1
11576
- expect-type: 1.2.1
11577
- magic-string: 0.30.17
11578
- pathe: 2.0.3
11579
- picomatch: 4.0.2
11580
- std-env: 3.9.0
11581
- tinybench: 2.9.0
11582
- tinyexec: 0.3.2
11583
- tinyglobby: 0.2.14
11584
- tinypool: 1.1.0
11585
- tinyrainbow: 2.0.0
11586
- vite: 6.3.5(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
11587
- vite-node: 3.2.3(@types/node@24.0.3)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0)
11588
- why-is-node-running: 2.3.0
11589
- optionalDependencies:
11590
- '@types/node': 24.0.3
11591
- '@vitest/ui': 3.2.3(vitest@3.2.3)
11592
- transitivePeerDependencies:
11593
- - jiti
11594
- - less
11595
- - lightningcss
11596
- - msw
11597
- - sass
11598
- - sass-embedded
11599
- - stylus
11600
- - sugarss
11601
- - supports-color
11602
- - terser
11603
- - tsx
11604
- - yaml
11605
-
11606
- vitest@3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.3(vitest@3.2.3))(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0):
11509
+ vitest@3.2.4(@types/node@24.0.3)(@vitest/ui@3.2.4)(jiti@1.21.7)(tsx@4.20.3)(yaml@2.8.0):
11510
dependencies:
11511
'@types/chai': 5.2.2
11512
'@vitest/expect': 3.2.4
uv.lock
+8
@@ -812,8 +812,12 @@ dependencies = [
812
[package.dev-dependencies]
813
dev = [
814
{ name = "composio" },
815
+ { name = "composio-gemini" },
816
{ name = "composio-langchain" },
817
+ { name = "composio-openai-agents" },
818
+ { name = "google-genai" },
819
{ name = "langchain" },
820
+ { name = "openai-agents" },
821
]
822
823
[package.metadata]
@@ -838,8 +842,12 @@ requires-dist = [
842
[package.metadata.requires-dev]
843
dev = [
844
{ name = "composio", editable = "python" },
845
+ { name = "composio-gemini", editable = "python/providers/gemini" },
846
{ name = "composio-langchain", editable = "python/providers/langchain" },
847
+ { name = "composio-openai-agents", editable = "python/providers/openai_agents" },
848
+ { name = "google-genai", specifier = ">=1.20.0" },
849
{ name = "langchain", specifier = ">=0.3.25" },
850
+ { name = "openai-agents", specifier = ">=0.0.19" },
851
]
852
853
[[package]]