Skip to content

feat: add root-level tools map with customParameters to AI Config types#1295

Draft
jsonbailey wants to merge 6 commits intomainfrom
jb/aic-1935/custom-tool-params
Draft

feat: add root-level tools map with customParameters to AI Config types#1295
jsonbailey wants to merge 6 commits intomainfrom
jb/aic-1935/custom-tool-params

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

  • Adds LDTool interface with name, type?, parameters?, and customParameters? fields
  • Adds tools?: { [toolName: string]: LDTool } to LDAICompletionConfig, LDAICompletionConfigDefault, LDAIAgentConfig, and LDAIAgentConfigDefault
  • Updates LDAIConfigFlagValue and LDAIConfigUtils to parse and propagate the root-level tools map
  • Adds test coverage for tools in both completion and agent configs

Background

The LaunchDarkly backend now includes a root-level tools map (sibling to model) in AI Config flag variations. This is separate from model.parameters.tools[] which is the raw array passable to LLM providers as-is. LLM providers reject unknown properties, so customParameters cannot live inside model.parameters.tools[] — hence the split.

Wire format:

{
  "tools": {
    "web-search-tool": {
      "name": "web-search-tool",
      "type": "function",
      "parameters": { ... },
      "customParameters": { "some-custom-parameter": "some-custom-value" }
    }
  }
}

Note

Supersedes PR #1175 (devin/1773277027-add-tool-instructions-examples) which had the wrong structure (array instead of map, wrong fields key/version/instructions/examples, and targeted main instead of feat/ai-sdk-next-release).

Test plan

  • yarn workspace @launchdarkly/server-sdk-ai test — all existing tests pass, 4 new tests for tools map coverage
  • yarn workspace @launchdarkly/server-sdk-ai build — no TypeScript errors
  • yarn workspace @launchdarkly/server-sdk-ai lint — no lint errors

🤖 Generated with Claude Code

jsonbailey and others added 6 commits April 14, 2026 16:46
Adds LDTool interface and tools map (keyed by tool name) to completion
and agent config types. The root-level tools map is distinct from
model.parameters.tools[] which remains passable to LLM providers as-is.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31655 bytes
Compressed size limit: 34000
Uncompressed size: 112792 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179375 bytes
Compressed size limit: 200000
Uncompressed size: 829982 bytes

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 37169 bytes
Compressed size limit: 38000
Uncompressed size: 204305 bytes

Base automatically changed from feat/ai-sdk-next-release to main April 20, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant