Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ load_dotenv()
|
|
| 56 |
|
| 57 |
# langfuse analytics
|
| 58 |
from langfuse.callback import CallbackHandler
|
| 59 |
-
from langchain.callbacks import
|
| 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 |
-
|
| 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": [
|
| 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 |
|