langchain/tests/unit_tests/agents
Swapnil Sharma dc4ffa8d9b
Incorrect argument count handling (#5543)
Throwing ToolException when incorrect arguments are passed to tools so
that that agent can course correct them.

# Incorrect argument count handling

I was facing an error where the agent passed incorrect arguments to
tools. As per the discussions going around, I started throwing
ToolException to allow the model to course correct.

## Before submitting

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on
network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests,
lint
etc:


https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

## Who can review?

Community members can review the PR once tests pass. Tag
maintainers/contributors who might be interested:

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @vowelparrot

  VectorStores / Retrievers / Memory
  - @dev2049

 -->

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-06-19 22:06:20 -07:00
..
__init__.py (WIP) agents (#171) 2022-11-22 06:16:26 -08:00
test_agent.py support kwargs (#5990) 2023-06-11 10:09:22 -07:00
test_mrkl.py Raise an exception in MKRL and Chat Output Parsers if parsing text which contains both an action and a final answer (#5609) 2023-06-04 14:40:49 -07:00
test_public_api.py Fix class promotion (#6187) 2023-06-18 16:55:18 -07:00
test_react.py support kwargs (#5990) 2023-06-11 10:09:22 -07:00
test_serialization.py Harrison/error zero tools (#6340) 2023-06-17 11:00:35 -07:00
test_sql.py Harrison/fix create sql agent (#2870) 2023-04-13 22:07:58 -07:00
test_tools.py Incorrect argument count handling (#5543) 2023-06-19 22:06:20 -07:00
test_types.py [annotation improvement] Make AgentType->Class Conversion More Scalable (#3749) 2023-04-28 21:17:28 -07:00