Skip to content

feat: Implement optimization code paths and functionality for initial release#140

Open
andrewklatzke wants to merge 32 commits intomainfrom
aklatzke/AIC-2263/sdk-dx-improvements
Open

feat: Implement optimization code paths and functionality for initial release#140
andrewklatzke wants to merge 32 commits intomainfrom
aklatzke/AIC-2263/sdk-dx-improvements

Conversation

@andrewklatzke
Copy link
Copy Markdown
Contributor

@andrewklatzke andrewklatzke commented Apr 17, 2026

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

This PR encapsulates all previous changes in the chain of optimization PRs that were broken up into smaller pieces. Consolidating here so that we can have a single commit/release of the package. The PRs were independently reviewed and approved.

Describe the solution you've provided

See:

#116
#117
#119
#122
#127
#128
#130
#135
#139


Note

High Risk
Large new feature set that adds iteration control flow, judge evaluation logic, and writes to LaunchDarkly REST APIs (including auto-committing config changes) gated by LAUNCHDARKLY_API_KEY.

Overview
Implements the initial end-to-end optimization workflow for the Python AI optimization package, replacing the previous placeholder client with a full OptimizationClient that can iteratively generate agent variations, score them with LLM judges, and optionally validate “passing” candidates on additional samples.

Adds a new typed public surface (OptimizationOptions, GroundTruthOptimizationOptions, OptimizationFromConfigOptions, OptimizationContext, judge/tool/response dataclasses) plus prompt-building and utility helpers for structured JSON parsing and safe variable interpolation/restoration.

Introduces a lightweight LaunchDarkly REST client (LDApiClient) used by optimize_from_config to fetch optimization configs and persist per-iteration results (status, scores, latency, token usage), and supports optional auto-commit of the winning variation back to the AI Config (with generated unique variation keys via coolname).

Reviewed by Cursor Bugbot for commit 937542a. Bugbot is set up for automated code reviews on this repo. Configure here.

…ype, remove required context_choices argument and default to anon
@andrewklatzke andrewklatzke requested a review from a team as a code owner April 17, 2026 17:18
Comment thread packages/optimization/src/ldai_optimization/util.py Outdated
Comment thread packages/optimization/src/ldai_optimization/prompts.py
Comment thread packages/optimization/src/ldai_optimization/client.py
Comment thread packages/optimization/src/ldai_optimization/client.py Outdated
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 937542a. Configure here.

Comment thread packages/optimization/src/ldai_optimization/util.py
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