diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-08 17:13:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-08 17:13:11 +0800 |
| commit | 2539e24fe9eadf69cb20b01d2303a99fa2e8a363 (patch) | |
| tree | b1b4b6a9e9df9d16870219a53b75a4456829a005 /src/main.rs | |
| parent | ee812754313ebd16d34dff3d925afc4402c029fa (diff) | |
| download | aichat-2539e24fe9eadf69cb20b01d2303a99fa2e8a363.tar.gz | |
chore: improve code by getting prompt from config (#39)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index edb9907..8c24945 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,10 +71,9 @@ fn start_directive( input: &str, no_stream: bool, ) -> Result<()> { - let prompt = config.borrow().get_prompt(); let highlight = config.borrow().highlight && stdout().is_terminal(); let output = if no_stream { - let output = client.send_message(input, prompt)?; + let output = client.send_message(input)?; if highlight { let mut markdown_render = MarkdownRender::new(); println!("{}\n", markdown_render.render(&output).trim_end()); @@ -90,7 +89,7 @@ fn start_directive( abort_clone.set_ctrlc(); }) .expect("Error setting Ctrl-C handler"); - let output = render_stream(input, None, &client, highlight, false, abort, wg.clone())?; + let output = render_stream(input, &client, highlight, false, abort, wg.clone())?; wg.wait(); output }; |
