This commit is contained in:
Slavi Pantaleev
2025-05-10 11:47:50 +03:00
parent 231528a0d8
commit a84135ff32
30 changed files with 214 additions and 174 deletions

View File

@@ -1,9 +1,7 @@
use crate::controller::ControllerType;
mod tests;
pub fn determine_controller(
text: &str,
) -> ControllerType {
pub fn determine_controller(text: &str) -> ControllerType {
let text = text.trim();
if let Some(prompt) = text.strip_prefix("create") {

View File

@@ -22,11 +22,12 @@ fn determine_controller() {
input: "create Some prompt",
expected: super::ControllerType::ImageGeneration("Some prompt".to_owned()),
},
TestCase {
name: "Image edit triggered by edit prefix",
input: "edit Turn this into an anime-style image",
expected: super::ControllerType::ImageEdit("Turn this into an anime-style image".to_owned()),
expected: super::ControllerType::ImageEdit(
"Turn this into an anime-style image".to_owned(),
),
},
];