Skip to main content

validate_prompt_content

Function validate_prompt_content 

Source
pub fn validate_prompt_content(content: &str) -> ValidationResult
Expand description

Validates prompt content for common issues.

Checks for:

  • Unclosed braces (e.g., {{var without closing }})
  • Invalid variable names (non-alphanumeric characters)
  • Reserved variable names (e.g., subcog_*, system_*, __*)
  • Duplicate variable definitions

ยงReturns

A validation result indicating whether the content is valid.