mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-08 06:46:02 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fccf84987 | ||
|
|
0f59788184 | ||
|
|
0ad52bcd3f | ||
|
|
d7d710ec07 | ||
|
|
75a9a3e9af | ||
|
|
70503bedb7 | ||
|
|
7890eac3f8 | ||
|
|
e15f3595b3 |
@@ -291,7 +291,7 @@ show_prefix = False
|
|||||||
# 当此次消息处理时间低于此秒数时,将会强制延迟至此秒数
|
# 当此次消息处理时间低于此秒数时,将会强制延迟至此秒数
|
||||||
# 例如:[1.5, 3],则每次处理时会随机取一个1.5-3秒的随机数,若处理时间低于此随机数,则强制延迟至此随机秒数
|
# 例如:[1.5, 3],则每次处理时会随机取一个1.5-3秒的随机数,若处理时间低于此随机数,则强制延迟至此随机秒数
|
||||||
# 若您不需要此功能,请将force_delay_range设置为[0, 0]
|
# 若您不需要此功能,请将force_delay_range设置为[0, 0]
|
||||||
force_delay_range = [1.5, 3]
|
force_delay_range = [0, 0]
|
||||||
|
|
||||||
# 应用长消息处理策略的阈值
|
# 应用长消息处理策略的阈值
|
||||||
# 当回复消息长度超过此值时,将使用长消息处理策略
|
# 当回复消息长度超过此值时,将使用长消息处理策略
|
||||||
|
|||||||
1
main.py
1
main.py
@@ -241,6 +241,7 @@ def start(first_time_init=False):
|
|||||||
|
|
||||||
# 配置openai api_base
|
# 配置openai api_base
|
||||||
if "reverse_proxy" in config.openai_config and config.openai_config["reverse_proxy"] is not None:
|
if "reverse_proxy" in config.openai_config and config.openai_config["reverse_proxy"] is not None:
|
||||||
|
logging.debug("设置反向代理: "+config.openai_config['reverse_proxy'])
|
||||||
openai.base_url = config.openai_config["reverse_proxy"]
|
openai.base_url = config.openai_config["reverse_proxy"]
|
||||||
|
|
||||||
# 主启动流程
|
# 主启动流程
|
||||||
|
|||||||
@@ -69,8 +69,8 @@
|
|||||||
"process_message_timeout": 120,
|
"process_message_timeout": 120,
|
||||||
"show_prefix": false,
|
"show_prefix": false,
|
||||||
"force_delay_range": [
|
"force_delay_range": [
|
||||||
1.5,
|
0,
|
||||||
3
|
0
|
||||||
],
|
],
|
||||||
"blob_message_threshold": 256,
|
"blob_message_threshold": 256,
|
||||||
"blob_message_strategy": "forward",
|
"blob_message_strategy": "forward",
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ class OpenAIInteract:
|
|||||||
# logging.info("文字总使用量:%d", self.audit_mgr.get_total_text_length())
|
# logging.info("文字总使用量:%d", self.audit_mgr.get_total_text_length())
|
||||||
|
|
||||||
self.client = openai.Client(
|
self.client = openai.Client(
|
||||||
api_key=self.key_mgr.get_using_key()
|
api_key=self.key_mgr.get_using_key(),
|
||||||
|
base_url=openai.base_url
|
||||||
)
|
)
|
||||||
|
|
||||||
context.set_openai_manager(self)
|
context.set_openai_manager(self)
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ class UpdateCommand(aamgr.AbstractCommandNode):
|
|||||||
def update_task():
|
def update_task():
|
||||||
try:
|
try:
|
||||||
if pkg.utils.updater.update_all():
|
if pkg.utils.updater.update_all():
|
||||||
pkg.utils.reloader.reload_all(notify=False)
|
pkg.utils.context.get_qqbot_manager().notify_admin("更新完成, 请手动重启程序。")
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("更新完成")
|
|
||||||
else:
|
else:
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("无新版本")
|
pkg.utils.context.get_qqbot_manager().notify_admin("无新版本")
|
||||||
except Exception as e0:
|
except Exception as e0:
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -203,9 +203,9 @@ def update_all(cli: bool = False) -> bool:
|
|||||||
# 通知管理员
|
# 通知管理员
|
||||||
if not cli:
|
if not cli:
|
||||||
import pkg.utils.context
|
import pkg.utils.context
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("已更新到最新版本: {}\n更新日志:\n{}\n完整的更新日志请前往 https://github.com/RockChinQ/QChatGPT/releases 查看".format(current_tag, "\n".join(rls_notes[:-1])))
|
pkg.utils.context.get_qqbot_manager().notify_admin("已更新到最新版本: {}\n更新日志:\n{}\n完整的更新日志请前往 https://github.com/RockChinQ/QChatGPT/releases 查看。\n请手动重启程序以使用新版本。".format(current_tag, "\n".join(rls_notes[:-1])))
|
||||||
else:
|
else:
|
||||||
print("已更新到最新版本: {}\n更新日志:\n{}\n完整的更新日志请前往 https://github.com/RockChinQ/QChatGPT/releases 查看".format(current_tag, "\n".join(rls_notes[:-1])))
|
print("已更新到最新版本: {}\n更新日志:\n{}\n完整的更新日志请前往 https://github.com/RockChinQ/QChatGPT/releases 查看。请手动重启程序以使用新版本。".format(current_tag, "\n".join(rls_notes[:-1])))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user