Browse Source

Update agent_service: pass user id to coze

StrayWarrior 2 weeks ago
parent
commit
79358de7f9
2 changed files with 5 additions and 3 deletions
  1. 2 2
      agent_service.py
  2. 3 1
      dialogue_manager.py

+ 2 - 2
agent_service.py

@@ -217,7 +217,7 @@ class AgentService:
             )
             response = chat_completion.choices[0].message.content
         elif self.chat_service_type == ChatServiceType.COZE_CHAT:
-            bot_user_id = 'dev_user'
+            bot_user_id = 'qywx_{}'.format(chat_config['user_id'])
             response = self.coze_client.create(
                 chat_config['bot_id'], bot_user_id, chat_config['messages'],
                 chat_config['custom_variables']
@@ -309,7 +309,7 @@ if __name__ == "__main__":
         if not text:
             continue
         message_id += 1
-        sender = '7881300148979455'
+        sender = '7881300197937884'
         receiver = '1688855931724582'
         if text == MessageType.AGGREGATION_TRIGGER.name:
             message = Message.build(MessageType.AGGREGATION_TRIGGER, MessageChannel.CORP_WECHAT,

+ 3 - 1
dialogue_manager.py

@@ -518,7 +518,9 @@ class DialogueManager:
             self.staff_id, self.user_id, dialogue_history
         ))
         messages = []
-        config = {}
+        config = {
+            'user_id': self.user_id
+        }
 
         prompt_context = self.get_prompt_context(user_message)
         if overwrite_context: