remove chat-history (#15286)

pull/15287/head
Harrison Chase 6 months ago committed by GitHub
parent 90aa26a90e
commit bc5a0ef6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,6 @@ def create_retrieval_chain(
retrieval_chain = (
RunnablePassthrough.assign(
context=retrieval_docs.with_config(run_name="retrieve_documents"),
chat_history=lambda x: x.get("chat_history", []),
).assign(answer=combine_docs_chain)
).with_config(run_name="retrieval_chain")

@ -13,14 +13,6 @@ def test_create() -> None:
retriever = FakeParrotRetriever()
question_gen_prompt = PromptTemplate.from_template("hi! {input} {chat_history}")
chain = create_retrieval_chain(retriever, question_gen_prompt | llm)
expected_output = {
"answer": "I know the answer!",
"chat_history": [],
"context": [Document(page_content="What is the answer?")],
"input": "What is the answer?",
}
output = chain.invoke({"input": "What is the answer?"})
assert output == expected_output
expected_output = {
"answer": "I know the answer!",

Loading…
Cancel
Save