Use Cases
- Weighted Scoring: Apply different weights to different evaluation columns
- Conditional Logic: Only count certain results based on conditions
- Complex Aggregations: Calculate scores based on multiple factors with custom formulas
- Threshold-Based Scoring: Pass/fail based on meeting certain criteria
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
column_names | string[] | Yes | List of column names to include in score calculation |
code | string | No | Custom Python or JavaScript code for score calculation |
code_language | string | No | Language of the code: "PYTHON" (default) or "JAVASCRIPT" |
Custom Code Interface
When providing custom code, your code receives adata variable containing all evaluation results and must return a dictionary with a score key.
Input: data
A list of dictionaries, where each dictionary represents one row from your dataset with all column values:
Output Requirements
Your code must return a dictionary with at least ascore key (number between 0-100):
Examples
Example 1: Weighted Scoring
Apply different weights to different evaluation columns:Example 2: All Must Pass
Require all checks to pass for a row to count as successful:Example 3: Threshold-Based Scoring
Apply different score contributions based on thresholds:Example 4: Category-Specific Scoring
Different scoring logic for different categories:Response
Notes
- Custom code runs in a sandboxed environment with limited execution time
- The
scorevalue should be between 0 and 100 - If no custom code is provided, the default scoring (average of boolean columns) is used
- Changes to the score card on a blueprint affect all future runs
- For completed runs, the score is recalculated immediately after updating the score card

