Interface GuardrailExecutor<C extends GuardrailsConfig, P extends GuardrailRequest<P>, R extends GuardrailResult<R>, G extends Guardrail<P,R>, E extends GuardrailExecutedEvent<P,R,G>>
- Type Parameters:
C- The type ofGuardrailsConfigto use for configurationP- The type ofGuardrailRequestto validateR- The type ofGuardrailResultto returnG- The type ofGuardrails being executedE- The type ofGuardrailExecutedEventto be fired
- All Known Implementing Classes:
AbstractGuardrailExecutor, InputGuardrailExecutor, OutputGuardrailExecutor
public sealed interface GuardrailExecutor<C extends GuardrailsConfig, P extends GuardrailRequest<P>, R extends GuardrailResult<R>, G extends Guardrail<P,R>, E extends GuardrailExecutedEvent<P,R,G>>
permits AbstractGuardrailExecutor<C,P,R,G,E,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 TypeMethodDescriptionconfig()TheGuardrailsConfigto use for configuration of the guardrail executionExecutes the provided guardrails on the given parameters.Retrieves the guardrails associated with the implementation.
-
Method Details
-
config
C config()TheGuardrailsConfigto use for configuration of the guardrail execution- Returns:
- The
GuardrailsConfigto use for configuration of the guardrail execution
-
guardrails
-
execute
Executes the provided guardrails on the given parameters.- Parameters:
request- TheGuardrailRequestto validate- Returns:
- The
GuardrailResultof the validation
-