Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -700,9 +700,9 @@ def answer_question_thread(user_question, chatbot,audio=None):
|
|
700 |
intermediate_steps = []
|
701 |
while iterations < max_iterations:
|
702 |
print(f"flag::{agent_executor.return_intermediate_steps}")
|
703 |
-
response
|
704 |
print(f"response::{response}")
|
705 |
-
print(f"intermediate steps::{intermediate_steps}")
|
706 |
#create_file_HF()
|
707 |
if isinstance(response, dict):
|
708 |
response_text = response.get("output", "")
|
@@ -756,11 +756,11 @@ def answer_question_thread(user_question, chatbot,audio=None):
|
|
756 |
return user_question, response_text
|
757 |
else:
|
758 |
if ("max iterations" in response_text):
|
759 |
-
print(intermediate_steps)
|
760 |
# Loop through and print all intermediate steps
|
761 |
#for i, (action, observation) in enumerate(intermediate_steps):
|
762 |
-
for steps in intermediate_steps:
|
763 |
-
print(steps)
|
764 |
#print(f"\nIteration {i + 1}:")
|
765 |
#print(f" Action: {action.tool}")
|
766 |
#print(f" Tool Input: {action.tool_input}")
|
|
|
700 |
intermediate_steps = []
|
701 |
while iterations < max_iterations:
|
702 |
print(f"flag::{agent_executor.return_intermediate_steps}")
|
703 |
+
response = agent_executor.invoke({"input": user_question}, config={"callbacks": [langfuse_handler]}, early_stopping_method="generate")
|
704 |
print(f"response::{response}")
|
705 |
+
#print(f"intermediate steps::{intermediate_steps}")
|
706 |
#create_file_HF()
|
707 |
if isinstance(response, dict):
|
708 |
response_text = response.get("output", "")
|
|
|
756 |
return user_question, response_text
|
757 |
else:
|
758 |
if ("max iterations" in response_text):
|
759 |
+
#print(intermediate_steps)
|
760 |
# Loop through and print all intermediate steps
|
761 |
#for i, (action, observation) in enumerate(intermediate_steps):
|
762 |
+
#for steps in intermediate_steps:
|
763 |
+
#print(steps)
|
764 |
#print(f"\nIteration {i + 1}:")
|
765 |
#print(f" Action: {action.tool}")
|
766 |
#print(f" Tool Input: {action.tool_input}")
|