Skip to content

feat!: remove deprecated client method aliases and type aliases#179

Draft
jsonbailey wants to merge 1 commit intomainfrom
jb/remove-deprecated-methods
Draft

feat!: remove deprecated client method aliases and type aliases#179
jsonbailey wants to merge 1 commit intomainfrom
jb/remove-deprecated-methods

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

Removes the following deprecated symbols from the launchdarkly-server-sdk-ai package ahead of the next release. Each replacement has existed and been recommended for some time; this PR drops the back-compat shims.

Removed Replacement
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_of with get_ai_metrics_from_response from ldai_openai
LDAIMetricSummary.duration LDAIMetricSummary.duration_ms
Chat class + ldai/chat/ shim package ManagedModel
LDAIAgent type alias AIAgentConfig
LDAIAgentConfig type alias AIAgentConfigRequest
LDAIAgentDefaults type alias AIAgentConfigDefault
Public re-export of AIConfig from ldai AIConfig is now internal-only (still defined as the base class in ldai.models)

The corresponding tests have been updated to call the replacement APIs. The two dedicated track_openai_metrics tests were removed (their behavior is covered by track_metrics_of tests).

BREAKING CHANGE

This is a breaking release. Callers using any of the removed names must migrate to the replacements listed above. The ldai.chat import path is gone entirely — from ldai.chat import Chat will now fail.

Note on evaluation_metric_keys

The plural-form evaluation_metric_keys field on AIJudgeConfig and AIJudgeConfigDefault (and the corresponding evaluationMetricKeys wire output) is intentionally kept for wire-format compatibility with existing LD-side judge configurations. It is not part of this removal.

Test plan

  • make test — full unit test suite (server-ai, langchain, openai) passes (328 tests)
  • make lint — mypy, isort, pycodestyle pass for all three packages

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>
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