langchain icon indicating copy to clipboard operation
langchain copied to clipboard

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

Open philipk19238 opened this issue 1 year ago • 4 comments

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

philipk19238 avatar Apr 29 '23 21:04 philipk19238

This restriction must have been added as agent might not behave appropriately if multi-input tools are provided. One of the maintainer might know.

pranjaldoshi96 avatar Apr 30 '23 10:04 pranjaldoshi96

The current agents scored poorly on internal tests when using multi-input tools. The Chat Agent is the closest to ready for it

vowelparrot avatar May 01 '23 21:05 vowelparrot

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.

philipk19238 avatar May 01 '23 21:05 philipk19238

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.

philipk19238 avatar May 02 '23 22:05 philipk19238

we added an agent that can use tools with multiple inputs - hope this helps!

hwchase17 avatar May 03 '23 22:05 hwchase17

we added an agent that can use tools with multiple inputs - hope this helps!

Which agent?

Celthi avatar May 05 '23 12:05 Celthi

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.

RatanPrakash avatar May 27 '23 06:05 RatanPrakash

@Celthi @RatanPrakash it's the structured chat agent

evantancy avatar Jun 11 '23 09:06 evantancy