镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 14:36:48 +00:00
Merge pull request #194 from fulyaec/enhance-chataca
修改AUTHENTICATION的判断,使得AUTHENTICATION为None/[]/""时都可以正确判断
这个提交包含在:
13
toolbox.py
13
toolbox.py
@@ -1,4 +1,4 @@
|
||||
import markdown, mdtex2html, threading, importlib, traceback
|
||||
import markdown, mdtex2html, threading, importlib, traceback, importlib, inspect
|
||||
from show_math import convert as convert_math
|
||||
from functools import wraps
|
||||
import re
|
||||
@@ -89,6 +89,17 @@ def CatchException(f):
|
||||
yield chatbot, history, f'异常 {e}'
|
||||
return decorated
|
||||
|
||||
def HotReload(f):
|
||||
"""
|
||||
装饰器函数,实现函数插件热更新
|
||||
"""
|
||||
@wraps(f)
|
||||
def decorated(*args, **kwargs):
|
||||
fn_name = f.__name__
|
||||
f_hot_reload = getattr(importlib.reload(inspect.getmodule(f)), fn_name)
|
||||
yield from f_hot_reload(*args, **kwargs)
|
||||
return decorated
|
||||
|
||||
def report_execption(chatbot, history, a, b):
|
||||
"""
|
||||
向chatbot中添加错误信息
|
||||
|
||||
在新工单中引用
屏蔽一个用户