← 返回 Skills 市场
dolphins1123

open-webui-api 操作技能

作者 ken · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
275
总下载
0
收藏
1
当前安装
4
版本数
在 OpenClaw 中安装
/install claw-openwebui-api
功能描述
整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。
使用说明 (SKILL.md)

---

name: Claw_OpenWebUI_API slug: claw-openwebui-api author: kuanlin.huang version: 1.0.3 description: | 整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。 triggers:

  • "openwebui"

  • "rag"

  • "知識庫"

  • "上傳文件"

  • "搜尋知識庫" metadata: openclaw: emoji: "🦞" requires: env: ["OPENWEBUI_URL", "OPENWEBUI_API_KEY"] bins: ["python3", "requests"] install:

    • id: pip kind: pip package: requests label: Install requests library

---

Claw_OpenWebUI_API

讓 OpenClaw 調用 Open WebUI 的 RAG 知識庫 API。

功能

  • 📤 上傳文件到知識庫
  • 🔍 搜尋知識庫
  • 💬 對話時自動引用知識庫
  • 📊 列出知識庫內容

前置需求

  1. Open WebUI 已安裝並運行
  2. 已建立知識庫
  3. 取得 API Token

安裝

# 安裝技能
git clone https://github.com/你的帳號/Claw\\\_OpenWebUI\\\_API.git \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API

設定

環境變數(必須設定)

# 必需設定環境變數
export OPENWEBUI\\\_URL="http://你的伺服器IP:3000"
export OPENWEBUI\\\_API\\\_KEY="你的API\\\_Token"

取得 API Token

  1. 登入 Open WebUI
  2. 進入設定 → 帳號
  3. 產生 API Token

或設定檔

編輯 \\\~/.openclaw/openclaw.json

{
  "skills": {
    "Claw\\\_OpenWebUI\\\_API": {
      "url": "http://192.168.0.176:3000",
      "api\\\_key": "your\\\_api\\\_token"
    }
  }
}

使用方式

🚀 OpenClaw 指令(自然語法)

安裝技能後,可以直接用自然語法呼叫:

# 設定環境變數(只需設定一次)
小蝦,設定 OPENWEBUI\\\_URL 為 http://127.0.0.1:3000
小蝦,設定 OPENWEBUI\\\_API\\\_KEY 為 your-jwt-token

# 上傳檔案到知識庫
小蝦,上傳 note.txt 到知識庫 test3
小蝦,把 report.pdf 上傳到知識庫 mydocs

# 列出知識庫
小蝦,列出所有知識庫
小蝦,有哪些知識庫?

# 查詢檔案
小蝦,查詢上傳的檔案列表

# 對話(自動引用知識庫)
小蝦,用 Qwen3-4B 問關於 test3 的內容

📝 Bash 指令(直接執行)

# 設定環境變數
export OPENWEBUI\\\_URL="http://127.0.0.1:3000"
export OPENWEBUI\\\_API\\\_KEY="your-jwt-token"

# 列出知識庫
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh list-knowledge

# 上傳檔案到知識庫(需指定知識庫名稱)
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh upload-rag /path/to/file.txt test3

# 發送聊天
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh chat "Qwen3-4B-Instruct-2507-4bit" "你好"

📜 Python 指令(可選)

# 上傳 PDF 文件
python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/upload.py --file /path/to/document.pdf

# 上傳多個文件
python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/upload.py --file file1.pdf --file file2.docx

搜尋知識庫

python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/search.py --query "關於 OpenClaw 的設定"

對話(知識庫增強)

python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/chat.py --message "如何安裝 OpenClaw?"

API 端點

方法 端點 功能
GET /api/v1/models 列出模型
POST /api/v1/files/upload 上傳檔案
GET /api/v1/files 列出已上傳檔案
POST /api/v1/rag 搜尋知識庫

架構

Claw\\\_OpenWebUI\\\_API/
├── SKILL.md
├── scripts/
│   ├── upload.py      # 上傳文件
│   ├── search.py      # 搜尋知識庫
│   ├── chat.py        # 對話+知識庫
│   └── list\\\_files.py  # 列出檔案
└── README.md

範例

Python 程式碼

import requests

OPENWEBUI\\\_URL = "http://192.168.0.176:3000"
API\\\_KEY = "your\\\_token"

headers = {
    "Authorization": f"Bearer {API\\\_KEY}"
}

# 搜尋知識庫
def search\\\_knowledge(query):
    response = requests.post(
        f"{OPENWEBUI\\\_URL}/api/v1/rag",
        headers=headers,
        json={"query": query}
    )
    return response.json()

# 上傳檔案
def upload\\\_file(file\\\_path):
    with open(file\\\_path, 'rb') as f:
        files = {'file': f}
        response = requests.post(
            f"{OPENWEBUI\\\_URL}/api/v1/files/upload",
            headers=headers,
            files=files
        )
    return response.json()

常見問題

Q: 需要認證嗎?

A: 是的,需要從 Open WebUI 取得 API Token

Q: 支援哪些檔案格式?

A: PDF、Word、Excel、PPT、TXT、Markdown 等

Q: 如何取得 API Token?

A: 登入 Open WebUI → 設定 → 帳號 → API Token

授權

MIT License

---

Author: kuanlin.huang Version: 1.0.3

