Explorar o código

Update api_server: logging

StrayWarrior hai 1 semana
pai
achega
c5ba2a4b95
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      api_server.py

+ 4 - 1
api_server.py

@@ -182,8 +182,11 @@ def run_extractor_prompt(req_data):
         if function_call.function.name == 'update_user_profile':
             profile_info = json.loads(function_call.function.arguments)
             return {k: v for k, v in profile_info.items() if v}
+        else:
+            logger.error("llm does not return update_user_profile")
+            return {}
     else:
-        raise Exception("llm does not return tool_calls")
+        raise {}
 
 def run_chat_prompt(req_data):
     prompt = req_data['prompt']