Redmind commited on
Commit
dffda18
·
verified ·
1 Parent(s): a9016f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -56,7 +56,7 @@ load_dotenv()
56
 
57
  # langfuse analytics
58
  from langfuse.callback import CallbackHandler
59
- from langchain.callbacks import CallbackManager, BaseCallbackHandler
60
  # Inventory API data table
61
  from tabulate import tabulate
62
 
@@ -125,7 +125,7 @@ langfuse_handler.auth_check() # Optional: Checks if the authentication is succe
125
  callback_handler = ResponseHistoryCallback()
126
 
127
 
128
- callback_manager = CallbackManager([callback_handler, langfuse_handler])
129
 
130
 
131
  nltk.download('punkt')
@@ -724,7 +724,7 @@ def answer_question_thread(user_question, chatbot,audio=None):
724
  while iterations < max_iterations:
725
 
726
  #response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]}, early_stopping_method="generate")
727
- response = agent_executor.invoke({"input": user_question}, config={"callbacks": [callback_manager]}, early_stopping_method="generate")
728
  # Track the response
729
  agent_responses.append(response)
730
 
 
56
 
57
  # langfuse analytics
58
  from langfuse.callback import CallbackHandler
59
+ from langchain.callbacks import BaseCallbackHandler
60
  # Inventory API data table
61
  from tabulate import tabulate
62
 
 
125
  callback_handler = ResponseHistoryCallback()
126
 
127
 
128
+
129
 
130
 
131
  nltk.download('punkt')
 
724
  while iterations < max_iterations:
725
 
726
  #response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]}, early_stopping_method="generate")
727
+ response = agent_executor.invoke({"input": user_question}, config={"callbacks": [[callback_handler, langfuse_handler]]}, early_stopping_method="generate")
728
  # Track the response
729
  agent_responses.append(response)
730