langchain
langchain copied to clipboard
[Agent][Bug Fix][Enhancement] Making default implementation of _validate_tools less restrictive
Overview
The default implementation of _validate_tools
is too restrictive as it raises a ValueError when multi-input tools are passed in. This does not make sense as many agents rely on tools that require some sort of multi-input and there are many other issues referencing this problem.
The default implementation should be empty and Agent
children classes should explicitly define their own validator if they need it.
References
- https://github.com/hwchase17/langchain/issues/3781
- https://github.com/hwchase17/langchain/issues/3700
- https://github.com/hwchase17/langchain/issues/3757
This restriction must have been added as agent might not behave appropriately if multi-input tools are provided. One of the maintainer might know.
The current agents scored poorly on internal tests when using multi-input tools. The Chat Agent is the closest to ready for it
I'm not sure why they have to quality control single vs multi-input. This decision should be made by the developer and if there are any issues they can go and adjust the prompts that are passed in. I've overwritten this code in our in-house repo and our models work perfectly.
If there are issues with certain Agents (ZeroShot etc etc) then this restriction should be coded in method of the children class - not inherited in the base Agent class.
i think removing it from the base class makes sense, but we should also add it to all existing children classes
Are you suggesting to implement the check for multi input tools into existing children classes (vs inheritance)? I agree from a design standpoint but still doesn't solve the issue at hand as users still want to use multi input tools regardless of performance.
we added an agent that can use tools with multiple inputs - hope this helps!
we added an agent that can use tools with multiple inputs - hope this helps!
Which agent?
we added an agent that can use tools with multiple inputs - hope this helps!
Which Agent? kindly mention here. or just merge the PR to accept multi input tool as the current one is too restrictive.
@Celthi @RatanPrakash it's the structured chat agent