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.

Add SDK version

Prateek71324d962a93
diff --git a/python/composio/client/__init__.py b/python/composio/client/__init__.py
index 1310a75e6..9037a23e7 100644
--- a/python/composio/client/__init__.py
+++ b/python/composio/client/__init__.py
@@ -5,6 +5,7 @@ This module is a light wrapper around the auto-generated composio client.
import contextvars
import typing as t
from uuid import uuid4
+from importlib.metadata import version
import typing_extensions as te
from composio_client import (
@@ -90,9 +91,13 @@ class HttpClient(BaseComposio, WithLogger):
def _prepare_request(self, request: Request) -> None:
"""
- Request interceptor to inject request id and provider.
+ Request interceptor to inject request id, provider, and SDK version.
"""
ctx = self.request_ctx.get()
request.headers["x-request-id"] = ctx.get("id") or uuid4().hex
request.headers["x-framework"] = ctx["provider"]
request.headers["x-source"] = 'python'
+ try:
+ request.headers["x-sdk-version"] = version("composio")
+ except Exception:
+ request.headers["x-sdk-version"] = "unknown"