Valid Range

Objective Ensures that numerical values in the text fall within a valid range, maintaining data accuracy.

Interpretation A higher score indicates that one or more numerical values fall outside the acceptable range. A lower (or zero) score indicates all values are within the valid range.

Code Execution

metrics = [
    {
        "name": "Valid Range",
        "config": {
            "model": "gpt-4o-mini",
            "provider": "openai"
        },
        "column_name": "your-column-identifier",
        "schema_mapping": schema_mapping
    }
]

Example

  • Prompt: “Provide the temperature in Celsius between -50 and 50.”

  • Context: “Valid range is from -50 to 50.”

  • Response: “The temperature is 100°C.”

  • Metric Output: {"score": 1, "reason": "Value out of valid range (100°C is > 50°C)."}

Last updated

Was this helpful?