mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-25 21:37:20 +00:00
fix(langchain_v1): only interrupt if at least one ToolConfig value is True (#33064)
**Description:** Right now, we interrupt even if the provided ToolConfig has all false values. We should ignore ToolConfigs which do not have at least one value marked as true (just as we would if tool_name: False was passed into the dict).
This commit is contained in:
@@ -138,7 +138,13 @@ class HumanInTheLoopMiddleware(AgentMiddleware):
|
||||
allow_edit=True,
|
||||
allow_respond=True,
|
||||
)
|
||||
else:
|
||||
elif any(
|
||||
[
|
||||
tool_config.get("allow_accept", False),
|
||||
tool_config.get("allow_edit", False),
|
||||
tool_config.get("allow_respond", False),
|
||||
]
|
||||
):
|
||||
resolved_tool_configs[tool_name] = tool_config
|
||||
self.tool_configs = resolved_tool_configs
|
||||
self.description_prefix = description_prefix
|
||||
|
Reference in New Issue
Block a user