Package io.quarkiverse.langchain4j.guardrails
package io.quarkiverse.langchain4j.guardrails
-
ClassDescriptionA guardrail is a rule that is applied when interacting with an LLM either to the input (the user message) or to the output of the model to ensure that they are safe and meet the expectations of the model.Represents the parameter passed to
Guardrail.validate(GuardrailParams)
} in order to validate an interaction between a user and the LLM.GuardrailResult<GR extends GuardrailResult>The result of the validation of an interaction between a user and the LLM.The message and the cause of the failure of a single validation.The possible results of a guardrails validation.An input guardrail is a rule that is applied to the input of the model to ensure that the input (the user message) is safe and meets the expectations of the model.Represents the parameter passed toInputGuardrail.validate(InputGuardrailParams)
.The result of the validation of anInputGuardrail
An annotation to apply guardrails to the input of the model.An output guardrail is a rule that is applied to the output of the model to ensure that the output is safe and meets the expectations.An annotation to configure token accumulation when output guardrails are applied on streamed responses.Represents the parameter passed toOutputGuardrail.validate(OutputGuardrailParams)
.The result of the validation of anOutputGuardrail
An annotation to apply guardrails to the output of the model.Interface to accumulate tokens when output guardrails are applied on streamed responses.