Skip to content

fix: Modernize shopping assistant to current Node AI SDK 0.20#3

Open
jsonbailey wants to merge 1 commit into
mainfrom
jb/aic-2383/modernize-to-current-ai-sdk
Open

fix: Modernize shopping assistant to current Node AI SDK 0.20#3
jsonbailey wants to merge 1 commit into
mainfrom
jb/aic-2383/modernize-to-current-ai-sdk

Conversation

@jsonbailey
Copy link
Copy Markdown

Summary

The example was pinned to @launchdarkly/[email protected] (multiple major releases behind) and every API it used has since been renamed or removed. This PR brings it forward to 0.20.x:

  • Replace removed aiClient.config(...) with completionConfig(...)
  • Replace removed aiConfig.tracker.trackOpenAIMetrics(...) with aiConfig.createTracker() + tracker.trackMetricsOf(getAIMetricsFromResponse, ...) from @launchdarkly/server-sdk-ai-openai
  • Fix empty {} fallback to { enabled: false } (the current LDAICompletionConfigDefault requires enabled)
  • Bump pins to current majors

Refs AIC-2383. Part of the AI Configs docs/example modernization sweep tracked in python-agent-work/all-docs-review.md.

Test plan

  • tsc --noEmit passes
  • Smoke-run the CLI against a real OpenAI key + AI Config to confirm the path through trackMetricsOf reports correctly

🤖 Generated with Claude Code

- shoppingAssistant.ts: aiClient.config(...) -> completionConfig(...); replace aiConfig.tracker.trackOpenAIMetrics(...) with aiConfig.createTracker() + tracker.trackMetricsOf(getAIMetricsFromResponse, ...) from @launchdarkly/server-sdk-ai-openai; fix empty {} fallback to { enabled: false }
- package.json: bump @launchdarkly/server-sdk-ai 0.6.0 -> ^0.20.0; add @launchdarkly/server-sdk-ai-openai ^0.6.0
- README: update prose to describe the provider-package pattern

Refs AIC-2383

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@jsonbailey jsonbailey marked this pull request as ready for review May 14, 2026 21:09
@jsonbailey jsonbailey requested a review from andrewklatzke May 14, 2026 21:09
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.

2 participants