mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00: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("已自动安装缺失的依赖包,请重启程序。")
|
print("已自动安装缺失的依赖包,请重启程序。")
|
||||||
sys.exit(0)
|
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
|
from pkg.core.bootutils import files
|
||||||
@@ -77,7 +63,7 @@ if __name__ == '__main__':
|
|||||||
if "QChatGPT/main.py" not in content:
|
if "QChatGPT/main.py" not in content:
|
||||||
invalid_pwd = True
|
invalid_pwd = True
|
||||||
if invalid_pwd:
|
if invalid_pwd:
|
||||||
print("请在QChatGPT项目根目录下运行此程序。")
|
print("请在QChatGPT项目根目录下以命令形式运行此程序。")
|
||||||
input("按任意键退出...")
|
input("按任意键退出...")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ class PlatformManager:
|
|||||||
|
|
||||||
event_ctx = await self.ap.plugin_mgr.emit_event(
|
event_ctx = await self.ap.plugin_mgr.emit_event(
|
||||||
event=events.GroupMessageReceived(
|
event=events.GroupMessageReceived(
|
||||||
launcher_type='person',
|
launcher_type='group',
|
||||||
launcher_id=event.sender.id,
|
launcher_id=event.group.id,
|
||||||
sender_id=event.sender.id,
|
sender_id=event.sender.id,
|
||||||
message_chain=event.message_chain,
|
message_chain=event.message_chain,
|
||||||
query=None
|
query=None
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class ToolManager:
|
|||||||
for plugin in self.ap.plugin_mgr.plugins:
|
for plugin in self.ap.plugin_mgr.plugins:
|
||||||
for function in plugin.content_functions:
|
for function in plugin.content_functions:
|
||||||
if function.name == name:
|
if function.name == name:
|
||||||
return function, plugin
|
return function, plugin.plugin_inst
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
async def get_all_functions(self) -> list[entities.LLMFunction]:
|
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