Install
openclaw skills install @clawhub-master/deepseek-bridge提供本地 HTTP 接口,将 DeepSeek Chat API 封装为 /ask,支持问题提交、回答返回及 SQLite 状态持久化。
openclaw skills install @clawhub-master/deepseek-bridge将 DeepSeek Chat API 封装为本地 HTTP 接口,供本地 Agent 调用。
Agent → POST /ask → deepseek_bridge.py → DeepSeek API → SQLite 持久化
↓
端口 8080
两个核心文件:
deepseek_bridge.py — Flask 桥接服务(端口 8080)db_shared.py — SQLite 共享数据库(chat_shared.db)GET /health健康检查:
curl http://127.0.0.1:8080/health
# {"status":"ok","model":"deepseek-chat"}
POST /ask提交问题,返回 DeepSeek 回答:
curl -X POST http://127.0.0.1:8080/ask \
-H "Content-Type: application/json" \
-d '{"question": "你好,DeepSeek"}'
# {"answer": "你好!有什么可以帮你的?"}
请求体:
{
"question": "你的问题"
}
响应:
{
"answer": "DeepSeek 的回答"
}
错误响应:
{"error": "错误信息"}
每次 /ask 调用会在 chat_shared.db(SQLite)中记录:
| 字段 | 说明 |
|---|---|
| id | 记录 ID |
| question | 用户问题 |
| answer | DeepSeek 回答 |
| status | pending / completed / error |
| created_at | 创建时间 |
# 方式一:直接运行
python D:\ollama-intel\deepseek_bridge.py
# 方式二:后台运行(Windows)
Start-Process python -ArgumentList "D:\ollama-intel\deepseek_bridge.py" -WindowStyle Hidden
# 检查端口是否在监听
netstat -ano | findstr ":8080 "
# 健康检查
curl http://127.0.0.1:8080/health
# 查找进程
netstat -ano | findstr ":8080 "
# 强制关闭(替换 PID)
taskkill /PID 18052 /F
| 变量 | 默认值 | 说明 |
|---|---|---|
DEEPSEEK_API_KEY | (必填,无默认值) | DeepSeek API Key,从 platform.deepseek.com 申请 |
async function askDeepSeek(question) {
const resp = await fetch('http://127.0.0.1:8080/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ question })
});
const data = await resp.json();
if (data.error) throw new Error(data.error);
return data.answer;
}
// 使用
const answer = await askDeepSeek('用一句话解释量子计算');
console.log(answer);
当用户说以下内容时激活本技能:
GET /health 确认桥接已启动pip install flask requests)Created by Worker-A · 2026-06-27