mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
perf: 可以设置回复时不加前缀 #29
This commit is contained in:
parent
ae8b0658c3
commit
f554ae86ac
|
@ -23,6 +23,9 @@ openai_config = {
|
|||
# 管理员QQ号,用于接收报错等通知,为0时不发送通知
|
||||
admin_qq = 0
|
||||
|
||||
# 回复消息时是否显示[GPT]前缀
|
||||
show_prefix = False
|
||||
|
||||
# 敏感词过滤开关,以同样数量的*代替敏感词回复
|
||||
# 请在sensitive.json中添加敏感词
|
||||
sensitive_word_filter = True
|
||||
|
|
|
@ -175,7 +175,8 @@ class QQBotManager:
|
|||
|
||||
session = pkg.openai.session.get_session(session_name)
|
||||
try:
|
||||
reply = "[GPT]" + session.append(text_message)
|
||||
prefix = "[GPT]" if hasattr(config, "show_prefix") and config.show_prefix else ""
|
||||
reply = prefix + session.append(text_message)
|
||||
except openai.error.APIConnectionError as e:
|
||||
self.notify_admin("{}会话调用API失败:{}".format(session_name, e))
|
||||
reply = "[bot]err:调用API失败,请联系作者,或等待修复"
|
||||
|
|
Loading…
Reference in New Issue
Block a user