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.

style(python): format custom tool routing changes

Dhawal Upadhyay16fbcb92f5bc
diff --git a/python/composio/core/models/tool_router_session.py b/python/composio/core/models/tool_router_session.py
index 48fefca9c..9639a0510 100644
--- a/python/composio/core/models/tool_router_session.py
+++ b/python/composio/core/models/tool_router_session.py
@@ -328,7 +328,9 @@ class ToolRouterSession(t.Generic[TTool, TToolCollection]):
remote_data_raw = (remote_result or {}).get("data")
remote_data = remote_data_raw if isinstance(remote_data_raw, dict) else {}
remote_results_list = (
- remote_data.get("results", []) if isinstance(remote_data.get("results"), list) else []
+ remote_data.get("results", [])
+ if isinstance(remote_data.get("results"), list)
+ else []
)
all_results = [
{**entry, "index": i}
@@ -340,7 +342,9 @@ class ToolRouterSession(t.Generic[TTool, TToolCollection]):
if remote_result and remote_result.get("error") is not None
else None
)
- has_any_error = any(r.get("error") for _, r in local_results) or bool(remote_error)
+ has_any_error = any(r.get("error") for _, r in local_results) or bool(
+ remote_error
+ )
failed = sum(1 for r in all_results if r.get("error"))
error_message = None
if has_any_error:
diff --git a/python/tests/test_custom_tools.py b/python/tests/test_custom_tools.py
index 959b2ac10..f7a12cc16 100644
--- a/python/tests/test_custom_tools.py
+++ b/python/tests/test_custom_tools.py
@@ -573,10 +573,10 @@ class TestToolRouterSessionCustomTools:
assert result.log_id == "log_123"
def test_proxy_execute(self, mock_session_deps):
- mock_session_deps["client"].tool_router.session.proxy_execute.return_value = (
- SessionProxyExecuteResponse(
- status=200, data={"ok": True}, headers={}, binary_data=None
- )
+ mock_session_deps[
+ "client"
+ ].tool_router.session.proxy_execute.return_value = SessionProxyExecuteResponse(
+ status=200, data={"ok": True}, headers={}, binary_data=None
)
s = _session(mock_session_deps)
result = s.proxy_execute(