Mapping of evaluator input fields to data source fields.
The keys represent the field names expected by the evaluator (e.g., "input", "output", "reference"), and the values specify how to extract those fields from your data structure.
Supports:
"fieldName""user.profile.name""items[0].id""$.items[*].id"(data) => data.customField.toUpperCase()// Map evaluator fields to your data structure
const context: BindingContext<MyDataType> = {
inputMapping: {
input: "userQuery", // Maps "input" to "userQuery" field
reference: "context", // Maps "reference" to "context" field
output: "modelResponse", // Maps "output" to "modelResponse" field
},
};
Context for binding an evaluator with input mapping configuration.
This type defines the structure for binding an evaluator to a specific data shape by mapping the evaluator's expected input fields to the actual data structure.