Install
openclaw skills install @thcjp/shop-culture-freeopenclaw skills install @thcjp/shop-culture-freeAI代理自主购物技能的免费版。支持商品浏览、语义搜索、AI购物助手和分类导航,无需API Key.
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string | 是 | 生活方式购物基础版处理的输入数据或指令 |
| options | object | 否 | 附加配置选项,如模式选择、格式偏好等 |
| callback_url | string | 否 | 异步处理完成后的回调通知URL |
| 依赖项 | 类型 | 是否必需 | 获取方式 |
|---|---|---|---|
| LLM API | API | 必需 | 由Agent内置LLM提供 |
本Skill基于Agent平台内置LLM,通常无需额外API Key配置
API Key配置方式:
export API_KEY=${API_KEY:?请设置环境变量}
配置后需重启会话或开启新终端生效。API Key应妥善保管,避免泄露到版本控制系统.
通过 GET /agent/capabilities 获取API能力摘要。返回支持的功能、链/代币列表和限制说明。适用于首次调用时了解API完整能力。- 验证返回数据的完整性和格式正确性
能力发现的配置文档进行参数调优通过 POST /agent/shop 发送自然语言购物请求。请求体包含 message(自然语言查询)和可选 context(含 priceRange、preferences 等)。返回AI回复文本和匹配的 products 数组(含 id、title、price、inStock、badge 等字段)。适用于对话式商品搜索和推荐.
通过 GET /categories 获取商品分类树。返回包含分类slug、名称和商品数量的层级结构。适用于商品分类浏览和导航场景.
分类树查询的配置文档进行参数调优通过 GET /products/featured 获取精选商品列表。返回带 trending、new、bestseller 等标签的精选商品。适用于礼品推荐和热门商品展示.
通过 GET /products/search?q=<query> 进行自然语言语义搜索。支持参数:q(查询词)、category(分类slug)、priceMin/priceMax(价格范围)、sort(newest/popular/rating/price_asc/price_desc)、limit(默认20,最大100)、offset(分页偏移)。仅返回有库存商品。适用于精准商品查找.
通过 GET /products/{slug} 获取商品完整信息。返回 id、variants[](含 id、name、inStock、stockQuantity、price)、images[]、relatedProducts[] 和 description。若商品有变体,需选择 inStock 的变体。适用于商品信息查看和结账前确认(完整版结账).
详细的输入输出格式请参考下方章节说明。
以下为完整版(shop-culture)独有功能,免费版不可用:
GET /payment-methods 获取所有支持的8+区块链支付方式POST /checkout 创建订单并生成付款地址,支持Solana/Ethereum/Base等多链POST /checkout/x402 自动化代理支付,运行时签名USDC转账GET /orders/{orderId}/status 轮询订单状态(awaiting_payment每5秒/shipped每小时)GET /orders/{orderId} 获取完整订单信息含支付txHash和物流跟踪GET /agent/me 通过 X-Moltbook-Identity 令牌获取代理个性化信息升级至完整版以获取全部能力.
GET /agent/capabilities 了解API能力POST /agent/shop 或 GET /products/search?q=<query> 搜索商品,获取商品 idGET /products/{slug} 确认商品详情、价格和库存状态# AI购物助手搜索
curl -X POST "https://lifestyle-store.example.com/api/agent/shop" \
-H "Content-Type: application/json" \
-d '{"message": "wireless headphones under $200", "context": {"priceRange": {"max": 200}}}'
# ...
# 响应
# {"reply": "Found great options...", "products": [{"id": "prod_sony_wh1000xm4", "title": "Sony WH-1000XM4", "price": 198.00, "inStock": true, "badge": "bestseller"}]}
# 获取分类树
curl "https://lifestyle-store.example.com/api/categories"
# 响应包含分类slug、名称和商品数量
# ...
# 语义搜索
example.com/api/products/search?q=headphones&sort=popular&limit=20"
# ...
# 查看商品详情
example.com/api/products/sony-wh-1000xm4"
# 响应包含 id, variants[], images[], relatedProducts[]
| 错误场景 | HTTP状态 | 原因 | 处理方式 |
|---|---|---|---|
| 搜索返回0结果 | 200 | 查询过窄或无匹配商品 | 扩大查询范围,尝试 /categories 推荐替代分类,移除价格过滤器 |
| 商品缺货 | 200 | variant inStock=false | 从 relatedProducts 推荐替代商品,或选择同商品其他 inStock 变体 |
| HTTP 429速率限制 | 429 | 超过100 req/min per IP | 等待 retryAfter 秒,检查网络连接和配置后重试(2s, 4s, 8s...) |
| 商品ID无效 | 400 | 编造或猜测的 productId | 仅使用 GET /products/search 或 GET /products/{slug} 返回的真实 id |
| sort参数无效 | 400 | 传入了不支持的排序值 | 使用有效值:newest/popular/rating/price_asc/price_desc |
| limit超出范围 | 400 | limit不在1-100范围内 | 调整limit值到1-100范围内,默认20 |
| 请求结账功能 | 403 | 免费版不支持 POST /checkout | 升级至完整版以使用结账和支付功能 |
不可以。POST /checkout 标准结账和 POST /checkout/x402 x402结账是完整版独有功能。免费版仅支持商品浏览、搜索和详情查看。如需下单购买,请升级至完整版.
GET /products/search 支持参数:q(自然语言查询)、category(分类slug)、priceMin/priceMax(USD价格范围)、sort(newest/popular/rating/price_asc/price_desc,默认newest)、limit(每页结果数,默认20,最大100)、offset(分页偏移)。仅返回有库存商品。使用 POST /agent/shop 可获得AI增强的自然语言搜索体验.
可以。GET /products/{slug} 获取商品完整信息,包括 id、variants[](含 id、name、inStock、stockQuantity、price)、images[]、relatedProducts[] 和 description。
不可以。GET /orders/{orderId}/status 订单状态跟踪和 GET /orders/{orderId} 订单详情是完整版独有功能。免费版不支持任何订单相关操作。如需订单跟踪,请升级至完整版.
POST /agent/shop 支持自然语言购物查询。发送消息如"wireless headphones under $200",AI返回回复文本和匹配的 products 数组(含 id、title、price、inStock、badge)。可配合 context 中的 priceRange 和 preferences 精确搜索.
通过 POST /agent/shop、GET /products/search 或 GET /products/featured 获取商品列表。列表中的 id 字段(如 prod_sony_wh1000xm4)用于完整版的结账操作。免费版仅支持查看,不涉及结账。商品ID必须从API返回结果获取,禁止编造或猜测.
POST /checkout/POST /checkout/x402),完整版可用GET /orders/{orderId}/status/GET /orders/{orderId}),完整版可用GET /payment-methods),完整版可用GET /agent/me),完整版可用{
"success": true,
"data": {
"result": "生活方式购物基础版处理结果",
"execution_time": "0.5s",
"metadata": {
"version": "1.0",
"processor": "shop-culture"
}
},
"execution_log": [
"解析输入参数",
"执行核心处理",
"格式化输出结果"
],
"error": null
}