feat!: Remove deprecated LDAIClient method aliases#1370
Merged
Conversation
Removes five deprecated method aliases from LDAIClient and its implementation. None had any callers in source, tests, or examples. - config -> use completionConfig - agent -> use agentConfig - agents -> use agentConfigs - createChat -> use createModel - initChat -> use createModel BREAKING CHANGE: The LDAIClient methods config, agent, agents, createChat, and initChat have been removed. Callers must migrate to completionConfig, agentConfig, agentConfigs, and createModel respectively. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
61f7502 to
f00e054
Compare
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
… RunnerResult Delete the unused `chat` API surface (`ChatResponse` type and the `api/chat/` directory) and its barrel re-export. `Judge.evaluateMessages` remains (per the AI online evals spec) but now takes a `RunnerResult` parameter, reading the model output from `response.content` rather than `response.message.content`. Test fixtures are updated to match. BREAKING CHANGE: The `ChatResponse` type is removed from the public API. `Judge.evaluateMessages(messages, response, samplingRatio?)` now accepts a `RunnerResult` instead of a `ChatResponse`. Callers should pass the result returned by a `Runner` (or the runner-shaped portion of a `ManagedResult`) directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the provider-specific tracker entry points `LDAIConfigTracker.trackOpenAIMetrics` and `LDAIConfigTracker.trackVercelAISDKGenerateTextMetrics`, along with the `createOpenAiUsage` and `createVercelAISDKTokenUsage` helpers and their barrel re-exports. Customers using these providers should use the dedicated provider packages (`@launchdarkly/server-sdk-ai-openai`, `@launchdarkly/server-sdk-ai-vercel`) and let the SDK track metrics through `Runner` / `trackMetricsOf`. Tests that covered the removed surface are removed. `trackBedrockConverseMetrics` and `createBedrockTokenUsage` are retained: there is no dedicated Bedrock provider package yet, so the manual helper is still the only path for Bedrock users. BREAKING CHANGE: `LDAIConfigTracker.trackOpenAIMetrics` and `LDAIConfigTracker.trackVercelAISDKGenerateTextMetrics` are removed. The `createOpenAiUsage` and `createVercelAISDKTokenUsage` exports are also removed. Migrate to the OpenAI / Vercel provider packages, or use `trackMetricsOf` with a custom metrics extractor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The openai-observability example README listed `trackVercelAISDKGenerateTextMetrics` as an available tracker method. That API has been removed, so drop the row from the methods table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
keelerm84
approved these changes
May 12, 2026
…and LDAIJudgeConfigDefault BREAKING CHANGE: the deprecated `evaluationMetricKeys` (plural) field is no longer present on `LDAIJudgeConfigDefault` or `LDAIJudgeConfig`. Developers must use the singular `evaluationMetricKey`. The wire-read fallback in `LDAIConfigUtils` still accepts the plural in flag variations so old LD-side configs continue to resolve a metric key, but the SDK normalises to the singular before exposing it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking internally: AIC-1663
Summary
feat!: Remove
LDAIClient.config— useLDAIClient.completionConfiginsteadfeat!: Remove
LDAIClient.agent— useLDAIClient.agentConfiginsteadfeat!: Remove
LDAIClient.agents— useLDAIClient.agentConfigsinsteadfeat!: Remove
LDAIClient.createChat— useLDAIClient.createModelinsteadfeat!: Remove
LDAIClient.initChat— useLDAIClient.createModelinsteadfeat!: Remove
ChatResponsetype and theapi/chatmodule — useRunnerResultfromapi/modelinsteadfeat!: Change
Judge.evaluateMessagesparameter type fromChatResponsetoRunnerResult(method retained per AI SDK spec Requirement 1.1.3)feat!: Remove
evaluationMetricKeys(plural) field fromLDAIJudgeConfigandLDAIJudgeConfigDefault— useevaluationMetricKey(singular) instead; the wire-read fallback still accepts the plural in flag variations for backward compatibilityfeat!: Remove
LDAIConfigTracker.trackOpenAIMetrics— usetracker.trackMetricsOf(getAIMetricsFromResponse, fn)from@launchdarkly/server-sdk-ai-openaiinsteadfeat!: Remove
LDAIConfigTracker.trackVercelAISDKGenerateTextMetrics— usetracker.trackMetricsOf(getAIMetricsFromResponse, fn)from@launchdarkly/server-sdk-ai-vercelinsteadfeat!: Remove
createOpenAiUsagehelper — no longer needed;trackMetricsOfextracts usagefeat!: Remove
createVercelAISDKTokenUsagehelper — no longer needed;trackMetricsOfextracts usageRemoves five deprecated method aliases from the
LDAIClientinterface andLDAIClientImpl. The non-deprecated replacements have been available for some time and there are no remaining callers in source, tests, or examples.LDAIClient.configcompletionConfigLDAIClient.agentagentConfigLDAIClient.agentsagentConfigsLDAIClient.createChatcreateModelLDAIClient.initChatcreateModelThe
TRACK_USAGE_CREATE_CHATanalytics event key ($ld:ai:usage:create-chat) is intentionally retained — it is a wire-format identifier emitted bycreateModeland is out of scope for this PR.The deprecated
evaluationMetricKeys(plural) field has been removed fromLDAIJudgeConfigandLDAIJudgeConfigDefault. The wire-read fallback inLDAIConfigUtilsstill accepts the plural in flag variations so older LD-side configs continue to resolve a metric key — the SDK normalises to the singularevaluationMetricKeybefore exposing it.LDAIConfigTracker.trackBedrockConverseMetricsandcreateBedrockTokenUsageare kept because there is no Bedrock provider package yet. They will be removed once a Bedrock provider lands.BREAKING CHANGE
Callers of the removed
LDAIClientmethods must migrate to the replacements listed above.Test plan
yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/server-sdk-ai' run buildsucceedsyarn workspace @launchdarkly/server-sdk-ai test— 14 suites / 236 tests passingyarn workspace @launchdarkly/server-sdk-ai lint— cleanNote
Medium Risk
Medium risk because this is a breaking public API change: multiple deprecated
LDAIClient/tracker methods and types are removed and callers must migrate to the newer APIs. Runtime logic changes are mostly deletions, but any downstream usage will fail to compile or run if not updated.Overview
Removes several deprecated public API surfaces from the server AI SDK:
LDAIClient.config,agent,agents,createChat, andinitChatare deleted from both the interface andLDAIClientImpl, leavingcompletionConfig,agentConfig,agentConfigs, andcreateModelas the supported entry points.Eliminates the
api/chatmodule andChatResponsetype, updatingJudge.evaluateMessagesto accept aRunnerResultand readresponse.contentinstead.Simplifies observability/metrics tracking by removing
LDAIConfigTracker.trackOpenAIMetrics,trackVercelAISDKGenerateTextMetrics, and thecreateOpenAiUsage/createVercelAISDKTokenUsagehelpers, pushing usage extraction to provider-specifictrackMetricsOfextractors; tests and docs are updated accordingly.Reviewed by Cursor Bugbot for commit 8c05eb3. Bugbot is set up for automated code reviews on this repo. Configure here.