pub const TEXT_COMPLETION: &str = "text_completion";
pub const IMAGE_TO_TEXT: &str = "image_to_text";
pub const OCR: &str = "ocr";
pub const EMBED: &str = "embed";
pub const DEFAULT_DELIVERABLE_PHASES: &[&str] = &[
"quiz",
"goal_completion",
"chitchat",
"text_completion",
"image_to_text",
"ocr",
"embed",
];
const REMOVED: &[&str] = &["direct_llm", "quiz", "direct_model"];
pub fn validate_loop_input_intent_hint(hint: &str) -> Option<String> {
let h = hint.trim();
if h.is_empty() {
return None;
}
if REMOVED.contains(&h) {
return Some(format!(
"intent_hint '{h}' is removed; use text_completion or another supported hint"
));
}
let ok = matches!(h, TEXT_COMPLETION | IMAGE_TO_TEXT | OCR | EMBED);
if ok {
None
} else {
Some(format!("unsupported intent_hint '{h}'"))
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn accepts_text_completion() {
assert!(validate_loop_input_intent_hint(TEXT_COMPLETION).is_none());
}
#[test]
fn rejects_removed() {
assert!(validate_loop_input_intent_hint("direct_llm").is_some());
}
}