API Reference
Score
API reference for the Score type used by all optimizers
The Score dataclass is the return type required by all optimizer metrics. It provides structured feedback that optimizers use to learn from successes and failures.
Definition
Fields
| Field | Type | Description |
|---|---|---|
value | float | Normalized score between 0 and 1. |
is_success | bool | Whether this prediction meets your success threshold. |
feedback | str | Human-readable explanation of the score. More specific feedback produces better optimization results. Instead of "Wrong", prefer "Expected a 3-digit number but got a sentence." |
error_type | str | Optional categorization of the error (e.g., "wrong_format", "missing_info"). Enables diversity-aware optimization features like stratified sampling and error clustering. |
metadata | dict | Arbitrary extra data. Not used by the optimizer but available for your own tracking. |