jenngang commited on
Commit
fafe047
·
verified ·
1 Parent(s): 4c7b019

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -688,13 +688,13 @@ class NutritionBot:
688
 
689
  # Build a context string from the relevant history
690
  context = "Previous relevant interactions:\n"
691
- #for memory in relevant_history:
692
- # context += f"Customer: {memory['memory']}\n" # Customer's past messages
693
- # context += f"Support: {memory['memory']}\n" # Chatbot's past responses
694
- # context += "---\n"
695
 
696
  # Print context for debugging purposes
697
- #st.write("Context: ", context)
698
 
699
  # Prepare a prompt combining past context and the current query
700
  prompt = f"""
@@ -702,6 +702,7 @@ class NutritionBot:
702
  Current customer query: {query}
703
  Provide a helpful response that takes into account any relevant past interactions.
704
  """
 
705
 
706
  # Generate a response using the agent
707
  response = self.agent_executor.invoke({"input": prompt})
 
688
 
689
  # Build a context string from the relevant history
690
  context = "Previous relevant interactions:\n"
691
+ for memory in relevant_history:
692
+ context += f"Customer: {memory['memory']}\n" # Customer's past messages
693
+ context += f"Support: {memory['memory']}\n" # Chatbot's past responses
694
+ context += "---\n"
695
 
696
  # Print context for debugging purposes
697
+ st.write("Context: ", context)
698
 
699
  # Prepare a prompt combining past context and the current query
700
  prompt = f"""
 
702
  Current customer query: {query}
703
  Provide a helpful response that takes into account any relevant past interactions.
704
  """
705
+ st.write("prompt: ", prompt)
706
 
707
  # Generate a response using the agent
708
  response = self.agent_executor.invoke({"input": prompt})