test_fixed_message_response_when_no_docs_found() — langchain Function Reference
Architecture documentation for the test_fixed_message_response_when_no_docs_found() function in test_conversation_retrieval.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD e3acc352_116b_1019_fb9c_80984223d8a2["test_fixed_message_response_when_no_docs_found()"] 995a7073_bf4f_3e52_1d5f_85841e01cccc["test_conversation_retrieval.py"] e3acc352_116b_1019_fb9c_80984223d8a2 -->|defined in| 995a7073_bf4f_3e52_1d5f_85841e01cccc style e3acc352_116b_1019_fb9c_80984223d8a2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/chains/test_conversation_retrieval.py lines 65–87
def test_fixed_message_response_when_no_docs_found() -> None:
fixed_resp = "I don't know"
answer = "I know the answer!"
llm = FakeListLLM(responses=[answer])
retriever = SequentialRetriever(sequential_responses=[[]])
memory = ConversationBufferMemory(
k=1,
output_key="answer",
memory_key="chat_history",
return_messages=True,
)
qa_chain = ConversationalRetrievalChain.from_llm(
llm=llm,
memory=memory,
retriever=retriever,
return_source_documents=True,
rephrase_question=False,
response_if_no_docs_found=fixed_resp,
verbose=True,
)
got = qa_chain("What is the answer?")
assert got["chat_history"][1].content == fixed_resp
assert got["answer"] == fixed_resp
Domain
Subdomains
Source
Frequently Asked Questions
What does test_fixed_message_response_when_no_docs_found() do?
test_fixed_message_response_when_no_docs_found() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/chains/test_conversation_retrieval.py.
Where is test_fixed_message_response_when_no_docs_found() defined?
test_fixed_message_response_when_no_docs_found() is defined in libs/langchain/tests/unit_tests/chains/test_conversation_retrieval.py at line 65.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free