guardrail/GuardrailException.java

langchain4j · langchain4j-core/src/main/java/dev/langchain4j/guardrail/GuardrailException.java · java · Apache-2.0
ai, tag:knn-classified

Base exception for guardrail validation failures, sealed for input/output guardrails.

// Source: https://github.com/langchain4j/langchain4j | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package dev.langchain4j.guardrail;

import dev.langchain4j.exception.LangChain4jException;

/**
 * Exception thrown when an input or output guardrail validation fails.
 * <p>
 *     This class is not intended to be used within guardrail implementations. It is for the framework only.
 * </p>
 * @see InputGuardrailException
 * @see OutputGuardrailException
 */
public sealed class GuardrailException extends LangChain4jException
        permits InputGuardrailException, OutputGuardrailException {
    protected GuardrailException(String message) {
        super(message);
    }

    prot

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key