git404hub

what is contains_string fr?

guardrails-ai/contains_string — explained in plain English

Analysis updated 2026-07-25 · repo last pushed 2026-07-25

PythonAudience · developerComplexity · 2/5ActiveSetup · easy

tl;dr

A simple quality-control tool that checks whether a piece of text includes a specific required word or phrase, and takes action if it doesn't. Built for the Guardrails AI ecosystem.

vibe map

mindmap
  root((repo))
    What it does
      Checks text for a substring
      Passes or fails the text
      Applies a chosen policy
    How it works
      Set up a guard
      Specify the target substring
      Choose action on failure
    Use cases
      Ensure brand name in output
      Catch missing required keywords
      Validate AI generated text
    Tech stack
      Python
      Guardrails AI Hub
    Audience
      AI app builders
      Non technical builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Ensure AI-generated product descriptions always include a required brand name.

VIBE 2

Catch AI outputs that are missing required keywords, codes, or identifiers before they reach a user.

VIBE 3

Build layered quality checks on AI-generated text by combining this with other validators.

what's the stack?

PythonGuardrails AI

how it stacks up fr

guardrails-ai/contains_string0xallam/my-recipe0xhassaan/nn-from-scratch
Stars0
LanguagePythonPythonPython
Last pushed2026-07-252022-11-22
MaintenanceActiveDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

Requires installation of the Guardrails AI framework and installing this validator through their hub.

No license information was provided in the repository explanation.

in plain english

The contains_string validator is a small tool from Guardrails AI that checks whether a piece of text includes a specific substring. Think of it as a quality-control checkpoint: you tell it what word or fragment of text must appear, and it will pass or fail whatever text you feed it based on whether that substring shows up. At a high level, you set up a "guard" and specify two things: the substring you're looking for, and what should happen if the text doesn't contain it. When you then run text through the guard, it checks for that substring. If the substring is there, everything proceeds normally. If it's missing, the guard can respond in different ways, it might throw an error, try to fix the text, filter it out, or simply do nothing, depending on what policy you chose. This is useful for anyone building applications that generate text using AI, especially when certain words or phrases are required in the output. For example, if you have an AI generating product descriptions and every description must mention a brand name, this validator can catch outputs that forgot to include it. It can also be used to make sure generated text contains required keywords, codes, or identifiers before that text reaches a user or gets saved somewhere. The project is built as part of the broader Guardrails AI ecosystem, which provides a collection of validators you can mix and match. You install this particular validator through their hub and combine it with other validators to build layered checks on AI-generated content. The README doesn't go into detail about how the underlying Guardrails framework works, but the validator itself is straightforward, it's a single-purpose check that only cares about whether your target substring exists in the text.

prompts (copy fr)

prompt 1
Install the contains_string validator from the Guardrails AI hub and write a Python script that checks if an AI-generated product description includes the phrase 'ACME Corp', raising an error if it is missing.
prompt 2
Create a Guardrails guard using the contains_string validator that filters out any generated text that does not contain the code 'PROMO2024'.
prompt 3
Show me how to combine the contains_string validator with another Guardrails validator so that my AI output must contain the word 'disclaimer' and also pass a basic quality check.

Frequently asked questions

what is contains_string fr?

A simple quality-control tool that checks whether a piece of text includes a specific required word or phrase, and takes action if it doesn't. Built for the Guardrails AI ecosystem.

What language is contains_string written in?

Mainly Python. The stack also includes Python, Guardrails AI.

Is contains_string actively maintained?

Active — commit in last 30 days (last push 2026-07-25).

What license does contains_string use?

No license information was provided in the repository explanation.

How hard is contains_string to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is contains_string for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.