summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-16 17:02:09 +0800
committerGitHub <noreply@github.com>2023-03-16 17:02:09 +0800
commit1ef97b2f32caecdb2eef9fe3755390f36d96eae5 (patch)
tree269d9504e5959d2ca161862e0935103adc84b393 /src/main.rs
parent4a74f5cd72160585721dbce1e92c110125d046dd (diff)
downloadaichat-1ef97b2f32caecdb2eef9fe3755390f36d96eae5.tar.gz
feat: support multiple models (#71)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index ecbfc60..589e865 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,6 +35,12 @@ fn main() -> Result<()> {
.for_each(|v| println!("{}", v.name));
exit(0);
}
+ if cli.list_models {
+ config::MODELS
+ .iter()
+ .for_each(|(name, _)| println!("{}", name));
+ exit(0);
+ }
let role = match &cli.role {
Some(name) => Some(
config
@@ -44,6 +50,9 @@ fn main() -> Result<()> {
),
None => None,
};
+ if let Some(model) = &cli.model {
+ config.write().set_model(model)?;
+ }
config.write().role = role;
if cli.no_highlight {
config.write().highlight = false;