diff --git a/skills.json b/skills.json index 5eefd12..22527bb 100644 --- a/skills.json +++ b/skills.json @@ -18,7 +18,7 @@ "name": "aiconfig-tools", "description": "Guide for giving your AI agents capabilities through tools. Helps you identify what your AI needs to do, create tool definitions, and attach them in a way that makes sense for your framework.", "path": "skills/ai-configs/aiconfig-tools", - "version": "0.2.0", + "version": "0.3.0", "compatibility": "Requires LaunchDarkly API token with ai-tool permissions." }, { diff --git a/skills/ai-configs/aiconfig-create/references/api-quickstart.md b/skills/ai-configs/aiconfig-create/references/api-quickstart.md index 85290fb..cb5ad8b 100644 --- a/skills/ai-configs/aiconfig-create/references/api-quickstart.md +++ b/skills/ai-configs/aiconfig-create/references/api-quickstart.md @@ -93,13 +93,9 @@ curl -X PATCH \ -H "Content-Type: application/json" \ -H "LD-API-Version: beta" \ -d '{ - "model": { - "parameters": { - "tools": [ - {"key": "search-database", "version": 1} - ] - } - } + "tools": [ + {"key": "search-database", "version": 1} + ] }' ``` diff --git a/skills/ai-configs/aiconfig-tools/SKILL.md b/skills/ai-configs/aiconfig-tools/SKILL.md index a8ff757..41254fd 100644 --- a/skills/ai-configs/aiconfig-tools/SKILL.md +++ b/skills/ai-configs/aiconfig-tools/SKILL.md @@ -4,7 +4,7 @@ description: Guide for giving your AI agents capabilities through tools. Helps y compatibility: Requires LaunchDarkly API token with ai-tool permissions. metadata: author: launchdarkly - version: "0.2.0" + version: "0.3.0" --- # AI Config Tools @@ -45,7 +45,7 @@ What should the AI be able to do? Follow [API Quick Start](references/api-quickstart.md): 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) +2. **Schema format** — Use JSON Schema format (type: object, properties, required) 3. **Clear descriptions** — The LLM uses the description to decide when to call ### Step 3: Attach to Variation @@ -56,7 +56,7 @@ Tools cannot be attached during config creation. PATCH the variation: PATCH /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey} ``` -Body: `{"model": {"parameters": {"tools": [{"key": "tool-name", "version": 1}]}}}` +Body: `{"tools": [{"key": "tool-name", "version": 1}]}` See [API Quick Start](references/api-quickstart.md) for full curl example. @@ -71,7 +71,7 @@ See [API Quick Start](references/api-quickstart.md) for full curl example. ```bash GET /projects/{projectKey}/ai-configs/{configKey}/variations/{variationKey} ``` - Check `model.parameters.tools` includes your tool key. + Check the `tools` array includes your tool key. 3. **Report results:** - ✓ Tool created with valid schema @@ -88,7 +88,7 @@ LangGraph, CrewAI, AutoGen often generate schemas from function definitions. You |-----------|--------| | Tool already exists (409) | Use existing or create with different key | | Wrong endpoint | Use `/ai-tools`, not `/ai-configs/tools` | -| Schema invalid | Use OpenAI function format | +| Schema invalid | Use JSON Schema format (type: object, properties, required) | ## What NOT to Do diff --git a/skills/ai-configs/aiconfig-tools/references/api-quickstart.md b/skills/ai-configs/aiconfig-tools/references/api-quickstart.md index 9549dc4..ebc0db4 100644 --- a/skills/ai-configs/aiconfig-tools/references/api-quickstart.md +++ b/skills/ai-configs/aiconfig-tools/references/api-quickstart.md @@ -2,7 +2,7 @@ Create and manage tools using the LaunchDarkly API. -**Endpoint:** `https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools` +**Endpoint:** `https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools` Do NOT use `/ai-configs/tools` — that endpoint does not exist. ## Create a Tool @@ -16,23 +16,24 @@ curl -X POST \ "key": "search-database", "description": "Search the customer database", "schema": { - "type": "function", - "function": { - "name": "search_database", - "description": "Search for records", - "parameters": { - "type": "object", - "properties": { - "query": {"type": "string", "description": "Search query"}, - "limit": {"type": "integer", "default": 10} - }, - "required": ["query"] - } - } + "type": "object", + "properties": { + "query": {"type": "string", "description": "Search query"}, + "limit": {"type": "integer", "description": "Max results to return"} + }, + "required": ["query"] } }' ``` +### Optional Fields + +| Field | Description | +|-------|-------------| +| `maintainerId` | User ID of the tool maintainer | +| `maintainerTeamKey` | Team key for tool ownership | +| `customParameters` | Additional custom parameters as JSON object | + ## Attach to Variation ```bash @@ -42,13 +43,9 @@ curl -X PATCH \ -H "Content-Type: application/json" \ -H "LD-API-Version: beta" \ -d '{ - "model": { - "parameters": { - "tools": [ - {"key": "search-database", "version": 1} - ] - } - } + "tools": [ + {"key": "search-database", "version": 1} + ] }' ``` @@ -70,19 +67,17 @@ curl -X GET \ ## Schema Format -Use OpenAI function calling format: +Use JSON Schema format: ```json { - "type": "function", - "function": { - "name": "function_name", - "description": "What the LLM uses to decide when to call", - "parameters": { - "type": "object", - "properties": { ... }, - "required": [ ... ] - } - } + "type": "object", + "properties": { + "query": {"type": "string", "description": "Search query"}, + "limit": {"type": "integer", "description": "Max results"} + }, + "required": ["query"] } ``` + +The tool `key` and `description` are set at the top level, not inside the schema.