Spaces:
Paused
Paused
Update src/prompts.py
Browse files- src/prompts.py +2 -4
src/prompts.py
CHANGED
|
@@ -289,14 +289,12 @@ def list_to_string(l, key, indent, result=""):
|
|
| 289 |
|
| 290 |
def dict_to_string(d, indent=0):
|
| 291 |
result = ""
|
|
|
|
| 292 |
for key, value in d.items():
|
| 293 |
# Add indentation based on nesting depth
|
| 294 |
-
spacing = " " * indent
|
| 295 |
|
| 296 |
if isinstance(value, dict):
|
| 297 |
-
result += f"{spacing}{spacing}{key}:\n\n"
|
| 298 |
-
# Recursively call the function for nested dictionaries
|
| 299 |
-
result += dict_to_string(value, indent + 1)
|
| 300 |
elif isinstance(value, list):
|
| 301 |
result += f"{spacing}{spacing}{key}: " + ", ".join(value) + "\n\n"
|
| 302 |
else:
|
|
|
|
| 289 |
|
| 290 |
def dict_to_string(d, indent=0):
|
| 291 |
result = ""
|
| 292 |
+
spacing = " " * indent
|
| 293 |
for key, value in d.items():
|
| 294 |
# Add indentation based on nesting depth
|
|
|
|
| 295 |
|
| 296 |
if isinstance(value, dict):
|
| 297 |
+
result += f"{spacing}{spacing}{key}:\n\n" + dict_to_string(value, indent + 1)
|
|
|
|
|
|
|
| 298 |
elif isinstance(value, list):
|
| 299 |
result += f"{spacing}{spacing}{key}: " + ", ".join(value) + "\n\n"
|
| 300 |
else:
|