Contains Valid Link

Evaluates whether the output text contains at least one valid hyperlink. It checks if the text includes a URL that adheres to standard URL formatting and is accessible.

result = evaluator.evaluate(
    eval_templates="contains_valid_link",
    inputs={
        "text": "Check out our documentation at <https://www.example.com>"
    },
    model_name="turing_flash"
)

print(result.eval_results[0].output)
print(result.eval_results[0].reason)
import { Evaluator, Templates } from "@future-agi/ai-evaluation";

const evaluator = new Evaluator();

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

console.log(result);
Input
Required InputTypeDescription
textstringThe content to be assessed for valid hyperlinks.
Output
FieldDescription
ResultReturns Passed if the text contains at least one valid hyperlink, Failed otherwise.
ReasonProvides a detailed explanation of the link validation assessment.

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.

  • No Invalid Links: While Contains Valid Link checks that at least one valid URL is present, No Invalid Links verifies that the text does not contain any malformed or broken URLs.
Was this page helpful?

Questions & Discussion