Skip to content

Commit 2f9854c

Browse files
committed
fix: enable second judge interpolation
1 parent 5d48342 commit 2f9854c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/sdk/server-ai/src/LDAIClientImpl.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,15 @@ export class LDAIClientImpl implements LDAIClient {
232232
this._ldClient.track(TRACK_JUDGE_INIT, context, key, 1);
233233

234234
try {
235+
// Add standard judge variables to incoming variables
236+
const extendedVariables = {
237+
...variables,
238+
message_history: '{{message_history}}',
239+
response_to_evaluate: '{{response_to_evaluate}}',
240+
};
241+
235242
// Retrieve the judge AI Config using the new judge method
236-
const judgeConfig = await this.judge(key, context, defaultValue, variables);
243+
const judgeConfig = await this.judge(key, context, defaultValue, extendedVariables);
237244

238245
// Return undefined if the configuration is disabled
239246
if (!judgeConfig.enabled || !judgeConfig.tracker) {

0 commit comments

Comments
 (0)