feat!: remove deprecated client method aliases and type aliases#179
Merged
Conversation
Remove the following deprecated symbols ahead of the next release: - LDAIClient.config() -> use completion_config() - LDAIClient.create_chat() -> use create_model() - LDAIClient.agent() -> use agent_config() - LDAIClient.agents() -> use agent_configs() - LDAIConfigTracker.track_openai_metrics() -> use track_metrics_of with get_ai_metrics_from_response from ldai_openai - LDAIMetricSummary.duration -> use duration_ms - Chat class and ldai/chat/ shim package -> use ManagedModel - LDAIAgent type alias -> use AIAgentConfig - LDAIAgentConfig type alias -> use AIAgentConfigRequest - LDAIAgentDefaults type alias -> use AIAgentConfigDefault - AIConfig public re-export -> internal base class only BREAKING CHANGE: All deprecated method aliases, type aliases, and the ldai.chat shim package are removed. Migrate to the documented replacements listed above. Note: The plural-form ``evaluation_metric_keys`` field on AIJudgeConfig and AIJudgeConfigDefault is intentionally kept for wire-format compatibility with existing LD-side judge configurations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37bd61e to
d65f30c
Compare
keelerm84
approved these changes
May 11, 2026
…and AIJudgeConfigDefault The plural `evaluation_metric_keys` field is removed from both `AIJudgeConfig` and `AIJudgeConfigDefault`. Defaults should only set the singular `evaluation_metric_key`. The client read path still accepts the plural `evaluationMetricKeys` from a variation payload and falls back to its first element when the singular is not set, so older flag values continue to resolve a metric key. BREAKING CHANGE: `evaluation_metric_keys` is no longer a field on `AIJudgeConfig` or `AIJudgeConfigDefault`. Construct these dataclasses with `evaluation_metric_key` (singular) instead. The wire-format `evaluationMetricKeys` plural is still read from variations for backward compatibility with older AI configs and is mapped onto the singular field on the returned `AIJudgeConfig`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e50041e. Configure here.
Merged
jsonbailey
pushed a commit
that referenced
this pull request
May 14, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-server-sdk-ai: 0.20.0</summary> ## [0.20.0](launchdarkly-server-sdk-ai-0.19.0...launchdarkly-server-sdk-ai-0.20.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Remove deprecated client method aliases and type aliases ([#179](#179)) * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Strip legacy judge messages on direct judge_config() path ([#174](#174)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) * Remove stale ManagedModel message management and AgentGraphResult type ([#170](#170)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * Remove deprecated client method aliases and type aliases ([#179](#179)) ([20df94b](20df94b)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) ### Bug Fixes * Remove stale ManagedModel message management and AgentGraphResult type ([#170](#170)) ([7d6ad23](7d6ad23)) * Strip legacy judge messages on direct judge_config() path ([#174](#174)) ([b7db754](b7db754)) </details> <details><summary>launchdarkly-server-sdk-ai-langchain: 0.7.0</summary> ## [0.7.0](launchdarkly-server-sdk-ai-langchain-0.6.0...launchdarkly-server-sdk-ai-langchain-0.7.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) </details> <details><summary>launchdarkly-server-sdk-ai-openai: 0.6.0</summary> ## [0.6.0](launchdarkly-server-sdk-ai-openai-0.5.0...launchdarkly-server-sdk-ai-openai-0.6.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) ### Bug Fixes * Always return ModelSettings from _build_model_settings ([#169](#169)) ([6d1ce4c](6d1ce4c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR only updates release metadata (versions/changelogs/provenance) with no functional code changes, though it publishes breaking-change API notes for consumers. > > **Overview** > **Release-only update** bumping package versions: `launchdarkly-server-sdk-ai` to `0.20.0`, LangChain provider to `0.7.0`, and OpenAI provider to `0.6.0`. > > Updates `.release-please-manifest.json`, `pyproject.toml` versions, SDK `__version__`, provenance docs, and adds new changelog entries documenting the breaking API renames/type tightenings included in these releases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a15b48e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.

