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(python): cast apply_modifier_by_type return for mypy assignment compat

Dhawal Upadhyay6f3e7e75d916
diff --git a/python/composio/core/models/tool_router_session.py b/python/composio/core/models/tool_router_session.py
index bfd626772..d2aceafd4 100644
--- a/python/composio/core/models/tool_router_session.py
+++ b/python/composio/core/models/tool_router_session.py
@@ -193,12 +193,15 @@ class ToolRouterSession(t.Generic[TTool, TToolCollection]):
from composio.core.models.tools import ToolExecutionResponse
type_after: t.Literal["after_execute"] = "after_execute"
- result = apply_modifier_by_type(
- modifiers=modifiers,
- toolkit="composio",
- tool=slug,
- type=type_after,
- response=t.cast(ToolExecutionResponse, result),
+ result = t.cast(
+ t.Dict[str, t.Any],
+ apply_modifier_by_type(
+ modifiers=modifiers,
+ toolkit="composio",
+ tool=slug,
+ type=type_after,
+ response=t.cast(ToolExecutionResponse, result),
+ ),
)
return result