metric_result = MetricResult(result=42, reason="This is a test")print(metric_result)print(metric_result.reason)### Example with Numeric Operationsnum_result1 = MetricResult(result=5.0)num_result2 = MetricResult(result=3.0)print(num_result1 + num_result2) # 8.0### Example with String Operationsstr_result = MetricResult(result="low")print(str_result.upper()) # "LOW"## Example with List Operationslist_result = MetricResult(result=[1, 2, 3])print(list_result[1:]) # 2
*Generate a Pydantic core schema for MetricResult.
This custom schema handles different serialization behaviors: - For model_dump(): Returns the original MetricResult instance - For model_dump_json(): Converts to a JSON-compatible dict using json*