Summary
feat!: remove
LDAIClient.config— useLDAIClient.completion_configinsteadfeat!: remove
LDAIClient.create_chat— useLDAIClient.create_modelinsteadfeat!: remove
LDAIClient.agent— useLDAIClient.agent_configinsteadfeat!: remove
LDAIClient.agents— useLDAIClient.agent_configsinsteadfeat!: remove
LDAIConfigTracker.track_openai_metrics— usetracker.track_metrics_of(get_ai_metrics_from_response, fn)fromlaunchdarkly-server-sdk-ai-openaiinsteadfeat!: remove
LDAIMetricSummary.duration— useLDAIMetricSummary.duration_msinsteadfeat!: remove
Chatclass and theldai.chatmodule — use the managed-runner / provider model runners insteadfeat!: remove
LDAIAgentalias — useAIAgentConfiginsteadfeat!: remove
LDAIAgentConfigalias — useAIAgentConfiginsteadfeat!: remove
LDAIAgentDefaultsalias — useAIAgentConfigDefaultinsteadfeat!: remove public
AIConfigre-export — internal-only; useAICompletionConfig/AIAgentConfig/AIJudgeConfiginsteadfeat!: remove
evaluation_metric_keys(plural) field fromAIJudgeConfigDefaultandAIJudgeConfig— useevaluation_metric_key(singular) instead; the read path still accepts the plural in flag variations for backward compatibilityRemoves the following deprecated symbols from the
launchdarkly-server-sdk-aipackage ahead of the next release. Each replacement has existed and been recommended for some time; this PR drops the back-compat shims.LDAIClient.config()LDAIClient.completion_config()LDAIClient.create_chat()LDAIClient.create_model()LDAIClient.agent()LDAIClient.agent_config()LDAIClient.agents()LDAIClient.agent_configs()LDAIConfigTracker.track_openai_metrics()LDAIConfigTracker.track_metrics_ofwithget_ai_metrics_from_responsefromldai_openaiLDAIMetricSummary.durationLDAIMetricSummary.duration_msChatclass +ldai/chat/shim packageLDAIAgenttype aliasAIAgentConfigLDAIAgentConfigtype aliasAIAgentConfigLDAIAgentDefaultstype aliasAIAgentConfigDefaultAIConfigfromldaiAIConfigis now internal-only (still defined as the base class inldai.models)evaluation_metric_keys(plural) field onAIJudgeConfig/AIJudgeConfigDefaultevaluation_metric_key(singular)The corresponding tests have been updated to call the replacement APIs. The two dedicated
track_openai_metricstests were removed (their behavior is covered bytrack_metrics_oftests).BREAKING CHANGE
This is a breaking release. Callers using any of the removed names must migrate to the replacements listed above. The
ldai.chatimport path is gone entirely —from ldai.chat import Chatwill now fail.Note on
evaluation_metric_keysThe plural-form
evaluation_metric_keysfield is removed from bothAIJudgeConfigandAIJudgeConfigDefault.to_dict()now only emits the singularevaluationMetricKey. To preserve backward compatibility with older LD-side judge flag variations that still set the plural, the read path inclient.py(_extract_evaluation_metric_key, lines 219–232) falls back toevaluationMetricKeys[0]when only the plural is present. New configs cannot set the plural in code, but existing flag values continue to resolve correctly to the singularevaluation_metric_key.Test plan
make test— full unit test suite (server-ai, langchain, openai) passes (328 tests)make lint— mypy, isort, pycodestyle pass for all three packagesNote
Medium Risk
This is a breaking change that removes previously deprecated public APIs and re-exports, so downstream consumers will fail at import/runtime until migrated. Behavior is largely unchanged, but the surface-area reduction could impact integrations that relied on the deprecated names.
Overview
Removes multiple deprecated, backward-compatibility shims from
launchdarkly-server-sdk-ai, tightening the public API surface.Public exports and aliases were dropped, including
ldai.chat.Chat,LDAIClient.config/create_chat/agent/agents,LDAIConfigTracker.track_openai_metrics,LDAIMetricSummary.duration, and legacy type aliases likeLDAIAgent*plus theAIConfigre-export.Unit tests were updated accordingly to use
completion_config,create_model,agent_config/agent_configs, andduration_ms, and the dedicatedtrack_openai_metricstests were removed.Reviewed by Cursor Bugbot for commit e50041e. Bugbot is set up for automated code reviews on this repo. Configure here.