镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 22:46:48 +00:00
* typo: Fix typos and rename functions across multiple files This commit addresses several minor issues: - Corrected spelling of function names (e.g., `update_ui_lastest_msg` to `update_ui_latest_msg`) - Fixed typos in comments and variable names - Corrected capitalization in some strings (e.g., "ArXiv" instead of "Arixv") - Renamed some variables for consistency - Corrected some console-related parameter names (e.g., `console_slience` to `console_silence`) The changes span multiple files across the project, including request LLM bridges, crazy functions, and utility modules. * fix: f-string expression part cannot include a backslash (#2139) * raise error when the uploaded tar contain hard/soft link (#2136) * minor bug fix * fine tune reasoning css * upgrade internet gpt plugin * Update README.md * fix GHSA-gqp5-wm97-qxcv * typo fix * update readme --------- Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com> Co-authored-by: binary-husky <qingxu.fu@outlook.com>
28 行
931 B
Python
28 行
931 B
Python
import pickle
|
|
|
|
class VoidTerminalState():
|
|
def __init__(self):
|
|
self.reset_state()
|
|
|
|
def reset_state(self):
|
|
self.has_provided_explanation = False
|
|
|
|
def lock_plugin(self, chatbot):
|
|
chatbot._cookies['lock_plugin'] = 'crazy_functions.虚空终端->虚空终端'
|
|
chatbot._cookies['plugin_state'] = pickle.dumps(self)
|
|
|
|
def unlock_plugin(self, chatbot):
|
|
self.reset_state()
|
|
chatbot._cookies['lock_plugin'] = None
|
|
chatbot._cookies['plugin_state'] = pickle.dumps(self)
|
|
|
|
def set_state(self, chatbot, key, value):
|
|
setattr(self, key, value)
|
|
chatbot._cookies['plugin_state'] = pickle.dumps(self)
|
|
|
|
def get_state(chatbot):
|
|
state = chatbot._cookies.get('plugin_state', None)
|
|
if state is not None: state = pickle.loads(state)
|
|
else: state = VoidTerminalState()
|
|
state.chatbot = chatbot
|
|
return state |