mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
* feat: unified webhook (#70) * feat: add qqo,wxoa,wxbot & wecom * feat: add wecom images & line webhook docs update ,en docs update * docs: wecombot docs update * feat: add slack * feat: add images * perf: docs * update settings.md * docs: complete --------- Co-authored-by: WangCham <[email protected]> Co-authored-by: Dong_master <[email protected]> Co-authored-by: wangcham <[email protected]> * feat: update docs --------- Co-authored-by: WangCham <[email protected]> Co-authored-by: Dong_master <[email protected]> Co-authored-by: wangcham <[email protected]>
3.8 KiB
3.8 KiB
系统环境设置
配置系统运行的一些环境信息,文件位于data/config.yaml。
一般不需要修改。
# 管理员会话列表,仅在处理命令时有效
# 格式为会话ID(person_xxxx 或 group_xxxx)
# 会话ID 可以在发送消息时查看控制台日志找到
# 例如:
# admins:
# - person_1234567890
# - group_1234567890
admins: []
# API 端口
api:
port: 5300
# LangBot 统一管理所有需要 Webhook 监听的机器人地址
# 这是显示在需要 Webhook 连接的机器人页面上的 Webhook地址前缀
# 您可以根据自身网络环境修改
webhook_prefix: 'http://127.0.0.1:5300'
# 命令配置
command:
# 命令前缀,具有这些前缀的消息会被识别为命令
prefix:
- '!'
- !
# 命令权限配置,key 为命令前缀,value 为权限类型
privilege: {}
# 并发设置
concurrency:
# 单流水线并发数
pipeline: 20
# 单会话并发数
session: 1
# 数据库配置
database:
# 所使用的数据库
# 支持的数据库:
# - sqlite(本地 SQLite 数据库,默认)
# - postgresql(PostgreSQL 数据库,请在下方配置)
use: sqlite
sqlite:
path: 'data/langbot.db'
postgresql:
host: '127.0.0.1'
port: 5432
user: 'postgres'
password: 'postgres'
database: 'postgres'
# 插件系统配置
plugin:
# 是否启用插件系统
enable: true
# 插件运行时 WebSocket 地址
# 默认为 Docker 环境下的默认值
# 若要使用独立的 Plugin Runtime,请参考 https://docs.langbot.app/zh/develop/plugin-runtime.html
runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws'
# 是否启用插件市场
enable_marketplace: true
# 插件市场 URL
cloud_service_url: 'https://space.langbot.app'
# 代理配置
proxy:
# HTTP 代理地址
# 如果已经在环境变量设置了代理,则不需要配置
# 例如:
# proxy:
# http: 'http://127.0.0.1:7890'
# https: 'http://127.0.0.1:7890'
http: ''
https: ''
# 对象存储配置
storage:
# 所使用的对象存储
# 支持的对象存储:
# - local(本地存储,默认)
# - s3(S3 协议对象存储,支持 R2、MinIO 等兼容 S3 协议的对象存储服务,请在下方配置)
use: local
# S3 配置
s3:
endpoint_url: ''
access_key_id: ''
secret_access_key: ''
region: 'us-east-1'
bucket: 'langbot-storage'
# 系统配置
system:
# JWT 配置
jwt:
# JWT 过期时间,单位为秒
expire: 604800
# JWT 密钥,首次启动时会自动生成一个密钥
secret: 'xxxx'
# 向量数据库配置
vdb:
# 所使用的向量数据库
# 支持的向量数据库:
# - chroma(默认,嵌入式向量数据库)
# - qdrant(外部向量数据库,请在下方配置)
use: chroma
# Qdrant 配置
qdrant:
# Qdrant 的 URL
url: ''
# Qdrant 的 Host
host: localhost
# Qdrant 的 Port
port: 6333
# Qdrant 的 API Key
api_key: ''
通过环境变量设置
config.yaml 中的配置可以通过环境变量进行设置。环境变量名称为大写字母,使用双下划线连接,例如:API__PORT代表api.port。
API__PORT代表api.portCONCURRENCY__PIPELINE代表concurrency.pipelineCONCURRENCY__SESSION代表concurrency.sessionDATABASE__POSTGRESQL__DATABASE代表database.postgresql.databaseDATABASE__POSTGRESQL__HOST代表database.postgresql.hostDATABASE__SQLITE__PATH代表database.sqlite.path
...
在启动时,LangBot 会读取所有环境变量,将对应的配置应用到 config.yaml 中并写入到 data/config.yaml 文件中。