Skip to content

feat(eval): simplify template variables — drop _text suffix, align with industry patterns#839

Merged
christso merged 6 commits intomainfrom
feat/825-template-vars
Mar 29, 2026
Merged

feat(eval): simplify template variables — drop _text suffix, align with industry patterns#839
christso merged 6 commits intomainfrom
feat/825-template-vars

Conversation

@christso
Copy link
Copy Markdown
Collaborator

Closes #825

Summary

Simplifies LLM grader template variables and code grader wire format:

  • {{output}}, {{input}}, {{expected_output}} now resolve to human-readable text (was JSON.stringify'd message arrays)
  • Deprecated _text aliases ({{input_text}}, {{output_text}}, {{expected_output_text}}) still work but emit a stderr warning
  • Removed outputText, inputText, expectedOutputText from CodeGraderInput schema — code graders should extract text from Message.content using getTextContent()
  • Removed EnrichedCodeGraderInput type (no longer needed)
  • Updated default evaluator template to use new variable names
  • Updated prompt-validator to accept both new and deprecated variable names

Breaking Changes

  • CodeGraderInput no longer has outputText, inputText, expectedOutputText fields
  • EnrichedCodeGraderInput type removed
  • Code graders need to extract text from output/input Message arrays directly

Depends on

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 29, 2026

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: f29d165
Status:⚡️  Build in progress...

View logs

christso and others added 6 commits March 29, 2026 04:34
…th industry patterns

- {{output}}, {{input}}, {{expected_output}} now resolve to human-readable
  text instead of JSON.stringify'd message arrays
- Deprecated _text aliases ({{input_text}}, {{output_text}},
  {{expected_output_text}}) still work but emit a stderr warning
- Removed outputText, inputText, expectedOutputText from CodeGraderInput
  schema — code graders should extract text from Message.content using
  getTextContent() from @agentv/core
- Removed EnrichedCodeGraderInput type (no longer needed)
- Updated default evaluator template to use new variable names
- Updated prompt-validator to accept both new and deprecated variable names

Closes #825

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace deprecated _text suffix template variables with their canonical
equivalents: output_text→output, input_text→input,
expected_output_text→expected_output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The hasExpectedOutput check was missing the deprecated alias
EXPECTED_OUTPUT_TEXT, causing templates using only {{ expected_output_text }}
to fail validation with 'Missing required fields'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…emoved text fields

The outputText, inputText, and expectedOutputText fields were removed from
CodeGraderInput. Update all example code graders to extract text from
Message arrays directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…removed outputText

The outputText field was removed from CodeGraderInput. Update the
agentv create assertion template to extract text from output Message
arrays using a getMessageText() helper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@christso christso force-pushed the feat/825-template-vars branch from e822d86 to f29d165 Compare March 29, 2026 04:34
@christso christso merged commit c242e1b into main Mar 29, 2026
1 check was pending
@christso christso deleted the feat/825-template-vars branch March 29, 2026 04:34
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.

feat(eval): simplify template variables — drop _text suffix, align with industry patterns

1 participant