Browse Source

fix get_session error

develop
goldfishh 1 year ago
parent
commit
0b5fd27cd8
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      bot/session_manager.py
  2. +1
    -1
      plugins/tool/tool.py

+ 1
- 1
bot/session_manager.py View File

@@ -50,7 +50,7 @@ class SessionManager(object):
''' '''
if session_id not in self.sessions: if session_id not in self.sessions:
self.sessions[session_id] = self.sessioncls(session_id, system_prompt, **self.session_args) 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) self.sessions[session_id].set_system_prompt(system_prompt)
session = self.sessions[session_id] session = self.sessions[session_id]
return session return session


+ 1
- 1
plugins/tool/tool.py View File

@@ -76,7 +76,7 @@ class Tool(Plugin):


# Don't modify bot name # Don't modify bot name
all_sessions = Bridge().get_bot("chat").sessions 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 # chatgpt-tool-hub will reply you with many tools
logger.debug("[tool]: just-go") logger.debug("[tool]: just-go")


Loading…
Cancel
Save