Skip to content

feat: implements template/raw methods for fetching configs#204

Open
andrewklatzke wants to merge 1 commit into
mainfrom
aklatzke/AIC-2843/raw-config-method
Open

feat: implements template/raw methods for fetching configs#204
andrewklatzke wants to merge 1 commit into
mainfrom
aklatzke/AIC-2843/raw-config-method

Conversation

@andrewklatzke

@andrewklatzke andrewklatzke commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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

https://launchdarkly.atlassian.net/jira/software/c/projects/AIC/boards/2045?selectedIssue=AIC-2843

Describe the solution you've provided

Implements three methods:

  • completion_config_template
  • agent_config_template
  • judge_config_template

To mirror the base names. Each of these retrieves the config without running the interpolation process.

Describe alternatives you've considered

Alternatively users can use the base .variation method to retrieve the config, but then things like typing are foisted onto the consumer rather than the SDK itself. We're opting to add a method so that users still receive the niceties (tracker, types).

Additional context

Add any other context about the pull request here.


Note

Low Risk
Additive SDK surface with default interpolation unchanged; behavior change is isolated to new template methods and optional interpolate=False paths.

Overview
Adds completion_config_template, agent_config_template, and judge_config_template on LDAIClient so callers get the same typed configs and trackers as the existing *_config APIs, but with Mustache placeholders left unrendered in message content / instructions (including judge reserved {{message_history}} / {{response_to_evaluate}} when using the judge template path).

Internal evaluation now accepts an interpolate flag (default true) so __evaluate skips chevron rendering when false; the template methods call with variables=None and interpolate=False. Each template method emits a dedicated $ld:ai:usage:*-config-template track event.

New test_config_template.py covers placeholder preservation, parity with rendered configs, tracking, and defaults.

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

@andrewklatzke andrewklatzke requested a review from a team as a code owner June 25, 2026 18:41
@andrewklatzke andrewklatzke requested a review from jsonbailey June 25, 2026 18:42
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.

2 participants