mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 14:43:07 +00:00
core[patch]: ToolException docs/exception message (#17590)
**Description:** This PR adds a slightly more helpful message to a Tool Exception ``` # current state langchain_core.tools.ToolException: Too many arguments to single-input tool # proposed state langchain_core.tools.ToolException: Too many arguments to single-input tool. Consider using a StructuredTool instead. ``` **Issue:** Somewhat discussed here 👉 #6197 **Dependencies:** None **Twitter handle:** N/A --------- Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
committed by
William Fu-Hinthorn
parent
33580cae7b
commit
cf4ca8d2f2
@@ -605,7 +605,8 @@ class Tool(BaseTool):
|
||||
all_args = list(args) + list(kwargs.values())
|
||||
if len(all_args) != 1:
|
||||
raise ToolException(
|
||||
f"Too many arguments to single-input tool {self.name}."
|
||||
f"""Too many arguments to single-input tool {self.name}.
|
||||
Consider using StructuredTool instead."""
|
||||
f" Args: {all_args}"
|
||||
)
|
||||
return tuple(all_args), {}
|
||||
|
||||
Reference in New Issue
Block a user