Update app.py
Browse files
app.py
CHANGED
|
@@ -182,7 +182,25 @@ Follow this cycle until you find the answer:
|
|
| 182 |
max_turns=25
|
| 183 |
)
|
| 184 |
print(f"Bilan {result}")
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
|
| 188 |
print(f"Agent gave answer (first 50 chars): {result.final_output[:50]}...")
|
|
|
|
| 182 |
max_turns=25
|
| 183 |
)
|
| 184 |
print(f"Bilan {result}")
|
| 185 |
+
steps = result.to_input_list()
|
| 186 |
+
|
| 187 |
+
print("----- Agent Reasoning Trace -----\n")
|
| 188 |
+
for idx, step in enumerate(steps):
|
| 189 |
+
print(f"Step {idx + 1}:")
|
| 190 |
+
for key, value in step.items():
|
| 191 |
+
# Special handling for 'content' which can be a list or a string
|
| 192 |
+
if key == "content":
|
| 193 |
+
if isinstance(value, list):
|
| 194 |
+
for item in value:
|
| 195 |
+
if isinstance(item, dict) and "text" in item:
|
| 196 |
+
print(f" {key}: {item['text']}")
|
| 197 |
+
else:
|
| 198 |
+
print(f" {key}: {item}")
|
| 199 |
+
else:
|
| 200 |
+
print(f" {key}: {value}")
|
| 201 |
+
else:
|
| 202 |
+
print(f" {key}: {value}")
|
| 203 |
+
print("-" * 40)
|
| 204 |
|
| 205 |
|
| 206 |
print(f"Agent gave answer (first 50 chars): {result.final_output[:50]}...")
|