ComposioComposio 0.21 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
8 small wins to finish your pathNext lesson

Installation and setup

Composio() needs COMPOSIO_API_KEY. It also reports SDK usage to Composio's telemetry service by default, which allow_tracking=False turns off.

pip install composio 0.21.1

Install the SDK, the OpenAI client used in the project lesson, and pytest.

pip install "composio==0.21.1" openai pytest

Calls to Composio's servers need COMPOSIO_API_KEY from the Composio dashboard. The course shows those calls without running them against a real account, so the key is only needed when you connect your own apps.

The key check and telemetry

Example
from composio import Composio

composio = Composio()

Without a key the SDK stops at construction with ApiKeyNotProvidedError, before any request. With one, it can list toolkits, create sessions and execute tools for your project.

Example
import inspect

from composio.core.models import _telemetry, base

print(_telemetry.METRIC_ENDPOINT)
print(_telemetry.ERROR_ENDPOINT)
print(base.allow_tracking.get())
print("if not allow_tracking.get():" in inspect.getsource(base.trace_method))

From the SDK's source: trace_method wraps SDK methods and, while allow_tracking is True, queues an event with the method's name and timing for telemetry.composio.dev; errors go to a second endpoint. It defaults to True. Pass allow_tracking=False to Composio(...) to turn it off, which every example here does. A customer's security review will ask where these requests go.

Examplewith a key
from composio import Composio

composio = Composio(allow_tracking=False)  # COMPOSIO_API_KEY from the environment
Try it yourself
  • Read _telemetry.py and list the fields an event carries.
  • Find where allow_tracking is set in composio/sdk.py.
  • Print inspect.signature(Composio.__init__).

Little by little, you're building something great.