langchain/tests/unit_tests/agents
Deepak S V 5cd12102be
Improving Resilience of MRKL Agent (#5014)
This is a highly optimized update to the pull request
https://github.com/hwchase17/langchain/pull/3269

Summary:
1) Added ability to MRKL agent to self solve the ValueError(f"Could not
parse LLM output: `{llm_output}`") error, whenever llm (especially
gpt-3.5-turbo) does not follow the format of MRKL Agent, while returning
"Action:" & "Action Input:".
2) The way I am solving this error is by responding back to the llm with
the messages "Invalid Format: Missing 'Action:' after 'Thought:'" &
"Invalid Format: Missing 'Action Input:' after 'Action:'" whenever
Action: and Action Input: are not present in the llm output
respectively.

For a detailed explanation, look at the previous pull request.

New Updates:
1) Since @hwchase17 , requested in the previous PR to communicate the
self correction (error) message, using the OutputParserException, I have
added new ability to the OutputParserException class to store the
observation & previous llm_output in order to communicate it to the next
Agent's prompt. This is done, without breaking/modifying any of the
functionality OutputParserException previously performs (i.e.
OutputParserException can be used in the same way as before, without
passing any observation & previous llm_output too).

---------

Co-authored-by: Deepak S V <svdeepak99@users.noreply.github.com>
2023-05-22 11:08:08 -07:00
..
__init__.py (WIP) agents (#171) 2022-11-22 06:16:26 -08:00
test_agent.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_mrkl.py Improving Resilience of MRKL Agent (#5014) 2023-05-22 11:08:08 -07:00
test_public_api.py Add Spark SQL support (#4602) (#4956) 2023-05-18 20:53:08 -07:00
test_react.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_serialization.py agent serialization (#4642) 2023-05-13 21:47:10 -07:00
test_sql.py Harrison/fix create sql agent (#2870) 2023-04-13 22:07:58 -07:00
test_tools.py Pass Callbacks through load_tools (#4298) 2023-05-08 08:44:26 -07:00
test_types.py [annotation improvement] Make AgentType->Class Conversion More Scalable (#3749) 2023-04-28 21:17:28 -07:00