Afshintm commited on
Commit
a5ae29e
·
verified ·
1 Parent(s): 3fe6faa

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -614,7 +614,7 @@ class NutritionBot:
614
  # Wrap the agent in an executor to manage tool interactions and execution flow
615
  self.agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
616
 
617
- #===================================================================================
618
  def store_customer_interaction(self, user_id: str, message: str, response: str, metadata: Dict = None):
619
  """
620
  Store customer interaction in memory for future reference.
@@ -773,10 +773,9 @@ def nutrition_disorder_streamlit():
773
  st.write(filtered_result)
774
 
775
  # Check if input is safe based on allowed statuses
776
- # Blanks #3, #4, #5: Fill in with allowed safe statuses (e.g., "safe", "unsafe S7", "unsafe S6")\
777
- # You need to by pass some cases like "S6" and "S7" so that it can work effectively.
778
 
779
- if filtered_result in ["safe","unsafe S7", "unsafe S6"]:
780
  try:
781
  if 'chatbot' not in st.session_state:
782
  st.session_state.chatbot = NutritionBot() # Blank #6: Fill in with the chatbot class initialization (e.g., NutritionBot)
 
614
  # Wrap the agent in an executor to manage tool interactions and execution flow
615
  self.agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
616
 
617
+
618
  def store_customer_interaction(self, user_id: str, message: str, response: str, metadata: Dict = None):
619
  """
620
  Store customer interaction in memory for future reference.
 
773
  st.write(filtered_result)
774
 
775
  # Check if input is safe based on allowed statuses
776
+ # We are by passing some cases like "S6" and "S7" so that it can work effectively.
 
777
 
778
+ if filtered_result in ["safe", "unsafe S7", "unsafe S6"]:
779
  try:
780
  if 'chatbot' not in st.session_state:
781
  st.session_state.chatbot = NutritionBot() # Blank #6: Fill in with the chatbot class initialization (e.g., NutritionBot)