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
fix: initiate connection payload formation
angrybayblade committed
Jun 20, 2025 at 14:20 UTC
0f93cc656de7d2f0f9939bf30afa113e4e3ea890
1 file changed
+8
-8
python/composio/core/models/connected_accounts.py
+8
-8
@@ -340,16 +340,16 @@ class ConnectedAccounts:
340
:param options: The options to create the connected account with.
341
:return: The connection request.
342
"""
343
+ connection: dict[str, t.Any] = {"user_id": user_id}
344
+ if callback_url is not None:
345
+ connection["callback_url"] = connection
346
+
347
+ if config is not None:
348
+ connection["state"] = connection
349
+
350
response = self._client.connected_accounts.create(
351
auth_config={"id": auth_config_id},
345
- connection=t.cast(
346
- connected_account_create_params.Connection,
347
- {
348
- "user_id": user_id,
349
- "state": config,
350
- "callback_url": callback_url,
351
- },
352
- ),
352
+ connection=t.cast(connected_account_create_params.Connection, connection),
353
)
354
return ConnectionRequest(
355
id=response.id,