aiconfig-tools
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI Config Tools
AI Config 工具
You're using a skill that will guide you through adding capabilities to your AI agents through tools (function calling). Your job is to identify what your AI needs to do, create tool definitions, attach them to variations, and verify they work.
你正在使用一项技能,它将引导你通过工具(函数调用)为你的AI Agent添加能力。你的任务是确定AI需要执行的操作、创建工具定义、将其附加到变体上,并验证它们能否正常工作。
Prerequisites
前提条件
- LaunchDarkly API token with permission
/*:ai-tool/* - Existing AI Config (use skill first)
aiconfig-create - Tools endpoint: (NOT
/ai-tools)/ai-configs/tools
- 拥有权限的LaunchDarkly API令牌
/*:ai-tool/* - 已存在的AI Config(请先使用技能)
aiconfig-create - 工具端点:(不要使用
/ai-tools)/ai-configs/tools
Core Principles
核心原则
- Start with Capabilities: Think about what your AI needs to do before creating tools
- Framework Matters: LangGraph/CrewAI often auto-generate schemas; OpenAI SDK needs manual schemas
- Create Before Attach: Tools must exist before you can attach them to variations
- Verify: The agent fetches tools and config to confirm attachment
- 从能力出发:在创建工具之前,先思考AI需要完成什么任务
- 框架至关重要:LangGraph/CrewAI通常会自动生成模式;OpenAI SDK则需要手动编写模式
- 先创建再附加:工具必须先存在,才能将其附加到变体上
- 验证有效性:Agent会获取工具和配置以确认是否成功附加
API Key Detection
API密钥检测
- Check environment variables — ,
LAUNCHDARKLY_API_KEY,LAUNCHDARKLY_API_TOKENLD_API_KEY - Check MCP config — Claude config if applicable
- Prompt user — Only if detection fails
- 检查环境变量 — 、
LAUNCHDARKLY_API_KEY、LAUNCHDARKLY_API_TOKENLD_API_KEY - 检查MCP配置 — 若适用,检查Claude配置
- 提示用户 — 仅当检测失败时执行此操作
Workflow
工作流程
Step 1: Identify Needed Capabilities
步骤1:确定所需能力
What should the AI be able to do?
- Query databases, call APIs, perform calculations, send notifications
- Check what exists in the codebase (API clients, functions)
- Consider framework: LangGraph/LangChain auto-generate schemas; direct SDK needs manual schemas
AI应该能够完成哪些任务?
- 查询数据库、调用API、执行计算、发送通知
- 检查代码库中已有的内容(API客户端、函数)
- 考虑框架:LangGraph/LangChain会自动生成模式;直接使用SDK则需要手动编写模式
Step 2: Create Tools
步骤2:创建工具
Follow API Quick Start:
- Create tool — with key, description, schema
POST /projects/{projectKey}/ai-tools - Schema format — Use OpenAI function calling format (type, function.name, function.parameters)
- Clear descriptions — The LLM uses the description to decide when to call
遵循API快速入门:
- 创建工具 — 发送请求,包含key、description和schema
POST /projects/{projectKey}/ai-tools - 模式格式 — 使用OpenAI函数调用格式(type、function.name、function.parameters)
- 清晰的描述 — LLM会根据描述决定何时调用该工具
Step 3: Attach to Variation
步骤3:附加到变体
Tools cannot be attached during config creation. PATCH the variation:
bash
PATCH /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}Body:
{"model": {"parameters": {"tools": [{"key": "tool-name", "version": 1}]}}}See API Quick Start for full curl example.
无法在配置创建期间附加工具。请对变体执行PATCH操作:
bash
PATCH /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}请求体:
{"model": {"parameters": {"tools": [{"key": "tool-name", "version": 1}]}}}完整的curl示例请参考API快速入门。
Step 4: Verify
步骤4:验证
-
Verify tool exists:bash
GET /projects/{projectKey}/ai-tools/{toolKey} -
Verify attached to variation:bash
GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}Checkincludes your tool key.model.parameters.tools -
Report results:
- ✓ Tool created with valid schema
- ✓ Tool attached to variation
- ⚠️ Flag any issues
-
验证工具是否存在:bash
GET /projects/{projectKey}/ai-tools/{toolKey} -
验证是否已附加到变体:bash
GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}检查是否包含你的工具key。model.parameters.tools -
报告结果:
- ✓ 工具已创建且模式有效
- ✓ 工具已成功附加到变体
- ⚠️ 标记所有存在的问题
Orchestrator Note
编排器注意事项
LangGraph, CrewAI, AutoGen often generate schemas from function definitions. You still need to create tools in LaunchDarkly and attach keys to variations so the SDK knows what's available.
LangGraph、CrewAI、AutoGen通常会根据函数定义生成模式。你仍需要在LaunchDarkly中创建工具,并将其key附加到变体上,这样SDK才能知道哪些工具可用。
Edge Cases
边缘情况
| Situation | Action |
|---|---|
| Tool already exists (409) | Use existing or create with different key |
| Wrong endpoint | Use |
| Schema invalid | Use OpenAI function format |
| 场景 | 操作 |
|---|---|
| 工具已存在(409错误) | 使用现有工具或使用不同key创建新工具 |
| 错误的端点 | 使用 |
| 模式无效 | 使用OpenAI函数格式 |
What NOT to Do
禁止操作
- Don't use — it doesn't exist
/ai-configs/tools - Don't try to attach tools during config creation
- Don't skip clear tool descriptions (LLM needs them)
- 不要使用— 该端点不存在
/ai-configs/tools - 不要尝试在配置创建期间附加工具
- 不要跳过清晰的工具描述(LLM需要这些描述来决定调用时机)
Related Skills
相关技能
- — Create config before attaching tools
aiconfig-create - — Manage variations
aiconfig-variations
- — 在附加工具之前创建配置
aiconfig-create - — 管理变体
aiconfig-variations
References
参考资料
- API Quick Start
- API快速入门