Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Agent][Bug Fix][Enhancement] Making default implementation of _validate_tools less restrictive #3803

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions langchain/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,13 @@ def create_prompt(cls, tools: Sequence[BaseTool]) -> BasePromptTemplate:

@classmethod
def _validate_tools(cls, tools: Sequence[BaseTool]) -> None:
"""Validate that appropriate tools are passed in."""
for tool in tools:
if not tool.is_single_input:
raise ValueError(
f"{cls.__name__} does not support multi-input tool {tool.name}."
)
"""
This class method is intended to be overridden in derived classes if necessary.
The default implementation does nothing and assumes that the provided tools are
valid.

Validate that appropriate tools are passed in.
"""

@classmethod
@abstractmethod
Expand Down