Browse Source

Apply abtest config to user profile extractor

StrayWarrior 4 weeks ago
parent
commit
cf9e59096d
2 changed files with 7 additions and 1 deletions
  1. 6 1
      pqai_agent/agent_service.py
  2. 1 0
      pqai_agent/user_profile_extractor.py

+ 6 - 1
pqai_agent/agent_service.py

@@ -253,7 +253,12 @@ class AgentService:
             sys.exit(0)
 
     def _update_user_profile(self, user_id, user_profile, recent_dialogue: List[Dict]):
-        profile_to_update = self.user_profile_extractor.extract_profile_info_v2(user_profile, recent_dialogue)
+        agent_info = get_agent_abtest_config('profile_extractor', user_id, self.service_module_manager, self.agent_config_manager)
+        if agent_info:
+            prompt_template = agent_info.task_prompt
+        else:
+            prompt_template = None
+        profile_to_update = self.user_profile_extractor.extract_profile_info_v2(user_profile, recent_dialogue, prompt_template)
         if not profile_to_update:
             logger.debug("user_id: {}, no profile info extracted".format(user_id))
             return

+ 1 - 0
pqai_agent/user_profile_extractor.py

@@ -156,6 +156,7 @@ class UserProfileExtractor:
         :return:
         """
         if configs.get().get('debug_flags', {}).get('disable_llm_api_call', False):
+            logger.debug("skip LLM API call.")
             return None
 
         try: