refactor(bot): simplify vikingbot installation - merge all bot-* extras into [bot] (#3037)

This commit is contained in:
MaojiaSheng
2026-07-06 16:17:19 +08:00
committed by GitHub
parent bfa9209850
commit 47da6ce129
18 changed files with 44 additions and 117 deletions
+3 -38
View File
@@ -14,12 +14,12 @@ Vikingbot is deeply integrated with OpenViking, providing powerful knowledge man
## 📦 Install
**Option 1: Install from PyPI (Simplest)**
### Option 1: Install from PyPI (Simplest)**
```bash
pip install "openviking[bot]"
```
**Option 2: Install from source (for development)**
### Option 2: Install from source (for development)**
**Prerequisites**
@@ -46,38 +46,8 @@ uv venv --python 3.11
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
# Install dependencies (minimal)
# Install (all features included)
uv pip install -e ".[bot]"
# Or install with optional features
uv pip install -e ".[bot,bot-langfuse,bot-telegram]"
```
### Optional Dependencies
Install only the features you need:
| Feature Group | Install Command | Description |
|---------------|-----------------|-------------|
| **Full** | `uv pip install -e ".[bot-full]"` | All features included |
| **Langfuse** | `uv pip install -e ".[bot-langfuse]"` | LLM observability and tracing |
| **FUSE** | `uv pip install -e ".[bot-fuse]"` | OpenViking filesystem mount |
| **Sandbox** | `uv pip install -e ".[bot-sandbox]"` | Code execution sandbox |
| **OpenCode** | `uv pip install -e ".[bot-opencode]"` | OpenCode AI integration |
#### Channels (chat apps)
| Channel | Install Command |
|---------|-----------------|
| **Telegram** | `uv pip install -e ".[bot-telegram]"` |
| **Feishu/Lark** | `uv pip install -e ".[bot-feishu]"` |
| **DingTalk** | `uv pip install -e ".[bot-dingtalk]"` |
| **Slack** | `uv pip install -e ".[bot-slack]"` |
| **QQ** | `uv pip install -e ".[bot-qq]"` |
Multiple features can be combined:
```bash
uv pip install -e ".[bot,bot-langfuse,bot-telegram]"
```
## 🚀 Quick Start
@@ -467,11 +437,6 @@ Add to `~/.openviking/ov.conf`:
For Langfuse Cloud, use `https://cloud.langfuse.com` as the `base_url`.
**Install Langfuse support:**
```bash
uv pip install -e ".[bot-langfuse]"
```
**Restart vikingbot:**
```bash
vikingbot gateway
+3 -38
View File
@@ -15,12 +15,12 @@ Vikingbot 深度集成 OpenViking,提供强大的知识管理和记忆检索
## 📦 安装
**选项 1:从 PyPI 安装(最简单)**
### 选项 1:从 PyPI 安装(最简单)**
```bash
pip install "openviking[bot]"
```
**选项 2:从源码安装(用于开发)**
### 选项 2:从源码安装(用于开发)**
**前置要求**
@@ -47,38 +47,8 @@ uv venv --python 3.11
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
# 安装依赖(最小化)
# 安装(包含所有功能)
uv pip install -e ".[bot]"
# 或安装包含可选功能
uv pip install -e ".[bot,bot-langfuse,bot-telegram]"
```
### 可选依赖
只安装你需要的功能:
| 功能组 | 安装命令 | 描述 |
|---------------|-----------------|-------------|
| **完整版** | `uv pip install -e ".[bot-full]"` | 包含所有功能 |
| **Langfuse** | `uv pip install -e ".[bot-langfuse]"` | LLM 可观测性和追踪 |
| **FUSE** | `uv pip install -e ".[bot-fuse]"` | OpenViking 文件系统挂载 |
| **沙箱** | `uv pip install -e ".[bot-sandbox]"` | 代码执行沙箱 |
| **OpenCode** | `uv pip install -e ".[bot-opencode]"` | OpenCode AI 集成 |
#### 聊天渠道
| 渠道 | 安装命令 |
|---------|-----------------|
| **Telegram** | `uv pip install -e ".[bot-telegram]"` |
| **飞书/Lark** | `uv pip install -e ".[bot-feishu]"` |
| **钉钉** | `uv pip install -e ".[bot-dingtalk]"` |
| **Slack** | `uv pip install -e ".[bot-slack]"` |
| **QQ** | `uv pip install -e ".[bot-qq]"` |
可以组合多个功能:
```bash
uv pip install -e ".[bot,bot-langfuse,bot-telegram]"
```
## 🚀 快速开始
@@ -461,11 +431,6 @@ cd deploy/docker
对于 Langfuse Cloud,使用 `https://cloud.langfuse.com` 作为 `base_url`。
**安装 Langfuse 支持:**
```bash
uv pip install -e ".[bot-langfuse]"
```
**重启 vikingbot:**
```bash
vikingbot gateway
+4 -10
View File
@@ -73,18 +73,12 @@ docker-compose -f bot/deploy/docker/langfuse/docker-compose.yml ps
## 5. Install Langfuse Python Support
`vikingbot` only sends Langfuse traces when the optional Langfuse dependency is installed.
Langfuse support is already included by default in the `[bot]` installation.
From the repository root, install it with:
If for some reason it's not installed, you can install it with:
```bash
uv pip install -e ".[bot,bot-langfuse]"
```
If your environment already has the main bot dependencies installed, the smaller install also works:
```bash
uv pip install -e ".[bot-langfuse]"
uv pip install langfuse>=3.0.0
```
---
@@ -216,7 +210,7 @@ If you use `docker-compose`, replace the command accordingly.
Check the following first:
1. `uv pip install -e ".[bot-langfuse]"` or `uv pip install -e ".[bot,bot-langfuse]"` has been run in the active environment
1. Langfuse is installed in the active environment (`langfuse>=3.0.0` required, already included by default with `[bot]`)
2. `bot.langfuse.enabled` is `true` in `~/.openviking/ov.conf`
3. `secret_key`, `public_key`, and `base_url` match the local deployment values
4. `openviking-server --with-bot` was restarted after the config change
+1 -1
View File
@@ -112,7 +112,7 @@ class DingTalkChannel(BaseChannel):
try:
if not DINGTALK_AVAILABLE:
logger.exception(
"DingTalk Stream SDK not installed. Install with: uv pip install 'openviking[bot-dingtalk]' (or uv pip install -e \".[bot-dingtalk]\" for local dev)"
"DingTalk Stream SDK not installed. Install with: uv pip install dingtalk-stream>=0.4.0"
)
return
+1 -1
View File
@@ -317,7 +317,7 @@ class FeishuChannel(BaseChannel):
"""Start the Feishu bot with WebSocket long connection."""
if not FEISHU_AVAILABLE:
logger.exception(
"Feishu SDK not installed. Install with: uv pip install 'openviking[bot-feishu]' (or uv pip install -e \".[bot-feishu]\" for local dev)"
"Feishu SDK not installed. Install with: uv pip install lark-oapi>=1.0.0"
)
return
+1 -1
View File
@@ -60,7 +60,7 @@ class QQChannel(BaseChannel):
"""Start the QQ bot."""
if not QQ_AVAILABLE:
logger.exception(
"QQ SDK not installed. Install with: uv pip install 'openviking[bot-qq]' (or uv pip install -e \".[bot-qq]\" for local dev)"
"QQ SDK not installed. Install with: uv pip install qq-botpy>=1.0.0"
)
return
+8 -1
View File
@@ -444,7 +444,14 @@ def validate_openviking_auth(config: Config) -> None:
auth_mode = _ov_server_auth_mode(ov_server)
health = _request_openviking_json(server_url, "/health")
# Build headers with API key if configured
# Public gateways like Volcengine VikingDB require X-API-Key on every request
headers: dict[str, str] = {}
api_key = getattr(ov_server, "api_key", None)
if api_key:
headers["X-API-Key"] = api_key
health = _request_openviking_json(server_url, "/health", headers=headers)
if not health.ok:
_server_unavailable_warning(server_url, health)
return
+1 -1
View File
@@ -41,7 +41,7 @@ class LangfuseClient:
if Langfuse is None:
logger.warning(
'Langfuse not installed. Install with: uv pip install openviking[bot-langfuse] (or uv pip install -e ".[bot-langfuse]" for local dev). Configure in ~/.openviking/ov.conf under bot.langfuse'
'Langfuse not installed. Install with: uv pip install langfuse>=3.0.0. Configure in ~/.openviking/ov.conf under bot.langfuse'
)
self.enabled = False
return
@@ -477,7 +477,7 @@ else:
def mount_fuse(*args, **kwargs):
raise ImportError(
"fusepy and libfuse are required. Install with: uv pip install 'openviking[bot-fuse]' (or uv pip install -e \".[bot-fuse]\" for local dev) and install libfuse system package"
"fusepy and libfuse are required. Install with: uv pip install fusepy>=3.0.1 and install libfuse system package"
)
class FUSEMountManager:
+1 -1
View File
@@ -34,7 +34,7 @@ class AioSandboxBackend(SandboxBackend):
logger.info("[AioSandbox] Connected successfully")
except ImportError:
logger.error(
"agent-sandbox SDK not installed. Install with: uv pip install 'openviking[bot-sandbox]' (or uv pip install -e \".[bot-sandbox]\" for local dev)"
"agent-sandbox SDK not installed. Install with: uv pip install agent-sandbox>=0.0.23"
)
raise
except Exception as e:
@@ -204,7 +204,7 @@ class OpenSandboxBackend(SandboxBackend):
except ImportError:
logger.error(
"opensandbox SDK not installed. Install with: uv pip install 'openviking[bot-sandbox]' (or uv pip install -e \".[bot-sandbox]\" for local dev)"
"opensandbox SDK not installed. Install with: uv pip install opensandbox>=0.1.0 opensandbox-server>=0.1.0"
)
raise
except Exception as e:
+1 -1
View File
@@ -745,7 +745,7 @@ Configuration for Feishu/Lark cloud document parsing. See [Resources](../api/02-
| `max_rows_per_sheet` | int | Maximum rows to import per spreadsheet sheet (default: `1000`) |
| `max_records_per_table` | int | Maximum records to import per bitable table (default: `1000`) |
**Dependency**: `pip install 'openviking[bot-feishu]'`
**Dependency**: Included by default in `openviking[bot]` installation
**Lark international**: For Lark URLs (`*.larksuite.com`), set `domain` to `https://open.larksuite.com`.
+1 -1
View File
@@ -716,7 +716,7 @@ ollama pull guoxuter/ov_intent_analysis_sft:v7_q8
| `max_rows_per_sheet` | int | 电子表格每个 sheet 最大导入行数(默认 `1000`) |
| `max_records_per_table` | int | 多维表格每个表最大导入记录数(默认 `1000`) |
**依赖**:`pip install 'openviking[bot-feishu]'`
**依赖**:已默认包含在 `openviking[bot]` 安装中
**Lark 国际版**:对于 Lark URL(`*.larksuite.com`),请将 `domain` 设为 `https://open.larksuite.com`。
@@ -7,7 +7,7 @@ Fetches Feishu/Lark cloud documents using the lark-oapi SDK.
This is the DataAccessor layer extracted from FeishuParser.
Note: This accessor requires the `lark-oapi` package.
Install with: pip install 'openviking[bot-feishu]'
Included by default in `openviking[bot]` installation.
"""
import os
@@ -319,8 +319,8 @@ class FeishuAccessor(DataAccessor):
import lark_oapi as lark
except ImportError:
raise ImportError(
"lark-oapi is required for Feishu document parsing. "
"Install it with: pip install 'openviking[bot-feishu]'"
"lark-oapi is required for Feishu document parsing. "
"Install it with: pip install lark-oapi>=1.0.0"
)
config = self._get_config()
app_id = config.app_id or os.getenv("FEISHU_APP_ID", "")
+1 -1
View File
@@ -221,7 +221,7 @@ class FeishuParser(BaseParser):
except ImportError:
raise ImportError(
"lark-oapi is required for Feishu document parsing. "
"Install it with: pip install 'openviking[bot-feishu]'"
"Install it with: pip install lark-oapi>=1.0.0"
)
config = self._get_config()
app_id = config.app_id or os.getenv("FEISHU_APP_ID", "")
+2 -2
View File
@@ -140,7 +140,7 @@ class FeishuOAuthClient:
except ImportError as exc:
raise FeishuTokenRefreshError(
"lark-oapi is required to refresh Feishu user tokens. "
"Install it with: pip install 'openviking[bot-feishu]'",
"Install it with: pip install lark-oapi>=1.0.0",
permanent=True,
) from exc
@@ -197,7 +197,7 @@ class FeishuOAuthClient:
except ImportError as exc:
raise FeishuTokenRefreshError(
"lark-oapi is required to refresh Feishu user tokens. "
"Install it with: pip install 'openviking[bot-feishu]'",
"Install it with: pip install lark-oapi>=1.0.0",
permanent=True,
) from exc
@@ -34,6 +34,7 @@ class OVCLIConfig(BaseModel):
agent_id: Optional[str] = None
timeout: float = 60.0
profile: bool = False
echo_command: Optional[bool] = None
upload: Optional[OVCLIUploadConfig] = None
extra_headers: Optional[Dict[str, str]] = None
+10 -15
View File
@@ -138,7 +138,7 @@ build = [
"wheel",
"build",
]
# vikingbot core dependencies
# vikingbot - all features included
bot = [
"pydantic-settings>=2.0.0",
"websockets>=12.0",
@@ -160,23 +160,18 @@ bot = [
"gradio>=6.6.0",
"py-machineid>=1.0.0",
"mcp>=1.0.0",
]
# vikingbot optional features
bot-langfuse = ["langfuse>=3.0.0"]
bot-telegram = ["python-telegram-bot[socks]>=21.0"]
bot-feishu = ["lark-oapi>=1.0.0"]
bot-dingtalk = ["dingtalk-stream>=0.4.0"]
bot-slack = ["slack-sdk>=3.26.0"]
bot-qq = ["qq-botpy>=1.0.0"]
bot-sandbox = [
# All optional features included by default
"langfuse>=3.0.0",
"python-telegram-bot[socks]>=21.0",
"lark-oapi>=1.0.0",
"dingtalk-stream>=0.4.0",
"slack-sdk>=3.26.0",
"qq-botpy>=1.0.0",
"opensandbox>=0.1.0",
"opensandbox-server>=0.1.0",
"agent-sandbox>=0.0.23",
]
bot-fuse = ["fusepy>=3.0.1"]
bot-opencode = ["opencode-ai>=0.1.0a0"]
bot-full = [
"openviking[bot,bot-langfuse,bot-telegram,bot-feishu,bot-dingtalk,bot-slack,bot-qq,bot-sandbox,bot-fuse,bot-opencode]",
"fusepy>=3.0.1",
"opencode-ai>=0.1.0a0",
]
benchmark = [
"langchain>=1.0.0",