Skip to main content

validate_state_key

Function validate_state_key 

Source
pub fn validate_state_key(key: &str) -> Result<(), &'static str>
Expand description

Core traits and types.

Always available regardless of feature flags. Includes:

  • Agent - The fundamental trait for all agents
  • Tool / Toolset - For extending agents with capabilities
  • Session / State - For managing conversation context
  • Event - For streaming agent responses
  • AdkError / Result - Unified error handling Validates a state key. Returns Ok(()) if the key is safe, or an error message.

Rules:

  • Must not be empty
  • Must not exceed MAX_STATE_KEY_LEN bytes
  • Must not contain path separators (/, \) or ..
  • Must not contain null bytes