aiconfig-create
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate AI Config
创建AI Config
You're using a skill that will guide you through setting up AI configuration in your application. Your job is to explore the codebase to understand the use case and stack, choose agent vs completion mode, create the config following the right path, and verify it works.
你正在使用一个能引导你在应用中设置AI配置的skill。你的任务是探索代码库以了解使用场景和技术栈,选择Agent模式或Completion模式,遵循正确流程创建配置,并验证其是否可用。
Prerequisites
前提条件
- LaunchDarkly API access token with permission or MCP server
ai-configs:write - LaunchDarkly project (use skill if needed)
aiconfig-projects
- 拥有权限的LaunchDarkly API访问令牌,或MCP服务器
ai-configs:write - LaunchDarkly项目(如有需要,使用skill)
aiconfig-projects
Core Principles
核心原则
- Understand the Use Case First: Know what you're building before choosing a mode
- Choose the Right Mode: Agent mode vs completion mode depends on your framework and needs
- Two-Step Creation: Create config first, then create variations (model, prompts, parameters)
- Verify via API: The agent fetches the config to confirm it was created correctly
- 先理解使用场景:在选择模式前,明确你要构建的内容
- 选择合适的模式:Agent模式与Completion模式的选择取决于你的框架和需求
- 两步创建法:先创建配置,再创建变体(模型、提示词、参数)
- 通过API验证:Agent会获取配置以确认其已正确创建
API Key Detection
API密钥检测
- Check environment variables — ,
LAUNCHDARKLY_API_KEY,LAUNCHDARKLY_API_TOKENLD_API_KEY - Check MCP config — Claude: →
~/.claude/config.jsonmcpServers.launchdarkly.env.LAUNCHDARKLY_API_KEY - Prompt user — Only if detection fails
- 检查环境变量 — 、
LAUNCHDARKLY_API_KEY、LAUNCHDARKLY_API_TOKENLD_API_KEY - 检查MCP配置 — Claude: →
~/.claude/config.jsonmcpServers.launchdarkly.env.LAUNCHDARKLY_API_KEY - 提示用户 — 仅当检测失败时执行
Workflow
工作流程
Step 1: Understand Your Use Case
步骤1:理解你的使用场景
Before creating, identify what you're building:
- What framework? LangGraph, LangChain, CrewAI, OpenAI SDK, Anthropic SDK, custom
- What does the AI need? Just text, or tools/function calling?
- Agent or completion? See decision below
创建前,明确你要构建的内容:
- 使用什么框架? LangGraph、LangChain、CrewAI、OpenAI SDK、Anthropic SDK、自定义框架
- AI需要实现什么功能? 仅生成文本,还是需要工具/函数调用?
- 选择Agent模式还是Completion模式? 参考下方决策指南
Step 2: Choose Agent vs Completion Mode
步骤2:选择Agent模式与Completion模式
| Your Need | Mode |
|---|---|
| Persistent instructions across interactions | Agent |
| LangGraph, CrewAI, AutoGen | Agent |
| Direct OpenAI/Anthropic API calls | Completion |
| Full control of message structure | Completion |
| One-off text generation | Completion |
Both modes support tools. Agent mode: single string. Completion mode: full array.
instructionsmessages| 你的需求 | 模式 |
|---|---|
| 交互过程中保留持久化指令 | Agent |
| 使用LangGraph、CrewAI、AutoGen | Agent |
| 直接调用OpenAI/Anthropic API | Completion |
| 完全控制消息结构 | Completion |
| 一次性文本生成 | Completion |
两种模式均支持工具调用。Agent模式:使用单个字符串;Completion模式:使用完整的数组。
instructionsmessagesStep 3: Create the Config
步骤3:创建配置
Follow API Quick Start for curl examples:
- Create config — (key, name, mode)
POST /projects/{projectKey}/ai-configs - Create variation — (instructions or messages, modelConfigKey, model.parameters)
POST /projects/{projectKey}/ai-configs/{configKey}/variations - Attach tools — After creation, PATCH variation to add tools (see skill)
aiconfig-tools
参考API快速入门中的curl示例:
- 创建配置 — (参数包括key、name、mode)
POST /projects/{projectKey}/ai-configs - 创建变体 — (参数包括instructions或messages、modelConfigKey、model.parameters)
POST /projects/{projectKey}/ai-configs/{configKey}/variations - 关联工具 — 创建完成后,通过PATCH请求为变体关联工具(参考skill)
aiconfig-tools
Step 4: Verify
步骤4:验证
After creation, verify the config:
-
Fetch via API:bash
curl -X GET "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/{configKey}" \ -H "Authorization: {api_token}" -H "LD-API-Version: beta" -
Confirm:
- Config exists with correct mode
- Variations have model names (not "NO MODEL")
- modelConfigKey is set
- Parameters are present
-
Report results:
- ✓ Config created with correct structure
- ✓ Variations have models assigned
- ⚠️ Flag any missing model or parameters
- Provide config URL:
https://app.launchdarkly.com/projects/{projectKey}/ai-configs/{configKey}
创建完成后,验证配置:
-
通过API获取配置:bash
curl -X GET "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/{configKey}" \ -H "Authorization: {api_token}" -H "LD-API-Version: beta" -
确认内容:
- 配置已存在且模式正确
- 变体已分配模型名称(而非“NO MODEL”)
- modelConfigKey已设置
- 参数已配置
-
反馈结果:
- ✓ 配置已创建且结构正确
- ✓ 变体已分配模型
- ⚠️ 标记任何缺失的模型或参数
- 提供配置URL:
https://app.launchdarkly.com/projects/{projectKey}/ai-configs/{configKey}
Important Notes
重要提示
- modelConfigKey must be (e.g.,
{Provider}.{model-id}) for models to show in UIOpenAI.gpt-4o - Tools must be created first (skill), then attached via PATCH
aiconfig-tools - Tools endpoint is , NOT
/ai-tools/ai-configs/tools
- modelConfigKey必须为格式(例如
{Provider}.{model-id}),这样模型才能在UI中显示OpenAI.gpt-4o - 工具必须先创建(使用skill),再通过PATCH请求关联
aiconfig-tools - 工具端点为,而非
/ai-tools/ai-configs/tools
Edge Cases
边缘情况处理
| Situation | Action |
|---|---|
| Config already exists | Ask if user wants to update instead |
| Variation shows "NO MODEL" | PATCH variation with modelConfigKey and model |
| Invalid modelConfigKey | Use values from model-configs API |
| 场景 | 操作 |
|---|---|
| 配置已存在 | 询问用户是否需要更新配置 |
| 变体显示“NO MODEL” | 通过PATCH请求为变体添加modelConfigKey和模型信息 |
| 无效的modelConfigKey | 使用model-configs API返回的有效值 |
What NOT to Do
相关Skill
- Don't create configs without understanding the use case
- Don't skip the two-step process (config then variation)
- Don't try to attach tools during initial creation
- Don't forget modelConfigKey (models won't show)
- — 关联工具前先创建工具
aiconfig-tools - — 添加更多变体用于实验
aiconfig-variations - — 根据经验修改配置
aiconfig-update
Related Skills
参考资料
- — Create tools before attaching
aiconfig-tools - — Add more variations for experimentation
aiconfig-variations - — Modify configs based on learnings
aiconfig-update
- API快速入门
- LaunchDarkly AI Configs 文档
References
—
- API Quick Start
- LaunchDarkly AI Configs Docs
—