Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -172,7 +172,7 @@ def supervisor_chain(state):
|
|
172 |
# Validate the next action
|
173 |
if next_action not in options:
|
174 |
raise ValueError(f"Invalid next action: '{next_action}'. Expected one of {options}.")
|
175 |
-
|
176 |
# Initialize intermediate_steps if not already present
|
177 |
if "intermediate_steps" not in state:
|
178 |
state["intermediate_steps"] = []
|
@@ -184,6 +184,9 @@ def supervisor_chain(state):
|
|
184 |
|
185 |
print(f"[DEBUG] Next action decided: {next_action}") # Log decision
|
186 |
return {"next": next_action, "messages": messages, "intermediate_steps": state["intermediate_steps"]}
|
|
|
|
|
|
|
187 |
|
188 |
except Exception as e:
|
189 |
print(f"[ERROR] Supervisor chain failed: {e}")
|
@@ -266,8 +269,9 @@ initial_state = {
|
|
266 |
"messages": [
|
267 |
#HumanMessage(content="Code hello world and print it to the terminal.") # Correct format for user input
|
268 |
HumanMessage(content="Write Code for printing \"hello world\" in Python. Keep it precise.") # Correct format for user input
|
269 |
-
]
|
270 |
-
|
|
|
271 |
}
|
272 |
|
273 |
|
|
|
172 |
# Validate the next action
|
173 |
if next_action not in options:
|
174 |
raise ValueError(f"Invalid next action: '{next_action}'. Expected one of {options}.")
|
175 |
+
"""
|
176 |
# Initialize intermediate_steps if not already present
|
177 |
if "intermediate_steps" not in state:
|
178 |
state["intermediate_steps"] = []
|
|
|
184 |
|
185 |
print(f"[DEBUG] Next action decided: {next_action}") # Log decision
|
186 |
return {"next": next_action, "messages": messages, "intermediate_steps": state["intermediate_steps"]}
|
187 |
+
"""
|
188 |
+
print(f"[DEBUG] Next action decided: {next_action}") # Log decision
|
189 |
+
return {"next": next_action, "messages": messages}
|
190 |
|
191 |
except Exception as e:
|
192 |
print(f"[ERROR] Supervisor chain failed: {e}")
|
|
|
269 |
"messages": [
|
270 |
#HumanMessage(content="Code hello world and print it to the terminal.") # Correct format for user input
|
271 |
HumanMessage(content="Write Code for printing \"hello world\" in Python. Keep it precise.") # Correct format for user input
|
272 |
+
]
|
273 |
+
#,
|
274 |
+
#"intermediate_steps": [] # Add this to track progress if needed
|
275 |
}
|
276 |
|
277 |
|