Install
openclaw skills install @thcjp/openai-aiopenclaw skills install @thcjp/openai-ai核心功能: 本技能提供中文交互、化工作流场景等能力。
| 能力 | 免费版 | 付费版 |
|---|---|---|
| 基础功能 | 支持 | 支持 |
| 复杂工作流可视化编排 | 不支持 | 支持 |
| 条件分支与异常重试 | 不支持 | 支持 |
| 定时触发与事件驱动 | 不支持 | 支持 |
| 执行日志与审计追踪 | 不支持 | 支持 |
| 分布式任务调度与负载均衡 | 不支持 | 支持 |
| 场景 | 输入 | 输出 |
|---|---|---|
| 文件操作 | 文件路径与操作参数 | 操作结果与文件元信息 |
| 模型调用 | 输入文本与模型参数 | 模型输出与用量统计 |
| 管OpenAI文件 | 目标数据与配置参数 | 处理结果与执行状态 |
不适用于:需要人工判断的复杂决策场景
clawlink_call_tool --tool "openai_list_assistants" --params '{"limit": 10}'
# ...
clawlink_call_tool --tool "openai_create_chat_completion" --params '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'
# ...
clawlink_call_tool --tool "openai_list_files" --params '{"purpose": "batch"}'
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | string | 否 | llm-provider-ai处理的内容输入 |
| mode | string | 否 | 处理模式, 可选: json/text/markdown, |
| max_retries | integer | 否 | 单步最大重试次数, 默认: 2 |
| skip_steps | array | 否 | 跳过的步骤编号(用于断点续传), 默认: [] |
{
"success": true,
"data": {
"final_result": {
"ai_result": "ai_result_value",
"ai_metadata": "ai_metadata_value",
"ai_status": "ai_status_value"
},
"execution_log": [
{
"step": 1,
"name": "按流程执行",
"status": "completed",
"duration_ms": 1200,
"output_summary": "按流程执行"
},
{
"step": 2,
"name": "按流程执行",
"status": "completed",
"duration_ms": 3500,
"output_summary": "按流程执行"
},
{
"step": 3,
"name": "按流程执行",
"status": "completed",
"duration_ms": 2100,
"output_summary": "按流程执行"
},
{
"step": 4,
"name": "按流程执行",
"status": "completed",
"duration_ms": 800,
"output_summary": "按流程执行"
}
],
"total_duration_ms": 7600,
"gates_passed": 3,
"gates_total": 3
},
"error": null
}
中间产物模板参考: assets/llm-provider-ai_template
| Status / Error | Meaning |
|---|---|
| Tool not found | The tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration llm-provider. |
| Missing connection | llm-provider is not connected. Direct the user to https://claw-link.dev/dashboard?add=llm-provider. |
invalid_request_error | Invalid parameter or model not available. Verify model ID with openai_list_models. |
RateLimitError | Too many requests. Wait and retry with exponential backoff. |
authentication_error | Invalid API key. Reconnect llm-provider at the dashboard. |
| Write rejected | User did not confirm a write action. Always confirm before executing writes. |
Check that the ClawLink plugin is installed:
bash
skill-platform plugins list
If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
If a fresh chat does not help, run:
bash
skill-platform config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
skill-platform gateway restart
After restart, tell the user to send /new again and retry.
llm-provider.clawlink_describe_tool to verify parameter names and types before calling.clawlink_preview_tool first.处理方式: 参考上表中的错误场景说明,按照对应建议进行处理和恢复.
| 依赖项 | 类型 | 是否必需 | 获取方式 |
|---|---|---|---|
| LLM API | API | 必需 | 由Agent内置LLM提供 |
API Key配置方式:
export API_KEY="${API_KEY:?请设置环境变量}"
配置后需重启会话或开启新终端生效。API Key应妥善保管,避免泄露到版本控制系统.
clawlink_call_tool --tool "openai_create_chat_completion" \
--params '{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
"max_tokens": 500
}'
clawlink_call_tool --tool "openai_create_assistant" \
--params '{
"name": "Code Reviewer",
"model": "gpt-4o",
"instructions": "You review code and suggest improvements.",
"tools": [{"type": "code_interpreter"}]
}'
clawlink_call_tool --tool "openai_upload_file" \
--params '{
"file": "@./knowledge.pdf",
"purpose": "assistants"
}'
# ...
clawlink_call_tool --tool "openai_create_vector_store_file" \
--params '{
"vector_store_id": "VS_ID",
"file_id": "FILE_ID"
}'
clawlink_call_tool --tool "openai_create_batch" \
--params '{
"input_file_id": "FILE_ID",
"endpoint": "chat/completions",
"model": "gpt-4o-mini",
"completion_window": "24h"
}'
clawlink_call_tool --tool "openai_create_image" \
--params '{
"model": "dall-e-3",
"prompt": "A minimalist diagram showing the Skill平台 to ClawLink to Provider flow",
"size": "1024x1024",
"n": 1
}'
A: llm-provider AI工具支持多种模型,包括GPT-3、GPT-4、DALL-E等,具体可使用openai_list_models工具查看。
A: 确保API Key安全,避免泄露。使用HTTPS协议进行通信,并定期检查访问日志。
A: llm-provider AI工具支持批量处理,可以通过openai_create_batch工具创建批量任务,高效处理大量数据。
A: 使用openai_create_finetuning_job工具创建微调任务,选择合适的模型和数据集进行训练。
A: llm-provider AI工具提供错误处理机制,如RateLimitError和authentication_error,可根据错误信息进行相应的处理。
| 风险项 | 等级 | 防护措施 | 验证方法 |
|---|---|---|---|
| API Key泄露 | 高 | 使用环境变量存储API Key,避免代码泄露 | 定期检查代码库和版本控制系统 |
| 数据传输安全 | 中 | 使用HTTPS协议进行数据传输 | 使用SSL证书验证 |
| 模型调用错误 | 低 | 设置合理的超时时间和重试机制 | 监控调用日志 |
| 模型滥用 | 中 | 限制模型使用范围,监控使用情况 | 定期审计模型使用记录 |
| 系统漏洞 | 高 | 保持系统更新,使用安全配置 | 定期进行安全扫描 |
| 功能 | 效率提升 | 差异化对比 |
|---|---|---|
| 批量数据处理 | 提升数据处理效率50%以上 | 相比传统方法,llm-provider AI工具支持更复杂的批量处理逻辑 |
| 模型微调 | 提升模型性能10-20% | 相比预训练模型,微调后的模型更适应特定任务 |
| 模型调用 | 提升模型调用效率30%以上 | 支持多种模型和调用方式,满足不同需求 |
| 安全性 | 提升安全性等级 | 提供多种安全措施,保障数据安全和模型调用安全 |
| 可扩展性 | 提升系统可扩展性 | 支持分布式任务调度和负载均衡,适应大规模应用需求 |
| 操作场景 | 手动耗时 | 自动化耗时 | 效率提升 |
|---|---|---|---|
| 文件解析与提取 | 5-10分钟/个 | <5秒/个 | 60-120x |
| 批量文件处理(100个) | 8-16小时 | <5分钟 | 96-192x |
| API调用与响应解析 | 2-3分钟/次 | <1秒/次 | 120-180x |
| 多接口数据聚合 | 15-30分钟 | <10秒 | 90-180x |
| 命令执行与结果收集 | 3-5分钟/次 | <2秒/次 | 90-150x |
| 重复任务批量执行 | 因任务而异 | 线性缩减 | 5-50x |
| 错误排查与修复 | 10-30分钟 | <30秒 | 20-60x |
| 对比维度 | llm-provider AI工具 | 传统手动方式 | 通用脚本工具 |
|---|---|---|---|
| 自动化程度 | 全流程自动 | 完全手动 | 部分自动 |
| 错误处理 | 内置错误恢复 | 依赖人工经验 | 基本try-catch |
| 可复用性 | 参数化配置 | 一次性脚本 | 模板化 |
| 安全合规 | 内置安全检查 | 无安全保障 | 无安全保障 |
| 适用场景 | 管OpenAI文件/助手/向量库/批次/微调/模型资源。Manage llm-p | 通用场景 | 通用场景 |
针对llm-provider AI工具使用中可能遇到的常见问题,提供以下排查方案:
| 错误类型 | 原因分析 | 解决方案 |
|---|---|---|
| API认证失败(401) | API密钥错误或过期 | 检查密钥配置,重新生成token |
| 接口限流(429) | 请求频率超出限制 | 降低调用频率,启用重试退避策略 |
| 响应超时(504) | 网络延迟或服务端负载过高 | 增加超时阈值,检查网络连接 |
| 文件不存在 | 路径错误或文件未创建 | 检查路径拼写,确认文件已生成 |
| 文件格式不支持 | 扩展名不在支持列表中 | 转换为支持的格式后重试 |
| 权限不足 | 当前用户无读写权限 | 检查文件权限,以管理员身份运行 |
| 命令执行失败 | 参数错误或环境依赖缺失 | 检查命令语法,确认依赖已安装 |
| 进程超时 | 命令执行时间过长 | 增加超时设置,优化命令参数 |
| 网络连接失败 | DNS解析失败或防火墙拦截 | 检查网络配置,确认代理设置 |