mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5cffb7c9b | ||
|
|
e2becf7777 | ||
|
|
a6b875a242 | ||
|
|
b5e67f3df8 |
16
main.py
16
main.py
@@ -32,20 +32,6 @@ async def main_entry():
|
||||
print("已自动安装缺失的依赖包,请重启程序。")
|
||||
sys.exit(0)
|
||||
|
||||
# 检查命令行
|
||||
import os
|
||||
|
||||
if os.name == 'nt':
|
||||
import psutil
|
||||
allowed_parent_process = ['cmd.exe', 'powershell.exe', 'wsl.exe']
|
||||
|
||||
parent_process = psutil.Process(os.getppid()).name()
|
||||
|
||||
if parent_process not in allowed_parent_process:
|
||||
print("请在命令行中运行此程序。")
|
||||
input("按任意键退出...")
|
||||
exit(0)
|
||||
|
||||
# 检查配置文件
|
||||
|
||||
from pkg.core.bootutils import files
|
||||
@@ -77,7 +63,7 @@ if __name__ == '__main__':
|
||||
if "QChatGPT/main.py" not in content:
|
||||
invalid_pwd = True
|
||||
if invalid_pwd:
|
||||
print("请在QChatGPT项目根目录下运行此程序。")
|
||||
print("请在QChatGPT项目根目录下以命令形式运行此程序。")
|
||||
input("按任意键退出...")
|
||||
exit(0)
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ class PlatformManager:
|
||||
|
||||
event_ctx = await self.ap.plugin_mgr.emit_event(
|
||||
event=events.GroupMessageReceived(
|
||||
launcher_type='person',
|
||||
launcher_id=event.sender.id,
|
||||
launcher_type='group',
|
||||
launcher_id=event.group.id,
|
||||
sender_id=event.sender.id,
|
||||
message_chain=event.message_chain,
|
||||
query=None
|
||||
|
||||
@@ -35,7 +35,7 @@ class ToolManager:
|
||||
for plugin in self.ap.plugin_mgr.plugins:
|
||||
for function in plugin.content_functions:
|
||||
if function.name == name:
|
||||
return function, plugin
|
||||
return function, plugin.plugin_inst
|
||||
return None, None
|
||||
|
||||
async def get_all_functions(self) -> list[entities.LLMFunction]:
|
||||
|
||||
@@ -1 +1 @@
|
||||
semantic_version = "v3.1.0.3"
|
||||
semantic_version = "v3.1.0.4"
|
||||
|
||||
Reference in New Issue
Block a user