diff options
| author | sigoden <sigoden@gmail.com> | 2023-11-02 10:45:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-02 10:45:11 +0800 |
| commit | 7c6841782d36faacc2aa3616dc3ed1b9403fa26e (patch) | |
| tree | 12d51728e056dbd4e57fc5977b7c51b2b60c06ae /src/main.rs | |
| parent | 444f4ebe9de8aa68afdf8d39b734a8543b9b5c4b (diff) | |
| download | aichat-7c6841782d36faacc2aa3616dc3ed1b9403fa26e.tar.gz | |
refactor: improve code quanity (#197)
- move model_info.rs/message.rs to clients/
- rename SharedConfig to GlobalConfig
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index b801e47..2bc3d63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ mod utils; use crate::cli::Cli; use crate::client::Client; -use crate::config::{Config, SharedConfig}; +use crate::config::{Config, GlobalConfig}; use anyhow::Result; use clap::Parser; @@ -17,11 +17,11 @@ use crossbeam::sync::WaitGroup; use is_terminal::IsTerminal; use parking_lot::RwLock; use render::{render_stream, MarkdownRender}; -use repl::{create_abort_signal, Repl}; +use repl::Repl; use std::io::{stdin, Read}; use std::sync::Arc; use std::{io::stdout, process::exit}; -use utils::cl100k_base_singleton; +use utils::{cl100k_base_singleton, create_abort_signal}; fn main() -> Result<()> { let cli = Cli::parse(); @@ -93,7 +93,7 @@ fn main() -> Result<()> { fn start_directive( client: &dyn Client, - config: &SharedConfig, + config: &GlobalConfig, input: &str, no_stream: bool, ) -> Result<()> { @@ -125,7 +125,7 @@ fn start_directive( config.write().save_message(input, &output) } -fn start_interactive(config: SharedConfig) -> Result<()> { +fn start_interactive(config: GlobalConfig) -> Result<()> { cl100k_base_singleton(); let mut repl: Repl = Repl::init(config.clone())?; repl.run() |
