Nelly-43 commited on
Commit
5fbd91a
·
verified ·
1 Parent(s): 5e02312

Update src/prompts.py

Browse files
Files changed (1) hide show
  1. 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: