Browse Source

Update prompt_utils: better format

StrayWarrior 2 months ago
parent
commit
efb4013789
1 changed files with 5 additions and 1 deletions
  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)