Spaces:
Sleeping
Sleeping
Update src/prompts.py
Browse files- src/prompts.py +11 -3
src/prompts.py
CHANGED
|
@@ -280,6 +280,16 @@ Output:
|
|
| 280 |
USER'S QUESTION: {query}
|
| 281 |
Return only the JSON object. Do not provide explanations, markdown, or additional text.
|
| 282 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
def dict_to_string(d, indent=0):
|
| 284 |
result = ""
|
| 285 |
for key, value in d.items():
|
|
@@ -291,9 +301,7 @@ def dict_to_string(d, indent=0):
|
|
| 291 |
# Recursively call the function for nested dictionaries
|
| 292 |
result += dict_to_string(value, indent + 1)
|
| 293 |
elif isinstance(value, list):
|
| 294 |
-
|
| 295 |
-
for i in value:
|
| 296 |
-
result += f"{spacing}{spacing}{spacing}{spacing}-{i}\n\n"
|
| 297 |
else:
|
| 298 |
result += f"{spacing}{key}:\n\n {spacing}-{value}\n\n"
|
| 299 |
|
|
|
|
| 280 |
USER'S QUESTION: {query}
|
| 281 |
Return only the JSON object. Do not provide explanations, markdown, or additional text.
|
| 282 |
"""
|
| 283 |
+
|
| 284 |
+
def list_to_string(l, key, indent):
|
| 285 |
+
spacing = " " * indent
|
| 286 |
+
|
| 287 |
+
result += f"{spacing}{spacing}{key}:\n\n"
|
| 288 |
+
for i in l:
|
| 289 |
+
result += f"{spacing}{spacing}{spacing}{spacing}-{i}\n\n"
|
| 290 |
+
|
| 291 |
+
return result
|
| 292 |
+
|
| 293 |
def dict_to_string(d, indent=0):
|
| 294 |
result = ""
|
| 295 |
for key, value in d.items():
|
|
|
|
| 301 |
# Recursively call the function for nested dictionaries
|
| 302 |
result += dict_to_string(value, indent + 1)
|
| 303 |
elif isinstance(value, list):
|
| 304 |
+
|
|
|
|
|
|
|
| 305 |
else:
|
| 306 |
result += f"{spacing}{key}:\n\n {spacing}-{value}\n\n"
|
| 307 |
|