feat: Add Chat and Judge supporting methods#64
Merged
jsonbailey merged 28 commits intomainfrom Dec 17, 2025
Merged
Conversation
f0dcbc4 to
125bb66
Compare
jsonbailey
requested changes
Dec 10, 2025
jsonbailey
reviewed
Dec 15, 2025
jsonbailey
approved these changes
Dec 17, 2025
edwinokonkwo
added a commit
that referenced
this pull request
Dec 18, 2025
Follows on from #64 Arranging the project structure to align with the other SDK projects
3 tasks
knfreemLD
added a commit
to launchdarkly/go-server-sdk
that referenced
this pull request
Feb 10, 2026
**Requirements** - [X] I have added test coverage for new or changed functionality - [X] I have followed the repository's [pull request submission guidelines](../blob/v5/CONTRIBUTING.md#submitting-pull-requests) - [X] I have validated my changes against all supported platform versions **Related issues** See https://docs.google.com/document/d/1lzYwQqCcTzN_2zkxJZDfJtgUcEJ4jbpx0KSsJ2bRENw/edit?tab=t.0#heading=h.5d8l30brvyuw for context For other SDK implementations, see: - launchdarkly/js-core#1073 - launchdarkly/python-server-sdk-ai#86 & launchdarkly/python-server-sdk-ai#64 **Describe the solution you've provided** Extending the Go SDK to support AI Config evaluations. This includes custom evaluator support as well. This SDK was written with hopes to be congruent with the python and node implementations. Changes were verified by a local app that was created; [the resultant data can be observed in the evaluator metrics for this AI config](https://ld-stg.launchdarkly.com/projects/default/ai-configs/kf-comp-feb-3/monitoring?from_ts=1770094800000&to_ts=1770353999999&env=staging&selected-env=staging&chartTypes=Tokens%2CSatisfaction%2CGenerations%2CTime+to+generate%2CError+rate%2CTime+to+first+token%2CCosts%2CEvaluator+metrics+%28avg%29). **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds new evaluation and metric-tracking paths (including dynamic metric keys and new event payload fields), which could affect analytics correctness and runtime behavior if misconfigured. Changes are well-covered by tests but touch core SDK tracking surfaces. > > **Overview** > Adds **judge-mode support** to AI Configs by extending the config datamodel and builder with `mode`, `evaluationMetricKey`/`evaluationMetricKeys`, and `judgeConfiguration` (with defensive copying to keep configs immutable). > > Introduces `Client.JudgeConfig` to fetch judge configs while preserving `{{message_history}}` / `{{response_to_evaluate}}` placeholders for a second Mustache interpolation pass during evaluation, and adds a new `ldai/judge` package that samples, interpolates, invokes a structured provider, and parses judge responses. > > Extends `Tracker` with `TrackJudgeResponse` to emit evaluation scores as metrics (including optional `judgeConfigKey` in event data), and adds comprehensive tests covering parsing, placeholder preservation, schema generation, sampling, and response validation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 41141b9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
Tracking internally: REL-10772
Summary
This PR puts us in a known state , next step is to split the package structure to follow the structure below