mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-04 12:56:02 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf279049c0 | ||
|
|
05cc58f2d7 | ||
|
|
d887881ea0 | ||
|
|
8bb2f3e745 | ||
|
|
e7e6eeda61 | ||
|
|
b6ff2be4df | ||
|
|
a2ea185602 |
@@ -1,17 +0,0 @@
|
|||||||
# This file is deprecated, and will be replaced by docker/docker-compose.yaml in next version.
|
|
||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
langbot:
|
|
||||||
image: rockchin/langbot:latest
|
|
||||||
container_name: langbot
|
|
||||||
volumes:
|
|
||||||
- ./data:/app/data
|
|
||||||
- ./plugins:/app/plugins
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
|
||||||
- TZ=Asia/Shanghai
|
|
||||||
ports:
|
|
||||||
- 5300:5300 # 供 WebUI 使用
|
|
||||||
- 2280-2290:2280-2290 # 供消息平台适配器方向连接
|
|
||||||
# 根据具体环境配置网络
|
|
||||||
5
main.py
5
main.py
@@ -18,7 +18,6 @@ asciiart = r"""
|
|||||||
|
|
||||||
async def main_entry(loop: asyncio.AbstractEventLoop):
|
async def main_entry(loop: asyncio.AbstractEventLoop):
|
||||||
parser = argparse.ArgumentParser(description='LangBot')
|
parser = argparse.ArgumentParser(description='LangBot')
|
||||||
parser.add_argument('--skip-plugin-deps-check', action='store_true', help='跳过插件依赖项检查', default=False)
|
|
||||||
parser.add_argument('--standalone-runtime', action='store_true', help='使用独立插件运行时', default=False)
|
parser.add_argument('--standalone-runtime', action='store_true', help='使用独立插件运行时', default=False)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -49,10 +48,6 @@ async def main_entry(loop: asyncio.AbstractEventLoop):
|
|||||||
print('The missing dependencies have been installed automatically, please restart the program.')
|
print('The missing dependencies have been installed automatically, please restart the program.')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# check plugin deps
|
|
||||||
if not args.skip_plugin_deps_check:
|
|
||||||
await deps.precheck_plugin_deps()
|
|
||||||
|
|
||||||
# # 检查pydantic版本,如果没有 pydantic.v1,则把 pydantic 映射为 v1
|
# # 检查pydantic版本,如果没有 pydantic.v1,则把 pydantic 映射为 v1
|
||||||
# import pydantic.version
|
# import pydantic.version
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,14 @@ class SystemRouterGroup(group.RouterGroup):
|
|||||||
'version': constants.semantic_version,
|
'version': constants.semantic_version,
|
||||||
'debug': constants.debug_mode,
|
'debug': constants.debug_mode,
|
||||||
'enabled_platform_count': len(self.ap.platform_mgr.get_running_adapters()),
|
'enabled_platform_count': len(self.ap.platform_mgr.get_running_adapters()),
|
||||||
'enable_marketplace': self.ap.instance_config.data['plugin'].get('enable_marketplace', True),
|
'enable_marketplace': self.ap.instance_config.data.get('plugin', {}).get(
|
||||||
|
'enable_marketplace', True
|
||||||
|
),
|
||||||
'cloud_service_url': (
|
'cloud_service_url': (
|
||||||
self.ap.instance_config.data['plugin']['cloud_service_url']
|
self.ap.instance_config.data.get('plugin', {}).get(
|
||||||
if 'cloud_service_url' in self.ap.instance_config.data['plugin']
|
'cloud_service_url', 'https://space.langbot.app'
|
||||||
|
)
|
||||||
|
if 'cloud_service_url' in self.ap.instance_config.data.get('plugin', {})
|
||||||
else 'https://space.langbot.app'
|
else 'https://space.langbot.app'
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from .. import migration
|
from .. import migration
|
||||||
|
|
||||||
|
|
||||||
@migration.migration_class(4)
|
@migration.migration_class(8)
|
||||||
class DBMigratePluginConfig(migration.DBMigration):
|
class DBMigratePluginConfig(migration.DBMigration):
|
||||||
"""插件配置"""
|
"""插件配置"""
|
||||||
|
|
||||||
@@ -10,7 +10,9 @@ class DBMigratePluginConfig(migration.DBMigration):
|
|||||||
|
|
||||||
if 'plugin' not in self.ap.instance_config.data:
|
if 'plugin' not in self.ap.instance_config.data:
|
||||||
self.ap.instance_config.data['plugin'] = {
|
self.ap.instance_config.data['plugin'] = {
|
||||||
'runtime_ws_url': 'ws://localhost:5400/control/ws',
|
'runtime_ws_url': 'ws://langbot_plugin_runtime:5400/control/ws',
|
||||||
|
'enable_marketplace': True,
|
||||||
|
'cloud_service_url': 'https://space.langbot.app',
|
||||||
}
|
}
|
||||||
|
|
||||||
await self.ap.instance_config.dump_config()
|
await self.ap.instance_config.dump_config()
|
||||||
@@ -73,7 +73,9 @@ class PluginRuntimeConnector:
|
|||||||
|
|
||||||
if platform.get_platform() == 'docker' or platform.use_websocket_to_connect_plugin_runtime(): # use websocket
|
if platform.get_platform() == 'docker' or platform.use_websocket_to_connect_plugin_runtime(): # use websocket
|
||||||
self.ap.logger.info('use websocket to connect to plugin runtime')
|
self.ap.logger.info('use websocket to connect to plugin runtime')
|
||||||
ws_url = self.ap.instance_config.data['plugin']['runtime_ws_url']
|
ws_url = self.ap.instance_config.data.get('plugin', {}).get(
|
||||||
|
'runtime_ws_url', 'ws://langbot_plugin_runtime:5400/control/ws'
|
||||||
|
)
|
||||||
|
|
||||||
async def make_connection_failed_callback(ctrl: ws_client_controller.WebSocketClientController) -> None:
|
async def make_connection_failed_callback(ctrl: ws_client_controller.WebSocketClientController) -> None:
|
||||||
self.ap.logger.error('Failed to connect to plugin runtime, trying to reconnect...')
|
self.ap.logger.error('Failed to connect to plugin runtime, trying to reconnect...')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
semantic_version = 'v4.3.0'
|
semantic_version = 'v4.3.2'
|
||||||
|
|
||||||
required_database_version = 7
|
required_database_version = 8
|
||||||
"""Tag the version of the database schema, used to check if the database needs to be migrated"""
|
"""Tag the version of the database schema, used to check if the database needs to be migrated"""
|
||||||
|
|
||||||
debug_mode = False
|
debug_mode = False
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "langbot"
|
name = "langbot"
|
||||||
version = "4.3.0"
|
version = "4.3.1"
|
||||||
description = "Easy-to-use global IM bot platform designed for LLM era"
|
description = "Easy-to-use global IM bot platform designed for LLM era"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10.1,<4.0"
|
requires-python = ">=3.10.1,<4.0"
|
||||||
@@ -62,7 +62,7 @@ dependencies = [
|
|||||||
"langchain>=0.2.0",
|
"langchain>=0.2.0",
|
||||||
"chromadb>=0.4.24",
|
"chromadb>=0.4.24",
|
||||||
"qdrant-client (>=1.15.1,<2.0.0)",
|
"qdrant-client (>=1.15.1,<2.0.0)",
|
||||||
"langbot-plugin==0.1.1b8",
|
"langbot-plugin==0.1.1",
|
||||||
"asyncpg>=0.30.0",
|
"asyncpg>=0.30.0",
|
||||||
"line-bot-sdk>=3.19.0"
|
"line-bot-sdk>=3.19.0"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user