feat: implement additional config optimization api fields#196
Open
andrewklatzke wants to merge 3 commits into
Open
feat: implement additional config optimization api fields#196andrewklatzke wants to merge 3 commits into
andrewklatzke wants to merge 3 commits into
Conversation
Contributor
Author
|
Now additionally includes the content from here (fix): #197 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 509240f. 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
Describe the solution you've provided
We added first class support for some fields on the UI --
This PR pulls them into the SDK. token/latency optimization are using their previous paths for now in this PR. Rather than the regex approach we just use the flags from the API now. The latency/cost optimization paths will be updated in a subsequent PR.
Describe alternatives you've considered
The initial implementation of these two code paths for optimizations were kind of hacky to begin with (just using a dictionary to look up words that might mean they want to do it). This was the intended solution.
Note
Medium Risk
Changes when latency/cost gates and judge templates apply (explicit flags vs inferred text) and alters config-judge loading and auto-commit gating, which can shift optimization outcomes for existing runs.
Overview
Wires LaunchDarkly agent optimization API fields into the Python SDK:
latencyOptimization,tokenOptimization, andautoCommiton remote configs, plus optionalvariation_keyonOptimizationOptions/GroundTruthOptimizationOptionsto start from a specific AI config variation (REST fetch; requires API key andproject_key).Latency and token behavior no longer infer goals from acceptance-statement keyword regexes. Gates, judge prompt augmentations, variation prompts, and model-pricing warnings now key off
latency_optimizationandtoken_optimizationbooleans (from options or API). When unset/false, those paths stay off.Config judges resolve via raw flag
variation()and local{{key}}interpolation (includingmessage_history/response_to_evaluate) instead ofLDAIClient.judge_config. System-only judge templates get an auto-built user turn.optimize_from_configmaps the new API fields into built options; auto-commit runs only when both the fetched config’sautoCommitand caller options allow it. Tests drop regex helpers and cover the new flags, judge path, andvariation_keyvalidation.Reviewed by Cursor Bugbot for commit 509240f. Bugbot is set up for automated code reviews on this repo. Configure here.