Contains Valid Link

Evaluates whether output text contains at least one valid hyperlink formatted to standard URL conventions.

Contains Valid Link checks whether a response includes at least one properly formatted URL. Run it wherever a response is expected to point users to a link.

What it does

Contains Valid Link is a deterministic, rule-based eval. It scans the provided text and checks whether it contains at least one valid hyperlink.

Input

Required InputTypeDescription
textstringThe content to be assessed for valid hyperlinks

Output

FieldTypeDescription
ResultPass / FailPass means the text contains at least one valid hyperlink; Fail means it doesn’t
ReasonstringA plain-language explanation of the link validation assessment

Run it from code

Call evaluate() with the template name and the eval’s required inputs. It returns the score and the reason.

Note

Before running: install the SDK and set FI_API_KEY / FI_SECRET_KEY. The model argument in the snippets is the evaluator model Future AGI uses to run the eval; turing_flash is a fast default.

from fi.evals import evaluate

result = evaluate(
    "contains_valid_link",
    text="Check out our documentation at https://www.example.com",
    model="turing_flash",
)

print(result.score)
print(result.reason)
import { evaluate } from "@future-agi/ai-evaluation";

const result = await evaluate(
  "contains_valid_link",
  {
    text: "Check out our documentation at https://www.example.com"
  },
  { modelName: "turing_flash" }
);

console.log(result);

When to use

Run Contains Valid Link wherever a response is supposed to direct the user to a resource.

  • Text outputs like support replies or help-center answers that should reference a documentation link
  • Content generation tasks where a citation or source link is a required element
  • Regression checks after a prompt change, to confirm the model still includes expected links

If the evaluation fails, review the output text to identify the absence of valid links. Consider revising the content to include appropriate hyperlinks that meet the required standards. Providing clearer instructions or constraints in the input can help prevent this issue in future evaluations.

Was this page helpful?

Questions & Discussion