validators

About

Key to glyphdeck is the Pydantic validation model that is passed to the LLMHandler to direct its output.

Access

gd.validators.ModelName

Usage

cascade.set_llm_handler(
    provider="OpenAI",
    model="gpt-4o-mini",
    system_message=(
        "You are an expert pizza shop customer feedback analyst system."
        "Analyse the feedback and return results in the correct format."
    ),
    validation_model=gd.validators.SubCatsSentiment,
    cache_identifier="pizzshop_sentiment",
)

Built-in

For a given text input the LLM will be instructed to return the:

Custom Validators

Any valid Pydantic BaseModel can be used for validation. You can also inherit from .BaseValidatorModel to make use of the logic used in the built-in validators.

Refer to the Pydantic documentation for more info.