Validation utilities for Jido.AI runtime inputs.
This module centralizes prompt/input validation, callback validation, and resource-bound checks used across actions and strategies.
Summary
Functions
Returns the default callback timeout in milliseconds.
Returns the hard upper bound for max-turn validation.
Returns the maximum allowed general input length.
Returns the maximum allowed custom prompt length.
Validates prompt input and returns a sanitized version.
Validates and wraps callbacks with timeout protection.
Validates callback arity and type.
Validates custom prompts used for system-level behavior.
Validates and caps requested max-turn counts.
Validates prompt input without transforming it.
Validates generic string input with length and control-byte checks.
Types
Functions
@spec callback_timeout() :: integer()
Returns the default callback timeout in milliseconds.
@spec max_hard_turns() :: integer()
Returns the hard upper bound for max-turn validation.
@spec max_input_length() :: integer()
Returns the maximum allowed general input length.
@spec max_prompt_length() :: integer()
Returns the maximum allowed custom prompt length.
Validates prompt input and returns a sanitized version.
Validates and wraps callbacks with timeout protection.
@spec validate_callback(callback()) :: validation_result()
Validates callback arity and type.
Wrapped callbacks are invoked with a single argument, so only arity-1 callbacks are valid.
Validates custom prompts used for system-level behavior.
Validates and caps requested max-turn counts.
@spec validate_prompt(prompt()) :: validation_result()
Validates prompt input without transforming it.
Validates generic string input with length and control-byte checks.