Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
60 |
-
|
61 |
-
history_langchain_format.append(HumanMessage(content=message))
|
62 |
|
63 |
rag_chain = (
|
64 |
-
{"context": retriever, "history":
|
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()
|