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.

Fix formatting

haxzied7e13036c0de
diff --git a/python/composio/core/models/tools.py b/python/composio/core/models/tools.py
index e8ee9a580..5ad44c6c4 100644
--- a/python/composio/core/models/tools.py
+++ b/python/composio/core/models/tools.py
@@ -102,7 +102,8 @@ class Tools(Resource, t.Generic[TProvider]):
return t.cast(
Tool,
self._client.tools.retrieve(
- tool_slug=slug, toolkit_versions=none_to_omit(self._toolkit_versions)
+ tool_slug=slug,
+ toolkit_versions=none_to_omit(self._toolkit_versions),
),
)
@@ -414,7 +415,8 @@ class Tools(Resource, t.Generic[TProvider]):
tool = t.cast(
Tool,
self._client.tools.retrieve(
- tool_slug=slug, toolkit_versions=none_to_omit(effective_toolkit_versions)
+ tool_slug=slug,
+ toolkit_versions=none_to_omit(effective_toolkit_versions),
),
)
self._tool_schemas[slug] = tool
@@ -488,13 +490,9 @@ class Tools(Resource, t.Generic[TProvider]):
endpoint=options["endpoint"],
method=options["method"],
body=options.get("body", omit),
- connected_account_id=options.get(
- "connected_account_id", omit
- ),
+ connected_account_id=options.get("connected_account_id", omit),
parameters=options.get("parameters", omit),
- custom_connection_data=options.get(
- "custom_connection_data", omit
- ),
+ custom_connection_data=options.get("custom_connection_data", omit),
)
diff --git a/python/composio/utils/pydantic.py b/python/composio/utils/pydantic.py
index 8462e7532..8b3565620 100644
--- a/python/composio/utils/pydantic.py
+++ b/python/composio/utils/pydantic.py
@@ -6,16 +6,16 @@ from composio_client import omit
def none_to_omit(value: t.Optional[t.Any]) -> t.Any:
"""Convert None to omit for composio_client API calls.
-
+
This utility function helps convert Python's None values to composio_client's
omit sentinel value, which tells the API to exclude the parameter entirely.
-
+
Args:
value: Any value that might be None
-
+
Returns:
The original value if not None, otherwise omit
-
+
Example:
>>> none_to_omit("hello")
"hello"