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.

in chat fixes

Sushmithamalleshdecfe900a75e
diff --git a/fern/pages/src/tool-router/using-in-chat-authentication.mdx b/fern/pages/src/tool-router/using-in-chat-authentication.mdx
index ef6259ff5..68f33edc1 100644
--- a/fern/pages/src/tool-router/using-in-chat-authentication.mdx
+++ b/fern/pages/src/tool-router/using-in-chat-authentication.mdx
@@ -19,35 +19,30 @@ By just creating a session with default configs, you are enabling in-chat auth.
<CodeGroup>
```python
-session = await composio.create(
- user="user_123",
- manage_connections=True, # default
-)
+session = composio.create(user_id="user_123")
```
```typescript
-const session = await composio.create("user_123", {
- manageConnections: true, // default
-});
+const session = await composio.create("user_123");
```
</CodeGroup>
### Custom callback URL
-Redirect users to a specific page after authentication:
+Redirect users back to your chat page after they complete authentication:
<CodeGroup>
```python
-session = await composio.create(
- user="user_123",
+session = composio.create(
+ user_id="user_123",
manage_connections={
"callback_url": "https://yourapp.com/chat"
},
)
```
```typescript
-const { mcp } = await composio.create("user_123", {
+const session = await composio.create("user_123", {
manageConnections: {
- callbackUrl: "https://yourapp.com/chat",
+ callbackUri: "https://yourapp.com/chat",
},
});
```
@@ -65,4 +60,13 @@ What this looks like when you run the code:
```
Assistant: What would you like me to do today?
-> Star the composio repo on GitHub
\ No newline at end of file
+> Star the composio repo on GitHub
+Assistant: I need you to connect your GitHub account first.
+Please click here to authorize: https://connect.composio.dev/link/ln_abc123
+
+> Done
+
+Assistant: Done! I've starred ComposioHQ/composio.
+```
+
+To manage authentication outside of chat, see [Manually authenticating users](/tool-router/manually-authenticating-users).
diff --git a/fern/snippets/tool-router/python/in-chat-auth.py b/fern/snippets/tool-router/python/in-chat-auth.py
index 082fe416e..8f6868403 100644
--- a/fern/snippets/tool-router/python/in-chat-auth.py
+++ b/fern/snippets/tool-router/python/in-chat-auth.py
@@ -5,7 +5,7 @@ from agents import Agent, Runner, HostedMCPTool, ModelSettings
composio_api_key = os.environ.get("COMPOSIO_API_KEY")
user_id = "user_123" # Your user's unique identifier
-composio = Composio()
+composio = Composio(api_key=composio_api_key)
session = composio.create(user_id=user_id)
agent = Agent(
diff --git a/fern/snippets/tool-router/python/quickstart-openai.py b/fern/snippets/tool-router/python/quickstart-openai.py
index 082fe416e..8f6868403 100644
--- a/fern/snippets/tool-router/python/quickstart-openai.py
+++ b/fern/snippets/tool-router/python/quickstart-openai.py
@@ -5,7 +5,7 @@ from agents import Agent, Runner, HostedMCPTool, ModelSettings
composio_api_key = os.environ.get("COMPOSIO_API_KEY")
user_id = "user_123" # Your user's unique identifier
-composio = Composio()
+composio = Composio(api_key=composio_api_key)
session = composio.create(user_id=user_id)
agent = Agent(