Skip to content

Commit

Permalink
remove chat-history (#15286)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchase17 committed Dec 28, 2023
1 parent 90aa26a commit bc5a0ef
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion libs/langchain/langchain/chains/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
8 changes: 0 additions & 8 deletions libs/langchain/tests/unit_tests/chains/test_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down

0 comments on commit bc5a0ef

Please sign in to comment.