mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-15 17:33:53 +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:
parent
5b1f9c6d3a
commit
9c08cdea92
@ -563,7 +563,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), {}
|
||||
|
Loading…
Reference in New Issue
Block a user