rishisim commited on
Commit
199e5b0
·
verified ·
1 Parent(s): 537de10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -54,14 +54,14 @@ from langchain_core.runnables import RunnablePassthrough
54
 
55
  # Define the chat response function
56
  def chatresponse(message, history):
57
- history_langchain_format = []
58
- for human, ai in history:
59
- history_langchain_format.append(HumanMessage(content=human))
60
- history_langchain_format.append(AIMessage(content=ai))
61
- history_langchain_format.append(HumanMessage(content=message))
62
 
63
  rag_chain = (
64
- {"context": retriever, "history": history_langchain_format, "question": RunnablePassthrough()}
65
  | prompt
66
  | llm
67
  | StrOutputParser()
 
54
 
55
  # Define the chat response function
56
  def chatresponse(message, history):
57
+ # history_langchain_format = []
58
+ # for human, ai in history:
59
+ # history_langchain_format.append(HumanMessage(content=human))
60
+ # history_langchain_format.append(AIMessage(content=ai))
61
+ # history_langchain_format.append(HumanMessage(content=message))
62
 
63
  rag_chain = (
64
+ {"context": retriever, "history": history, "question": RunnablePassthrough()}
65
  | prompt
66
  | llm
67
  | StrOutputParser()