TokenBudgetGuardRail

@ApiStatus.Experimental
class TokenBudgetGuardRail constructor(tokenCountEstimator: <Error class: unknown class><String>, maxTokens: Int, severity: ValidationSeverity = ValidationSeverity.WARNING) : UserInputGuardRail

Constructors

Link copied to clipboard
constructor(tokenCountEstimator: <Error class: unknown class><String>, maxTokens: Int, severity: ValidationSeverity = ValidationSeverity.WARNING)

Properties

Link copied to clipboard
open override val description: String

Description of what this validator checks. Used for documentation and debugging purposes.

Link copied to clipboard
open override val name: String

Human-readable name for this validator. Used for logging, error reporting, and configuration.

Functions

Link copied to clipboard
open fun combineMessages(userMessages: List<UserMessage>): String

Combines multiple user messages into a single string for validation.

Link copied to clipboard
open fun validate(content: MultimodalContent, blackboard: Blackboard): ValidationResult

Validate multimodal content containing text and potentially images.

open fun validate(userMessages: List<UserMessage>, blackboard: Blackboard): ValidationResult

Validate a list of user messages from a conversation.

open override fun validate(input: String, blackboard: Blackboard): ValidationResult

Validate the given input within the provided blackboard context.