langchain/tests/unit_tests/chains
Tomaz Bratanic a0ea6f6b6b
Cypher search: Check if generated Cypher is provided in backticks (#5541)
# Check if generated Cypher code is wrapped in backticks

Some LLMs like the VertexAI like to explain how they generated the
Cypher statement and wrap the actual code in three backticks:

![Screenshot from 2023-06-01
08-08-23](https://github.com/hwchase17/langchain/assets/19948365/1d8eecb3-d26c-4882-8f5b-6a9bc7e93690)


I have observed a similar pattern with OpenAI chat models in a
conversational settings, where multiple user and assistant message are
provided to the LLM to generate Cypher statements, where then the LLM
wants to maybe apologize for previous steps or explain its thoughts.
Interestingly, both OpenAI and VertexAI wrap the code in three backticks
if they are doing any explaining or apologizing. Checking if the
generated cypher is wrapped in backticks seems like a low-hanging fruit
to expand the cypher search to other LLMs and conversational settings.
2023-06-05 12:48:13 -07:00
..
query_constructor handle single arg to and/or (#5637) 2023-06-03 15:18:46 -07:00
__init__.py
test_api.py requests wrapper (#2367) 2023-04-03 21:57:19 -07:00
test_base.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_combine_documents.py Factor out doc formatting and add validation (#3026) 2023-04-17 20:28:01 -07:00
test_constitutional_ai.py Added constitutional chain. (#1147) 2023-02-18 19:31:51 -08:00
test_conversation.py Add read only shared memory (#1491) 2023-03-12 09:34:36 -07:00
test_graph_qa.py Cypher search: Check if generated Cypher is provided in backticks (#5541) 2023-06-05 12:48:13 -07:00
test_hyde.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_llm_bash.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_llm_checker.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_llm_math.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_llm_summarization_checker.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_llm.py Harrison/guarded output parser (#1804) 2023-03-21 22:07:23 -07:00
test_memory.py Add read only shared memory (#1491) 2023-03-12 09:34:36 -07:00
test_natbot.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_sequential.py Callbacks Refactor [base] (#3256) 2023-04-30 11:14:09 -07:00
test_transform.py Add a Transformation Chain (#257) 2022-12-06 21:58:16 -08:00