feat: Implement optimization code paths and functionality for initial release#140
Open
andrewklatzke wants to merge 32 commits intomainfrom
Open
feat: Implement optimization code paths and functionality for initial release#140andrewklatzke wants to merge 32 commits intomainfrom
andrewklatzke wants to merge 32 commits intomainfrom
Conversation
…ype, remove required context_choices argument and default to anon
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 937542a. Configure here.
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.

Requirements
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
OptimizationClientthat 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 byoptimize_from_configto 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 viacoolname).Reviewed by Cursor Bugbot for commit 937542a. Bugbot is set up for automated code reviews on this repo. Configure here.