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
haxzie committed
Oct 1, 2025 at 17:01 UTC
d7e13036c0de82e5b1cf2d9edece585d9b80d3cb
2 files changed
+10
-12
python/composio/core/models/tools.py
+6
-8
@@ -102,7 +102,8 @@ class Tools(Resource, t.Generic[TProvider]):
102
return t.cast(
103
Tool,
104
self._client.tools.retrieve(
105
- tool_slug=slug, toolkit_versions=none_to_omit(self._toolkit_versions)
105
+ tool_slug=slug,
106
+ toolkit_versions=none_to_omit(self._toolkit_versions),
107
),
108
)
109
@@ -414,7 +415,8 @@ class Tools(Resource, t.Generic[TProvider]):
415
tool = t.cast(
416
Tool,
417
self._client.tools.retrieve(
417
- tool_slug=slug, toolkit_versions=none_to_omit(effective_toolkit_versions)
418
+ tool_slug=slug,
419
+ toolkit_versions=none_to_omit(effective_toolkit_versions),
420
),
421
)
422
self._tool_schemas[slug] = tool
@@ -488,13 +490,9 @@ class Tools(Resource, t.Generic[TProvider]):
490
endpoint=options["endpoint"],
491
method=options["method"],
492
body=options.get("body", omit),
491
- connected_account_id=options.get(
492
- "connected_account_id", omit
493
- ),
493
+ connected_account_id=options.get("connected_account_id", omit),
494
parameters=options.get("parameters", omit),
495
- custom_connection_data=options.get(
496
- "custom_connection_data", omit
497
- ),
495
+ custom_connection_data=options.get("custom_connection_data", omit),
496
)
497
498
python/composio/utils/pydantic.py
+4
-4
@@ -6,16 +6,16 @@ from composio_client import omit
6
7
def none_to_omit(value: t.Optional[t.Any]) -> t.Any:
8
"""Convert None to omit for composio_client API calls.
9
-
9
+
10
This utility function helps convert Python's None values to composio_client's
11
omit sentinel value, which tells the API to exclude the parameter entirely.
12
-
12
+
13
Args:
14
value: Any value that might be None
15
-
15
+
16
Returns:
17
The original value if not None, otherwise omit
18
-
18
+
19
Example:
20
>>> none_to_omit("hello")
21
"hello"