Interface GuardrailExecutor<C extends GuardrailsConfig,P extends GuardrailRequest,R extends GuardrailResult<R>,G extends Guardrail<P,R>>

Type Parameters:
C - The type of GuardrailsConfig to use for configuration
P - The type of GuardrailRequest to validate
R - The type of GuardrailResult to return
G - The type of Guardrails being executed
All Known Implementing Classes:
AbstractGuardrailExecutor, InputGuardrailExecutor, OutputGuardrailExecutor

public sealed interface GuardrailExecutor<C extends GuardrailsConfig,P extends GuardrailRequest,R extends GuardrailResult<R>,G extends Guardrail<P,R>> permits AbstractGuardrailExecutor<C,P,R,G,F>
Represents a mechanism to execute a set of guardrails on given parameters. This interface defines the contract for validating interactions (input or output) using multiple guardrails.
  • Method Summary

    Modifier and Type
    Method
    Description
    The GuardrailsConfig to use for configuration of the guardrail execution
    execute(P params)
    Executes the provided guardrails on the given parameters.
    Retrieves the guardrails associated with the implementation.
  • Method Details

    • config

      C config()
      The GuardrailsConfig to use for configuration of the guardrail execution
      Returns:
      The GuardrailsConfig to use for configuration of the guardrail execution
    • guardrails

      List<G> guardrails()
      Retrieves the guardrails associated with the implementation.
      Returns:
      The guardrails which can be used for validating inputs or outputs against predefined rules.
    • execute

      R execute(P params)
      Executes the provided guardrails on the given parameters.
      Parameters:
      params - The GuardrailRequest to validate
      Returns:
      The GuardrailResult of the validation