-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
Description
The current Python SDK seems to rely on synchronous/blocking I/O operations. To properly integrate Composio into modern, high-performance asynchronous Python frameworks (like asyncio, FastAPI, or concurrent agent runners), a fully asynchronous SDK is required.
All I/O-bound methods, particularly those interacting with the API (e.g., composio.tools.get(), composio.connected_accounts.list()), should be implemented as async functions to prevent blocking the event loop.
Example of Desired Asynchronous Usage
The following example shows where we currently expect to use await for an API call to manage concurrency effectively:
import asyncio
from composio import Composio
async def main():
# Setup
composio = Composio()
user_id = "user@example.org"
# Composio calls need to be awaitable
tools = await composio.tools.get( # ← Async call desired here
user_id=user_id,
toolkits=["HACKERNEWS"]
)
print(tools)
if __name__ == "__main__":
asyncio.run(main())
This change would greatly improve the SDK's utility in modern concurrent applications.