diff --git a/en/use/knowledge-base.md b/en/use/knowledge-base.md index b1f9e1d..a3996fe 100644 --- a/en/use/knowledge-base.md +++ b/en/use/knowledge-base.md @@ -1,4 +1,3 @@ - # AstrBot Knowledge Base > [!TIP] @@ -14,8 +13,23 @@ Currently, AstrBot supports embedding vector services compatible with OpenAI API Click on the provider card above to enter the configuration page and fill in the configuration. +> [!NOTE] +> **OpenAI Embedding API Base URL** +> - OpenAI Embedding automatically appends `/v1` at request time. For example, if you enter `https://api.example.com`, the actual request URL will be `https://api.example.com/v1`. +> - If your API Base URL already contains `/v1`, there's no need to add it again; the system handles this automatically. +> +> **Gemini Embedding API Base URL** +> - Use `https://generativelanguage.googleapis.com` without manually adding `/v1beta`. + After completing the configuration, click Save. +### Automatic Vector Dimension Detection + +When creating an embedding model provider, AstrBot automatically detects the model's vector dimension. The system probes the dimension through actual API requests, so you don't need to fill it in manually. + +> [!TIP] +> If automatic detection fails, please check that your API Key and API Base URL are correctly configured, and that your network is accessible. + ## Configuring Reranker Model (Optional) A reranker model can improve the precision of final retrieval results to some extent. @@ -54,6 +68,6 @@ In the configuration file, you can specify different knowledge bases for differe 3. Click on BAAI:BGE-M3 (as of 2025-06-02, this model is free on this platform). 4. Find the API integration guide and apply for a Key. 5. Fill in the AstrBot OpenAI Embedding model provider configuration: - 1. API Key is the PPIO API Key you just applied for - 2. embedding api base: enter `https://api.ppinfra.com/v3/openai` - 3. model: enter the model you selected, in this example `baai/bge-m3`. + 1. API Key is the PPIO API Key you just applied for + 2. embedding api base: enter `https://api.ppinfra.com/v3/openai` + 3. model: enter the model you selected, in this example `baai/bge-m3`. \ No newline at end of file diff --git a/zh/use/knowledge-base.md b/zh/use/knowledge-base.md index d79336c..4eade92 100644 --- a/zh/use/knowledge-base.md +++ b/zh/use/knowledge-base.md @@ -15,8 +15,23 @@ 点击上面的提供商卡片进入配置页面,填写配置。 +> [!NOTE] +> **OpenAI Embedding API Base URL 说明** +> - OpenAI Embedding 会在请求时自动补上 `/v1` 后缀。例如,您填写 `https://api.example.com`,实际请求地址为 `https://api.example.com/v1`。 +> - 如果您的 API Base URL 已经包含 `/v1`,无需重复添加,系统会自动处理。 +> +> **Gemini Embedding API Base URL 说明** +> - 建议填写 `https://generativelanguage.googleapis.com`,无需手动添加 `/v1beta`。 + 配置完成后,点击保存。 +### 向量维度自动检测 + +创建嵌入模型提供商时,AstrBot 会自动检测模型的向量维度。系统会通过实际请求探测模型的维度信息,无需手动填写。 + +> [!TIP] +> 如果自动检测失败,请检查 API Key 和 API Base URL 是否正确配置,以及网络是否通畅。 + ## 配置重排序模型(可选) 重排序模型可以一定程度上提高最终召回结果的精度。 @@ -55,6 +70,6 @@ AstrBot 支持多知识库管理。在聊天时,您可以**自由指定知识 3. 点击 BAAI:BGE-M3 (截止至 2025-06-02,该模型在该平台免费)。 4. 找到 API 接入指南,申请 Key。 5. 填写 AstrBot OpenAI Embedding 模型提供商配置: - 1. API Key 为刚刚申请的 PPIO 的 API Key - 2. embedding api base 填写 `https://api.ppinfra.com/v3/openai` - 3. model 填写你选择的模型,此例子中为 `baai/bge-m3`。 + 1. API Key 为刚刚申请的 PPIO 的 API Key + 2. embedding api base 填写 `https://api.ppinfra.com/v3/openai` + 3. model 填写你选择的模型,此例子中为 `baai/bge-m3`。 \ No newline at end of file