feat: remove ModelUse and ModelAdd commands; update command handling and provider configuration

This commit is contained in:
asepharyana
2026-07-12 02:19:08 +07:00
parent 32155f8ea8
commit c948869d35
4 changed files with 14 additions and 68 deletions
+1 -20
View File
@@ -20,13 +20,6 @@ pub enum Command {
command: String,
},
ModelList,
ModelUse {
provider: String,
},
ModelAdd {
name: String,
base_url: String,
},
Unknown(String),
}
@@ -81,19 +74,7 @@ pub fn parse_command(text: &str) -> Command {
Command::McpAdd { name: rest.to_string(), command: String::new() }
}
}
"/model" if arg1 == "ls" || arg1 == "list" => Command::ModelList,
"/model" if arg1 == "add" && !arg2.is_empty() => {
let rest = arg2.trim();
if let Some(space) = rest.find(' ') {
let name = rest[..space].to_string();
let base_url = rest[space + 1..].trim().to_string();
Command::ModelAdd { name, base_url }
} else {
Command::ModelAdd { name: rest.to_string(), base_url: String::new() }
}
}
"/model" if arg1.is_empty() => Command::ModelList,
"/model" => Command::ModelUse { provider: arg1.to_string() },
"/model" => Command::ModelList,
_ => Command::Unknown(cmd.to_string()),
}
}