Definition

The valid URL test allows you to check if a specified column contains only valid URLs.

Taxonomy

  • Category: Integrity.
  • Task types: LLM.
  • Availability: and .

Why it matters

  • If the LLM generates URLs as part of its response, it is important to ensure that they are valid, and not hallucinated.

Test configuration examples

If you are writing a tests.json, here are a few valid configurations for the character length test:

[
  {
    "name": "Column 'model_url' contains only valid URLs",
    "description": "Asserts that all values in the column 'model_url' are valid URLs",
    "type": "integrity",
    "subtype": "containsValidUrl",
    "thresholds": [
        {
            "insightName": "containsValidUrl",
            "insightParameters": [{"name": "column_name", "value": "model_url"}],  // Checks for URLs on the column `model_url`,
            "measurement": "containsValidUrlRowPercentage",
            "operator": ">=",
            "value": 1.0
        }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true, // Apply test to the validation set
    "usesTrainingDataset": false,
    "usesMlModel": false,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689" // Some unique id
  }
]