安全使用建议
What to check before installing: - This skill appears to do what it says: talk to an Open WebUI instance, upload/list files, and query RAG. There is no sign of exfiltration to unknown endpoints in the code — network calls are only made to OPENWEBUI_URL. - Fix or confirm environment/dependency declarations: you must set OPENWEBUI_URL and OPENWEBUI_API_KEY (the skill will not work without them). Also ensure python3 and the requests package are installed. The bash wrapper uses curl and jq — install those (or avoid using the bash wrapper) or the script will fail. - The package metadata is inconsistent (some manifests claim no env vars, meta.json shows different version, requires.bins lists a Python package as a binary). Treat this as sloppy packaging rather than proof of malice, but ask the author to correct the manifests or run the code in a sandbox first. - Security hygiene: only point OPENWEBUI_URL at servers you trust (prefer local or LAN instances). Treat the API key like any JWT/secret: do not reuse a high-privilege token if you can create a scoped token. If unsure, run the scripts manually in a controlled environment to verify behavior before granting the skill to an autonomous agent. - If you want higher assurance, request the publisher to: (1) fix manifest (declare OPENWEBUI_API_KEY as primaryEnv), (2) declare required binaries (curl, jq, python3), and (3) provide a canonical install instruction or packaged release.
功能分析
Type: OpenClaw Skill Name: claw-openwebui-api Version: 1.0.3 The skill bundle is a legitimate integration for the Open WebUI API, allowing the agent to manage knowledge bases and upload files. All scripts (claw-openwebui.sh and the Python scripts in /scripts) perform standard REST API operations using user-provided environment variables for authentication and endpoint configuration. No evidence of data exfiltration, obfuscation, or malicious prompt injection was found; the code logic is transparent and aligns with the stated purpose.
能力评估
Purpose & Capability
The scripts and SKILL.md clearly implement Open WebUI RAG actions and legitimately need OPENWEBUI_URL and OPENWEBUI_API_KEY. However registry-level metadata at the top of the package summary said 'Required env vars: none' while SKILL.md and _meta.json declare OPENWEBUI_URL and OPENWEBUI_API_KEY. The requires.bins entry lists ['python3','requests'] which is incoherent (requests is a Python package, not a binary). The bash script uses curl and jq but neither is declared as required. These mismatches mean the declared requirements do not reliably represent what the skill actually needs to operate.
Instruction Scope
The SKILL.md and included scripts limit actions to contacting the Open WebUI endpoint, listing/uploading files, creating knowledge collections, and invoking chat/search endpoints. They require reading local files when uploading (expected). The instructions do not instruct the agent to read unrelated system files or exfiltrate data to other endpoints. Overall the runtime behavior stays within the stated purpose, but the README/SKILL.md instruct users to clone and set environment variables with explicit examples that point to local or LAN URLs.
Install Mechanism
There is no high-risk download/install step: SKILL.md suggests installing the Python requests package (pip). The package includes shell and Python scripts (no remote install from arbitrary hosts). However the bundled metadata/install information is inconsistent (SKILL.md has a pip entry; registry said no install spec). Also the bash script depends on curl and jq (not installed by pip) — missing declared dependencies may lead to runtime failures or accidental behavior when fallback occurs.
Credentials
The code legitimately needs OPENWEBUI_URL and OPENWEBUI_API_KEY (a single API credential) and no other secrets. But the package metadata presented in multiple places is inconsistent: some places list no required env vars, others list the two vars. The skill does not request unrelated credentials, which is good, but the inconsistent declaration (and missing primaryEnv setting) is a red flag that manifests were not maintained correctly and could confuse automated permission checks.
Persistence & Privilege
The skill is not always:true, is user-invocable, and does not request elevated/persistent system-wide privileges. It does not modify other skills or system configs. Autonomy (disable-model-invocation:false) is the platform default and is not, by itself, an additional concern here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claw-openwebui-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claw-openwebui-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- Added Bash script claw-openwebui.sh for direct shell usage and automation. - Expanded installation and usage instructions to include both OpenClaw natural language commands and new Bash command-line examples. - Updated documentation to reflect Bash usage and clarify setup steps. - Changed skill author to kuanlin.huang and incremented version to 1.0.3.
v1.0.2
- Author name updated from 南極磷蝦 to Ken. - Version number updated to 1.0.2. - Unified variable and path formatting by adding extra backslashes for escaping. - Minor edits to example values and comments for clarity. - No changes to functionality or API usage.
v1.0.1
- No functional changes; documentation formatting and minor text adjustments only. - Installation section was removed from the documentation. - Example default host/IP changed from LAN IP to localhost (127.0.0.1) in some config code blocks. - No code or feature changes in this release.
v1.0.0
- Initial release of Claw_OpenWebUI_API. - Integrates Open WebUI RAG knowledge base API for automatic file upload and knowledge retrieval. - Provides scripts to upload documents, search the knowledge base, and enhanced chat features using knowledge base content. - Requires environment variables OPENWEBUI_URL and OPENWEBUI_API_KEY. - Supports various document formats, including PDF, Word, Excel, PPT, TXT, and Markdown.
元数据
Slug claw-openwebui-api
版本 1.0.3
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 4
常见问题

open-webui-api 操作技能 是什么?

整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 275 次。

如何安装 open-webui-api 操作技能?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claw-openwebui-api」即可一键安装,无需额外配置。

open-webui-api 操作技能 是免费的吗?

是的,open-webui-api 操作技能 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

open-webui-api 操作技能 支持哪些平台?

open-webui-api 操作技能 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 open-webui-api 操作技能?

由 ken(@dolphins1123)开发并维护,当前版本 v1.0.3。

💬 留言讨论