Skip to content

Conversation

@knfreemLD
Copy link
Contributor

@knfreemLD knfreemLD commented Jan 22, 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

Node version of launchdarkly/python-server-sdk-ai#86

Describe the solution you've provided

See launchdarkly/python-server-sdk-ai#86

Describe alternatives you've considered

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context about the pull request here.


Note

Switches judge evaluation to a single metric key while preserving backward compatibility.

  • API/types: Add optional evaluationMetricKey to LDAIJudgeConfig(Default) and deprecate array usage; examples updated in LDAIClient.ts
  • Config utils: Map flag values to prefer evaluationMetricKey and fallback to first valid entry in evaluationMetricKeys; include key when converting defaults
  • Schema: EvaluationSchemaBuilder now builds response schema for one required metric key
  • Judge behavior: Determine metric via _getEvaluationMetricKey; require messages; parse/validate only that key; mark success: false if missing/invalid; updated warnings
  • Client/tests: LDAIClientImpl and Judge tests updated for new key semantics and legacy fallbacks; added tests for invalid/whitespace keys and sampling
  • Tracking: Add tests for trackJudgeResponse handling single/multiple eval metrics

Written by Cursor Bugbot for commit 288ee6d. This will update automatically on new commits. Configure here.

@knfreemLD knfreemLD requested a review from a team as a code owner January 22, 2026 20:17
@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 171289 bytes
Compressed size limit: 200000
Uncompressed size: 798441 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23330 bytes
Compressed size limit: 25000
Uncompressed size: 81328 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19322 bytes
Compressed size limit: 20000
Uncompressed size: 99589 bytes

@joker23 joker23 requested review from a team and jsonbailey January 22, 2026 21:23
let { success } = response.metrics;

const evals = this._parseEvaluationResponse(response.data);
const evals = this._parseEvaluationResponse(response.data, evaluationMetricKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't call this out in python and but we used evals originally to support multiple metric keys in a judge response. We can likely flatten this structure out now that there will be only one. Doesn't need to be done in this PR but I think its more of a push to make the breaking change sooner than later so less people are relying on this code. We might consider adding the eval directly to the judge response and marking evals as deprecated.

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.

5 participants