langchain/tests/unit_tests
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
..
agents Improving Resilience of MRKL Agent (#5014) 2023-05-22 11:08:08 -07:00
callbacks [Breaking] Refactor Base Tracer(#4549) 2023-05-13 17:23:56 +00:00
chains Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
chat_models Add ChatModel, LLM, and Embeddings for Google's PaLM APIs (#3575) 2023-05-01 15:23:16 -07:00
client Separate Runner Functions from Client (#5079) 2023-05-22 05:28:47 +00:00
data
docstore Add DocstoreFn - lookup doc via arbitrary function (#3760) 2023-04-28 19:50:32 -07:00
document_loaders Harrison/psychic (#5063) 2023-05-21 09:13:20 -07:00
evaluation Adding an in-context QA evaluation chain + chain of thought reasoning chain for improved accuracy (#2444) 2023-04-06 22:32:41 -07:00
examples feat #4479: TextLoader auto detect encoding and improved exceptions (#4927) 2023-05-18 09:55:14 -04:00
llms Add Invocation Params (#4509) 2023-05-11 15:34:06 -07:00
memory Zep memory (#4898) 2023-05-17 20:01:01 -07:00
output_parsers Harrison/json new line (#4646) 2023-05-13 21:46:33 -07:00
prompts fix prompt saving (#4987) 2023-05-20 08:21:52 -07:00
retrievers Zep Retriever - Vector Search Over Chat History (#4533) 2023-05-18 16:27:18 -07:00
tools Improved query, print & exception handling in REPL Tool (#4997) 2023-05-22 13:43:44 +00:00
utilities Fix graphql tool (#4984) 2023-05-19 15:27:50 -07:00
vectorstores fix #3884 (#3475) 2023-04-24 19:54:15 -07:00
__init__.py
conftest.py Add pytest --only-extended and --only-core options (#4494) 2023-05-12 11:35:22 -04:00
test_bash.py Skip flaky unit test (#4591) 2023-05-12 11:54:40 -07:00
test_depedencies.py Catch changes to test group (#4802) 2023-05-16 14:48:56 -04:00
test_document_transformers.py Contextual compression retriever (#2915) 2023-04-20 17:01:14 -07:00
test_formatting.py
test_math_utils.py Contextual compression retriever (#2915) 2023-04-20 17:01:14 -07:00
test_pytest_config.py Block sockets for unit-tests (#4803) 2023-05-16 14:41:24 -04:00
test_python.py option for csv agent to not include df in prompt (#4610) 2023-05-12 21:55:22 -07:00
test_schema.py [simple][test] Added test case for schema.py (#3692) 2023-04-28 20:42:24 -07:00
test_sql_database_schema.py Suppress duckdb warning in unit tests explicitly (#3653) 2023-04-27 14:29:41 -04:00
test_sql_database.py
test_text_splitter.py Add unit test for _merge_splits function (#3513) 2023-04-25 10:02:59 -07:00