params become part of the agent’s input, and you can only validate the resulting output response.
Example
This example demonstrates how to pass input parameters to the agent and validate the output. Thepremium_user parameter is passed via params and becomes part of the agent’s input, which can be accessed in the system prompt function.
Eval Configuration
evals.yaml
Agent Implementation
agent.py
Running Evaluations
How It Works
-
Parameters: The
premium_user: Trueparameter is passed viaparamsand becomes part of the agent’s input. -
System Prompt: The
get_system_prompt()function accesses thepremium_uservalue from the input usingget_run_context()and builds the system prompt dynamically. - Output Validation: The output is validated to ensure it contains “10” (the points for premium users).
Evaluation Results
The CLI displays pytest-style output with pass/fail status:Key Features
- Input Parameters: Pass parameters directly to the agent via
params- these become part of the agent’s input - Dynamic System Prompts: Use callable functions for
system_promptto access input parameters and build prompts dynamically - Output Validation: Validate agent responses using output validators - input parameters cannot be validated directly