Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,8 +129,7 @@ def run_agent_in_gradio(message, history):
|
|
| 129 |
chat_history.append(AIMessage(content=ai_msg))
|
| 130 |
|
| 131 |
try:
|
| 132 |
-
#
|
| 133 |
-
# This addresses the ValueError for agent_scratchpad
|
| 134 |
response = agent_executor.invoke(
|
| 135 |
{"input": message, "chat_history": chat_history, "agent_scratchpad": []}
|
| 136 |
)
|
|
@@ -147,9 +146,9 @@ def run_agent_in_gradio(message, history):
|
|
| 147 |
|
| 148 |
except Exception as e:
|
| 149 |
print(f"Error running agent: {e}")
|
| 150 |
-
traceback.print_exc()
|
| 151 |
return f"β Agent encountered an error: {str(e)}"
|
| 152 |
-
|
| 153 |
# Gradio ChatInterface setup
|
| 154 |
demo = gr.ChatInterface(
|
| 155 |
fn=run_agent_in_gradio,
|
|
|
|
| 129 |
chat_history.append(AIMessage(content=ai_msg))
|
| 130 |
|
| 131 |
try:
|
| 132 |
+
# THIS LINE IS CRUCIAL AND MUST INCLUDE "agent_scratchpad": []
|
|
|
|
| 133 |
response = agent_executor.invoke(
|
| 134 |
{"input": message, "chat_history": chat_history, "agent_scratchpad": []}
|
| 135 |
)
|
|
|
|
| 146 |
|
| 147 |
except Exception as e:
|
| 148 |
print(f"Error running agent: {e}")
|
| 149 |
+
traceback.print_exc()
|
| 150 |
return f"β Agent encountered an error: {str(e)}"
|
| 151 |
+
|
| 152 |
# Gradio ChatInterface setup
|
| 153 |
demo = gr.ChatInterface(
|
| 154 |
fn=run_agent_in_gradio,
|