Browse Source

Update prompt_utils: change format

StrayWarrior 1 month ago
parent
commit
3be4e1f689
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pqai_agent/utils/prompt_utils.py

+ 3 - 3
pqai_agent/utils/prompt_utils.py

@@ -16,7 +16,7 @@ def format_agent_profile(profile: Dict) -> str:
     ]
     strings_to_join = []
     for field in fields:
-        if not profile.get(field[0], None):
+        if profile.get(field[0], None) is None:
             continue
         cur_string = f"- {field[1]}:{profile[field[0]]}"
         strings_to_join.append(cur_string)
@@ -54,8 +54,8 @@ def format_user_profile(profile: Dict) -> str:
     for field in fields:
         value = profile.get(field[0], None)
         if not value:
-            continue
-        if isinstance(value, list):
+            value = '未知'
+        elif isinstance(value, list):
             value = ','.join(value)
         elif isinstance(value, dict):
             value = ';'.join(f"{k}: {v}" for k, v in value.items())