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, 17:00 UTC
vercel snippets updates
Sushmithamallesh committed
Dec 16, 2025 at 01:09 UTC
cf3c33009b23a1d40e968035fafffa37e990c590
3 files changed
+20
-5
fern/pages/src/tool-router/quickstart.mdx
+2
-2
@@ -158,7 +158,7 @@ Tool Router can be added as a single native tool to your agent. This provides a
158
<Steps>
159
<Step title="Install">
160
```bash title="TypeScript"
161
-npm install @composio/core @composio/vercel ai @ai-sdk/openai
161
+npm install @composio/core @composio/vercel ai @ai-sdk/anthropic
162
```
163
</Step>
164
@@ -167,7 +167,7 @@ Tool Router can be added as a single native tool to your agent. This provides a
167
168
<Info>
169
- Set your `COMPOSIO_API_KEY` environment variable with your API key from [Settings](https://platform.composio.dev/?next_page=/settings).
170
-- Set your `OPENAI_API_KEY` environment variable with your [OpenAI API key](https://platform.openai.com/api-keys).
170
+- Set your `ANTHROPIC_API_KEY` environment variable with your [Anthropic API key](https://console.anthropic.com/settings/keys).
171
- `userId` is your user's unique identifier. See [User Management](/docs/user-management) for details.
172
</Info>
173
fern/pages/src/tool-router/users-and-sessions.mdx
+14
@@ -165,6 +165,20 @@ console.log(mcp.url);
165
166
For framework examples, see [Using with MCP clients](/tool-router/using-with-mcp-clients) or [Using as a native tool](/tool-router/using-as-a-native-tool).
167
168
+### tools()
169
+
170
+Get native tools from the session for use with AI frameworks.
171
+
172
+<CodeGroup>
173
+```python Python
174
+tools = session.tools()
175
+```
176
+
177
+```typescript TypeScript
178
+const tools = await session.tools();
179
+```
180
+</CodeGroup>
181
+
182
### authorize()
183
184
Manually authenticate a user to a toolkit outside of the chat flow.
fern/snippets/tool-router/typescript/quickstart-native-vercel.ts
+4
-3
@@ -1,9 +1,9 @@
1
import "dotenv/config";
2
import { Composio } from "@composio/core";
3
import { VercelProvider } from "@composio/vercel";
4
-import { openai } from "@ai-sdk/openai";
5
-import { generateText } from "ai";
4
+import { generateText, stepCountIs } from "ai";
5
import { createInterface } from "readline/promises";
6
+import { anthropic } from "@ai-sdk/anthropic";
7
8
const composio = new Composio({
9
apiKey: process.env.COMPOSIO_API_KEY,
@@ -25,9 +25,10 @@ while (true) {
25
messages.push({ role: "user", content: userInput });
26
27
const result = await generateText({
28
- model: openai("gpt-4-turbo"),
28
+ model: anthropic("claude-sonnet-4-5") ,
29
messages: messages,
30
tools: tools,
31
+ stopWhen: stepCountIs(10),
32
});
33
34
messages.push({ role: "assistant", content: result.text });