From c675a4c132bce77184c29938089647c26f62908d Mon Sep 17 00:00:00 2001 From: OpenClaw Backup Bot Date: Tue, 21 Apr 2026 11:50:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20embedding=20key=20=E4=BC=98=E5=85=88?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=9C=AC=E5=9C=B0=20trapi=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E9=85=8D=20trapi=20=E5=88=99=E8=AE=A9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- SKILL.md | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c5fcbc6..263909f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,10 @@ OpenClaw 技能(Skill):一键配置 OpenClaw 记忆系统。 | Base URL | `https://lapi.transiglobal.com/v1` | | 模型 | `bge-large-zh-v1.5` | -复用 trapi API Key,无需单独配置 embedding provider。 +### API Key + +- **优先复用**:如本地已配置 trapi provider,自动提取 API Key,无需额外提供 +- **兜底**:如未配置 trapi,用户需提供 trapi Key 或自定义 embedding provider 信息 ## 使用方式 diff --git a/SKILL.md b/SKILL.md index 8c406d4..e301405 100644 --- a/SKILL.md +++ b/SKILL.md @@ -8,18 +8,22 @@ description: | 一键配置 OpenClaw 记忆系统,包含 Memory Search(向量语义搜索)、Dreaming(夜间记忆整理)、Memory Wiki(知识库)三大模块。 -## Embedding 服务信息 +## Embedding 服务信息(默认) - **Provider**:`openai`(OpenAI 兼容格式) - **Base URL**:`https://lapi.transiglobal.com/v1` - **默认模型**:`bge-large-zh-v1.5` -- **说明**:复用 trapi 的 API Key,不需要单独的 embedding provider +- **API Key 来源**:优先复用本地已配置的 trapi provider;如未配置则要求用户提供 ## 前置条件 -1. 用户**必须提供 trapi API Key**(与 trapi provider 使用同一个 Key) -2. OpenClaw 已安装并运行 -3. 本机配置文件为 `openclaw.json`,使用 `gateway config.patch` 写入 +1. OpenClaw 已安装并运行 +2. 本机配置文件为 `openclaw.json`,使用 `gateway config.patch` 写入 +3. Embedding API Key: + - **优先**:检查本地 `models.providers.trapi.apiKey` 是否已配置,已配置则复用 + - **兜底**:如 trapi 未配置,向用户提供两种选择: + - a) 提供 trapi API Key(使用默认 trapi embedding 端点) + - b) 提供其他 embedding provider 信息(provider、baseUrl、apiKey、model) --- @@ -27,7 +31,14 @@ description: | ### 步骤 1:配置 Embedding -向用户索要 trapi API Key。未提供则终止流程。 +**检测 trapi**:先通过 `gateway config.get` 检查 `models.providers.trapi` 是否已存在: + +- **已配置 trapi**:直接从配置中提取 `apiKey`,无需用户额外提供,跳到下一步 +- **未配置 trapi**:向用户说明两种选择: + - a) 提供 trapi API Key → 使用默认配置(baseUrl + bge-large-zh-v1.5) + - b) 提供自定义 embedding provider 信息(需确认 provider、baseUrl、apiKey、model) + +如用户拒绝提供任何 Key,终止流程。 使用 `gateway config.patch` 配置 `agents.defaults.memorySearch`: