Selaa lähdekoodia

Update prompt_utils: better format

StrayWarrior 5 kuukautta sitten
vanhempi
commit
efb4013789
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      pqai_agent/utils/prompt_utils.py

+ 5 - 1
pqai_agent/utils/prompt_utils.py

@@ -52,6 +52,10 @@ def format_user_profile(profile: Dict) -> str:
     for field in fields:
         if not profile.get(field[0], None):
             continue
-        cur_string = f"- {field[1]}:{profile[field[0]]}"
+        if isinstance(profile[field[0]], list):
+            value = ','.join(profile[field[0]])
+        else:
+            value = profile[field[0]]
+        cur_string = f"- {field[1]}:{value}"
         strings_to_join.append(cur_string)
     return "\n".join(strings_to_join)