Install
openclaw skills install @krx1511/difyopenclaw skills install @krx1511/difyDify是开源的LLM应用开发平台,支持快速构建AI应用、工作流和Agent。
# 克隆最新版本
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
# 启动
cd dify/docker
cp .env.example .env
docker compose up -d
访问 http://localhost/install 初始化管理员账户。
所有API请求需要在Header中携带API Key:
Authorization: Bearer {api_key}
POST /v1/workflows/run
Content-Type: application/json
{
"inputs": {
"query": "翻译这段文字..."
},
"response_mode": "blocking", # 或 "streaming"
"user": "user-123"
}
POST /v1/chat-messages
Content-Type: application/json
{
"query": "你好",
"response_mode": "streaming",
"user": "user-123",
"conversation_id": "" # 首次为空,后续传入返回的conversation_id
}
工作流中添加 Knowledge Retrieval 节点,选择知识库。