The configuration for TensorZero Evaluations should go in the same tensorzero.toml file as the rest of your TensorZero configuration.

[evaluations.evaluation_name]

The evaluations sub-section of the config file defines the behavior of an evaluation in TensorZero. You can define multiple evaluations by including multiple [evaluations.evaluation_name] sections. If your evaluation_name is not a basic string, it can be escaped with quotation marks. For example, periods are not allowed in basic strings, so you can define an evaluation named foo.bar as [evaluations."foo.bar"].
// tensorzero.toml
[evaluations.email-guardrails]
# ...

type

  • Type: Literal "static" (we may add other options here later on)
  • Required: yes

function_name

  • Type: string
  • Required: yes
This should be the name of a function defined in the [functions] section of the gateway config. This value sets which function this evaluation should evaluate when run.

[evaluations.evaluation_name.evaluators.evaluator_name]

The evaluators sub-section defines the behavior of a particular evaluator that will be run as part of its parent evaluation. You can define multiple evaluators by including multiple [evaluations.evaluation_name.evaluators.evaluator_name] sections. If your evaluator_name is not a basic string, it can be escaped with quotation marks. For example, periods are not allowed in basic strings, so you can define includes.jpg as [evaluations.evaluation_name.evaluators."includes.jpg"].
// tensorzero.toml
[evaluations.email-guardrails]
# ...

[evaluations.email-guardrails.evaluators."includes.jpg"]
# ...

[evaluations.email-guardrails.evaluators.check-signature]
# ...

type

  • Type: string
  • Required: yes
Defines the type of the evaluator. TensorZero currently supports the following variant types:
TypeDescription
llm_judgeUse a TensorZero function as a judge
exact_matchEvaluates whether the generated output exactly matches the reference output (skips the datapoint if unavailable).
// tensorzero.toml
[evaluations.email-guardrails.evaluators.check-signature]
# ...
type = "llm_judge"
# ...

type: "exact_match"

type: "llm_judge"