From 0b5fd27cd8233fa601f8bb5c6094c5c1880562d2 Mon Sep 17 00:00:00 2001 From: goldfishh Date: Thu, 30 Mar 2023 00:19:18 +0800 Subject: [PATCH] fix get_session error --- bot/session_manager.py | 2 +- plugins/tool/tool.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/session_manager.py b/bot/session_manager.py index 1114730..0e20cd7 100644 --- a/bot/session_manager.py +++ b/bot/session_manager.py @@ -50,7 +50,7 @@ class SessionManager(object): ''' if session_id not in self.sessions: self.sessions[session_id] = self.sessioncls(session_id, system_prompt, **self.session_args) - elif system_prompt is not None: # 如果有新的system_prompt,更新并重置session + elif system_prompt is not None: # 如果有新的system_prompt,更新并重置session self.sessions[session_id].set_system_prompt(system_prompt) session = self.sessions[session_id] return session diff --git a/plugins/tool/tool.py b/plugins/tool/tool.py index e66b891..12ec6a3 100644 --- a/plugins/tool/tool.py +++ b/plugins/tool/tool.py @@ -76,7 +76,7 @@ class Tool(Plugin): # Don't modify bot name all_sessions = Bridge().get_bot("chat").sessions - user_session = all_sessions.session_query(query, e_context['context']['session_id']) + user_session = all_sessions.session_query(query, e_context['context']['session_id']).messages # chatgpt-tool-hub will reply you with many tools logger.debug("[tool]: just-go")