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.

Chore: Update python deps, update types and method signatures (#2135)

Musthaq Ahamad1ce11707a863
diff --git a/python/composio/core/models/connected_accounts.py b/python/composio/core/models/connected_accounts.py
index c8960d9ce..94fc75de1 100644
--- a/python/composio/core/models/connected_accounts.py
+++ b/python/composio/core/models/connected_accounts.py
@@ -328,6 +328,7 @@ class ConnectedAccounts:
self.list = self._client.connected_accounts.list
self.delete = self._client.connected_accounts.delete
self.update_status = self._client.connected_accounts.update_status
+ self.refresh = self._client.connected_accounts.refresh
self.enable = functools.partial(
self._client.connected_accounts.update_status,
enabled=True,
diff --git a/python/composio/core/models/custom_tools.py b/python/composio/core/models/custom_tools.py
index 5dc7618e7..6149720e5 100644
--- a/python/composio/core/models/custom_tools.py
+++ b/python/composio/core/models/custom_tools.py
@@ -103,6 +103,7 @@ class CustomTool:
toolkit=tool_list_response.ItemDeprecatedToolkit(logo=str()),
is_deprecated=False,
),
+ is_deprecated=False,
no_auth=False,
tags=[],
)
diff --git a/python/composio/core/models/mcp.py b/python/composio/core/models/mcp.py
index bd03dc9ba..2e4f17050 100644
--- a/python/composio/core/models/mcp.py
+++ b/python/composio/core/models/mcp.py
@@ -126,11 +126,11 @@ class MCP(Resource):
... toolkits=[
... {
... 'toolkit': 'github',
- ... 'auth_config': 'ac_xyz',
+ ... 'auth_config_id': 'ac_xyz',
... },
... {
... 'toolkit': 'slack',
- ... 'auth_config': 'ac_abc',
+ ... 'auth_config_id': 'ac_abc',
... },
... ],
... allowed_tools=['GITHUB_CREATE_ISSUE', 'GITHUB_LIST_REPOS', 'SLACK_SEND_MESSAGE'],
@@ -183,10 +183,10 @@ class MCP(Resource):
toolkit_names.append(toolkit_config["toolkit"])
if (
- "auth_config" in toolkit_config
- and toolkit_config["auth_config"] not in auth_config_ids
+ "auth_config_id" in toolkit_config
+ and toolkit_config["auth_config_id"] not in auth_config_ids
):
- auth_config_ids.append(toolkit_config["auth_config"])
+ auth_config_ids.append(toolkit_config["auth_config_id"])
# Use the allowed_tools parameter instead of individual toolkit configs
custom_tools = none_to_omit(allowed_tools)
@@ -323,8 +323,8 @@ class MCP(Resource):
>>> server_with_auth = composio.experimental.mcp.update(
... 'mcp_12345',
... toolkits=[
- ... {'toolkit': 'github', 'auth_config': 'auth_abc123'},
- ... {'toolkit': 'slack', 'auth_config': 'auth_def456'}
+ ... {'toolkit': 'github', 'auth_config_id': 'auth_abc123'},
+ ... {'toolkit': 'slack', 'auth_config_id': 'auth_def456'}
... ],
... allowed_tools=['GITHUB_CREATE_ISSUE', 'SLACK_SEND_MESSAGE'],
... manually_manage_connections=False
@@ -361,10 +361,10 @@ class MCP(Resource):
toolkit_names.append(toolkit_config["toolkit"])
if (
- "auth_config" in toolkit_config
- and toolkit_config["auth_config"] not in auth_config_ids
+ "auth_config_id" in toolkit_config
+ and toolkit_config["auth_config_id"] not in auth_config_ids
):
- auth_config_ids.append(toolkit_config["auth_config"])
+ auth_config_ids.append(toolkit_config["auth_config_id"])
update_params["toolkits"] = toolkit_names
update_params["auth_config_ids"] = auth_config_ids
diff --git a/python/composio/core/models/triggers.py b/python/composio/core/models/triggers.py
index 0b8fdb4c3..413fbc842 100644
--- a/python/composio/core/models/triggers.py
+++ b/python/composio/core/models/triggers.py
@@ -20,8 +20,10 @@ from composio.client import HttpClient
from composio.client.types import trigger_instance_upsert_response
from composio.core.models.base import Resource
from composio.core.models.internal import Internal
+from composio.core.types import ToolkitVersionParam
from composio.exceptions import ComposioSDKTimeoutError
from composio.utils.logging import WithLogger
+from composio.utils.pydantic import none_to_omit
PUSHER_AUTH_URL = "{base_url}/api/v3/internal/sdk/realtime/auth?source=python"
@@ -629,16 +631,21 @@ class Triggers(Resource):
disable: t.Callable
"""Disables a trigger given its id"""
- def __init__(self, client: HttpClient):
+ def __init__(
+ self,
+ client: HttpClient,
+ toolkit_versions: t.Optional[ToolkitVersionParam] = None,
+ ):
"""
Initialize the triggers resource.
:param client: The client to use for the triggers resource.
+ :param toolkit_versions: The versions of the toolkits to use. Defaults to 'latest' if not provided.
"""
self._client = client
+ self._toolkit_versions = toolkit_versions
self.list_enum = self._client.triggers_types.retrieve_enum
self.get_type = self._client.triggers_types.retrieve
- self.list = self._client.triggers_types.list
self.delete = self._client.trigger_instances.manage.delete
self.enable = functools.partial(
self._client.trigger_instances.manage.update,
@@ -681,6 +688,28 @@ class Triggers(Resource):
page=page if page is not None else omit,
)
+ def list(
+ self,
+ *,
+ cursor: t.Optional[str] = None,
+ limit: t.Optional[int] = None,
+ toolkit_slugs: t.Optional[list[str]] = None,
+ ):
+ """
+ List all the trigger types.
+
+ :param cursor: The cursor for pagination
+ :param limit: The maximum number of trigger types to return
+ :param toolkit_slugs: Filter by toolkit slugs
+ :return: The list of trigger types
+ """
+ return self._client.triggers_types.list(
+ cursor=none_to_omit(cursor),
+ limit=none_to_omit(limit),
+ toolkit_slugs=none_to_omit(toolkit_slugs),
+ toolkit_versions=none_to_omit(self._toolkit_versions),
+ )
+
@t.overload
def create(
self,
diff --git a/python/composio/sdk.py b/python/composio/sdk.py
index dd8ac9072..079b5d3fd 100644
--- a/python/composio/sdk.py
+++ b/python/composio/sdk.py
@@ -101,7 +101,7 @@ class Composio(t.Generic[TProvider], WithLogger):
toolkit_versions=toolkit_versions,
)
self.toolkits = Toolkits(client=self._client)
- self.triggers = Triggers(client=self._client)
+ self.triggers = Triggers(client=self._client, toolkit_versions=toolkit_versions)
self.auth_configs = AuthConfigs(client=self._client)
self.connected_accounts = ConnectedAccounts(client=self._client)
self.mcp = MCP(client=self._client)
diff --git a/python/pyproject.toml b/python/pyproject.toml
index 77162482b..0f4313b8f 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -7,7 +7,7 @@ requires-python = ">=3.10,<4"
dependencies = [
"pysher>=1.0.8",
"pydantic>=2.6.4",
- "composio-client>=1.10.0",
+ "composio-client>=1.11.0",
"typing-extensions>=4.0.0",
"openai",
]
diff --git a/python/tests/test_tool_execution.py b/python/tests/test_tool_execution.py
index 1e539837d..3408cc9a1 100644
--- a/python/tests/test_tool_execution.py
+++ b/python/tests/test_tool_execution.py
@@ -42,6 +42,7 @@ class TestToolExecution:
toolkit=tool_list_response.ItemDeprecatedToolkit(logo=""),
is_deprecated=False,
),
+ is_deprecated=False,
no_auth=False,
tags=[],
)
diff --git a/ts/packages/core/src/types/connectedAccounts.types.ts b/ts/packages/core/src/types/connectedAccounts.types.ts
index ed5a31a92..0bada3fe5 100644
--- a/ts/packages/core/src/types/connectedAccounts.types.ts
+++ b/ts/packages/core/src/types/connectedAccounts.types.ts
@@ -73,7 +73,13 @@ export type ConnectedAccountAuthConfig = z.infer<typeof ConnectedAccountAuthConf
export const ConnectedAccountRetrieveResponseSchema = z.object({
id: z.string(),
authConfig: ConnectedAccountAuthConfigSchema,
+ /**
+ * @deprecated use connectedAccount.state instead
+ */
data: z.record(z.string(), z.unknown()).optional(),
+ /**
+ * @deprecated use connectedAccount.state instead
+ */
params: z.record(z.string(), z.unknown()).optional(),
status: ConnectedAccountStatusSchema,
statusReason: z.string().nullable(),
diff --git a/uv.lock b/uv.lock
index ab481abc0..7b085a501 100644
--- a/uv.lock
+++ b/uv.lock
@@ -468,7 +468,7 @@ wheels = [
[[package]]
name = "composio"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python" }
dependencies = [
{ name = "composio-client" },
@@ -494,7 +494,7 @@ dev = [
[package.metadata]
requires-dist = [
- { name = "composio-client", specifier = ">=1.10.0" },
+ { name = "composio-client", specifier = ">=1.11.0" },
{ name = "openai" },
{ name = "pydantic", specifier = ">=2.6.4" },
{ name = "pysher", specifier = ">=1.0.8" },
@@ -517,7 +517,7 @@ dev = [
[[package]]
name = "composio-anthropic"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/anthropic" }
dependencies = [
{ name = "anthropic" },
@@ -532,7 +532,7 @@ requires-dist = [
[[package]]
name = "composio-client"
-version = "1.10.0"
+version = "1.11.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -542,14 +542,14 @@ dependencies = [
{ name = "sniffio" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/63/a7/edcc211529d312769e7e3d0fb01487878b327df4d07f6ea29a0270b5a88c/composio_client-1.10.0.tar.gz", hash = "sha256:99778a550248ab3ff30b4d3bd18b8c2679ea4113d524a3d6261dd78ec925635f", size = 165864 }
+sdist = { url = "https://files.pythonhosted.org/packages/f7/00/743270d00550134968c6189ea18d66655c7685970876321bc99e8ebcaaad/composio_client-1.11.0.tar.gz", hash = "sha256:1da2e817f24b6d51ae99ab8f54e2d2aa7286e9af811b21886241998589f3e533", size = 169798 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/c5/2f/a645beceb4d1f3d6aefcc661edbf63692f9567b8d540ee693b5dbb395f0c/composio_client-1.10.0-py3-none-any.whl", hash = "sha256:60301b004d13d79366e82102d73dfa55daf27770f7f8afcc34d129ec43556a8a", size = 176675 },
+ { url = "https://files.pythonhosted.org/packages/d3/11/d25cf9981d6b0697f4e7ad2e467563960ad84be31b3b034ca7d85cb2f470/composio_client-1.11.0-py3-none-any.whl", hash = "sha256:0491a008394d1e36d936d3b8d75341a35334629b23394fa13ef2adda08ae203c", size = 179628 },
]
[[package]]
name = "composio-crewai"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/crewai" }
dependencies = [
{ name = "composio" },
@@ -564,7 +564,7 @@ requires-dist = [
[[package]]
name = "composio-gemini"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/gemini" }
dependencies = [
{ name = "composio" },
@@ -579,7 +579,7 @@ requires-dist = [
[[package]]
name = "composio-google"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/google" }
dependencies = [
{ name = "composio" },
@@ -594,7 +594,7 @@ requires-dist = [
[[package]]
name = "composio-google-adk"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/google_adk" }
dependencies = [
{ name = "composio" },
@@ -609,7 +609,7 @@ requires-dist = [
[[package]]
name = "composio-langchain"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/langchain" }
dependencies = [
{ name = "composio" },
@@ -624,7 +624,7 @@ requires-dist = [
[[package]]
name = "composio-openai"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/openai" }
dependencies = [
{ name = "composio" },
@@ -639,7 +639,7 @@ requires-dist = [
[[package]]
name = "composio-openai-agents"
-version = "0.8.19"
+version = "0.9.0"
source = { virtual = "python/providers/openai_agents" }
dependencies = [
{ name = "composio" },