Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -689,12 +689,12 @@ class NutritionBot:
|
|
689 |
|
690 |
# Build a context string from the relevant history
|
691 |
context = "Previous relevant interactions:\n"
|
692 |
-
for memory in relevant_history:
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
|
697 |
-
context += f"""{context}"""
|
698 |
st.write("Got context...")
|
699 |
|
700 |
# Print context for debugging purposes
|
@@ -716,7 +716,7 @@ class NutritionBot:
|
|
716 |
print(f"Prepare for invoke...{context}")
|
717 |
|
718 |
# Generate a response using the agent
|
719 |
-
response = self.agent_executor.invoke({"input": context})
|
720 |
st.write("Got response...")
|
721 |
|
722 |
# Store the current interaction for future reference
|
|
|
689 |
|
690 |
# Build a context string from the relevant history
|
691 |
context = "Previous relevant interactions:\n"
|
692 |
+
#for memory in relevant_history:
|
693 |
+
# context += f"Customer: {memory['memory']}\n" # Customer's past messages
|
694 |
+
# context += f"Support: {memory['memory']}\n" # Chatbot's past responses
|
695 |
+
# context += "---\n"
|
696 |
|
697 |
+
#context += f"""{context}"""
|
698 |
st.write("Got context...")
|
699 |
|
700 |
# Print context for debugging purposes
|
|
|
716 |
print(f"Prepare for invoke...{context}")
|
717 |
|
718 |
# Generate a response using the agent
|
719 |
+
response = self.agent_executor.invoke({"input": query + ";" + context})
|
720 |
st.write("Got response...")
|
721 |
|
722 |
# Store the current interaction for future reference
|