foundry_eval_item: Build an evaluation item for model-based graders

View source: R/evals.R

foundry_eval_itemR Documentation

Build an evaluation item for model-based graders

Description

Model-based graders (foundry_grader_label_model() and foundry_grader_score_model()) accept an input list of message-shaped items. Each item has a role and content, and the content may embed template references such as {{item.question}} or {{sample.output_text}} that Azure resolves per row at evaluation time.

Usage

foundry_eval_item(
  content,
  role = c("user", "assistant", "system", "developer")
)

Arguments

content

Character. The message content. May contain {{...}} template references.

role

Character. One of "user", "assistant", "system", or "developer". Defaults to "user".

Value

A named list with role and content, ready to place in a grader input list.

Examples

foundry_eval_item("Grade this answer: {{sample.output_text}}", role = "user")

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.