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 ofGuardrailsConfig
to use for configurationP
- The type ofGuardrailRequest
to validateR
- The type ofGuardrailResult
to returnG
- The type ofGuardrail
s being executedE
- The type ofGuardrailExecutedEvent
to 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()
TheGuardrailsConfig
to 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()TheGuardrailsConfig
to use for configuration of the guardrail execution- Returns:
- The
GuardrailsConfig
to use for configuration of the guardrail execution
-
guardrails
-
execute
Executes the provided guardrails on the given parameters.- Parameters:
request
- TheGuardrailRequest
to validate- Returns:
- The
GuardrailResult
of the validation
-