@devries-cameron20 / composio Mirror · read-only / commits / 9eab6b64b
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 18:15 UTC

Provider: Anthropic fixes (#2194)

Sushmitha Mallesh committed Nov 22, 2025 at 22:50 UTC 9eab6b64b0a5fbb5b13a63aff580a53d8a8f8cc1
1 file changed +12 -11
fern/pages/src/providers/anthropic.mdx
+12 -11
@@ -15,7 +15,7 @@ The Anthropic provider can be installed for both SDKs.
15
16 <CodeGroup>
17 ```bash title="Python" for="python" maxLines=60 wordWrap
18 -pip install composio_anthropic==0.8.0
18 +pip install composio composio-anthropic
19 ```
20
21 ```bash title="TypeScript" for="typescript" maxLines=60 wordWrap
@@ -40,6 +40,7 @@ composio = Composio(provider=AnthropicProvider())
40 ```typescript TypeScript maxLines=60 wordWrap {5}
41 import { Composio } from "@composio/core";
42 import { AnthropicProvider } from "@composio/anthropic";
43 +import Anthropic from '@anthropic-ai/sdk';
44
45 const composio = new Composio({
46 provider: new AnthropicProvider({
@@ -56,18 +57,18 @@ const anthropic = new Anthropic();
57 <CodeGroup>
58 ```python Python maxLines=60 wordWrap
59 # Define your user ID
59 -user_id = "default"
60 +user_id = "your-user-id"
61
61 -# Get GitHub tools that are pre-configured
62 -tools = composio.tools.get(user_id=user_id, toolkits=["GITHUB"])
62 +# Get GitHub tool for listing stargazers
63 +tools = composio.tools.get(user_id=user_id, tools=["GITHUB_LIST_STARGAZERS"])
64
65 # Get response from the LLM
66 response = anthropic_client.messages.create(
66 - model="claude-3-5-sonnet-20240620",
67 + model="claude-sonnet-4-5",
68 max_tokens=1024,
69 tools=tools,
70 messages=[
70 - {"role": "user", "content": "Star me composiohq/composio repo in github."},
71 + {"role": "user", "content": "List my github stargazers. for the repo composiohq/composio"},
72 ],
73 )
74
@@ -77,17 +78,17 @@ print(result)
78 ```
79
80 ```typescript TypeScript maxLines=60 wordWrap
80 -const userId = "user@acme.com";
81 +const userId = "your-user-id";
82 const tools = await composio.tools.get(userId, {
82 - tools: ["GITHUB_GET_OCTOCAT", "GITHUB_GET_THE_ZEN_OF_GITHUB"]
83 + tools: ["GITHUB_LIST_STARGAZERS"]
84 })
85
86 const msg = await anthropic.messages.create({
86 - model: "claude-3-5-sonnet-20240620",
87 + model: "claude-sonnet-4-5",
88 messages: [
89 {
90 role: "user",
90 - content: "Get me the GitHub Octocat",
91 + content: "List my github stargazers. for the repo composiohq/composio",
92 },
93 ],
94 tools: tools,
@@ -96,7 +97,7 @@ const msg = await anthropic.messages.create({
97
98 const res = await composio.provider.handleToolCalls(userId, msg);
99
99 -console.log(JSON.parse(res[0]).details);
100 +console.log(res[0].content);
101 ```
102 </CodeGroup>
103