aiconfig-tools

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI 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
    /*:ai-tool/*
    permission
  • Existing AI Config (use
    aiconfig-create
    skill first)
  • Tools endpoint:
    /ai-tools
    (NOT
    /ai-configs/tools
    )
  • 拥有
    /*:ai-tool/*
    权限的LaunchDarkly API令牌
  • 已存在的AI Config(请先使用
    aiconfig-create
    技能)
  • 工具端点:
    /ai-tools
    不要使用
    /ai-configs/tools

Core Principles

核心原则

  1. Start with Capabilities: Think about what your AI needs to do before creating tools
  2. Framework Matters: LangGraph/CrewAI often auto-generate schemas; OpenAI SDK needs manual schemas
  3. Create Before Attach: Tools must exist before you can attach them to variations
  4. Verify: The agent fetches tools and config to confirm attachment
  1. 从能力出发:在创建工具之前,先思考AI需要完成什么任务
  2. 框架至关重要:LangGraph/CrewAI通常会自动生成模式;OpenAI SDK则需要手动编写模式
  3. 先创建再附加:工具必须先存在,才能将其附加到变体上
  4. 验证有效性:Agent会获取工具和配置以确认是否成功附加

API Key Detection

API密钥检测

  1. Check environment variables
    LAUNCHDARKLY_API_KEY
    ,
    LAUNCHDARKLY_API_TOKEN
    ,
    LD_API_KEY
  2. Check MCP config — Claude config if applicable
  3. Prompt user — Only if detection fails
  1. 检查环境变量
    LAUNCHDARKLY_API_KEY
    LAUNCHDARKLY_API_TOKEN
    LD_API_KEY
  2. 检查MCP配置 — 若适用,检查Claude配置
  3. 提示用户 — 仅当检测失败时执行此操作

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:
  1. Create tool
    POST /projects/{projectKey}/ai-tools
    with key, description, schema
  2. Schema format — Use OpenAI function calling format (type, function.name, function.parameters)
  3. Clear descriptions — The LLM uses the description to decide when to call
遵循API快速入门
  1. 创建工具 — 发送
    POST /projects/{projectKey}/ai-tools
    请求,包含key、description和schema
  2. 模式格式 — 使用OpenAI函数调用格式(type、function.name、function.parameters)
  3. 清晰的描述 — 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:验证

  1. Verify tool exists:
    bash
    GET /projects/{projectKey}/ai-tools/{toolKey}
  2. Verify attached to variation:
    bash
    GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
    Check
    model.parameters.tools
    includes your tool key.
  3. Report results:
    • ✓ Tool created with valid schema
    • ✓ Tool attached to variation
    • ⚠️ Flag any issues
  1. 验证工具是否存在
    bash
    GET /projects/{projectKey}/ai-tools/{toolKey}
  2. 验证是否已附加到变体
    bash
    GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey}
    检查
    model.parameters.tools
    是否包含你的工具key。
  3. 报告结果
    • ✓ 工具已创建且模式有效
    • ✓ 工具已成功附加到变体
    • ⚠️ 标记所有存在的问题

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

边缘情况

SituationAction
Tool already exists (409)Use existing or create with different key
Wrong endpointUse
/ai-tools
, not
/ai-configs/tools
Schema invalidUse OpenAI function format
场景操作
工具已存在(409错误)使用现有工具或使用不同key创建新工具
错误的端点使用
/ai-tools
,而非
/ai-configs/tools
模式无效使用OpenAI函数格式

What NOT to Do

禁止操作

  • Don't use
    /ai-configs/tools
    — it doesn't exist
  • Don't try to attach tools during config creation
  • Don't skip clear tool descriptions (LLM needs them)
  • 不要使用
    /ai-configs/tools
    — 该端点不存在
  • 不要尝试在配置创建期间附加工具
  • 不要跳过清晰的工具描述(LLM需要这些描述来决定调用时机)

Related Skills

相关技能

  • aiconfig-create
    — Create config before attaching tools
  • aiconfig-variations
    — Manage variations
  • aiconfig-create
    — 在附加工具之前创建配置
  • aiconfig-variations
    — 管理变体

References

参考资料

  • API Quick Start
  • API快速入门