Annotation Interface OutputGuardrailAccumulator


@Retention(RUNTIME) @Target(METHOD) public @interface OutputGuardrailAccumulator
An annotation to configure token accumulation when output guardrails are applied on streamed responses.

The accumulator is invoked before the guardrails are applied to the output of the model, and invoke the guardrail chain on the accumulated tokens. The guardrail may be called multiple time depending on the accumulation strategy.

If the annotation is not present and the output is streamed, the default behavior is to accumulate all the tokens before applying the guardrails.