summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-08 17:13:11 +0800
committerGitHub <noreply@github.com>2023-03-08 17:13:11 +0800
commit2539e24fe9eadf69cb20b01d2303a99fa2e8a363 (patch)
treeb1b4b6a9e9df9d16870219a53b75a4456829a005 /src/main.rs
parentee812754313ebd16d34dff3d925afc4402c029fa (diff)
downloadaichat-2539e24fe9eadf69cb20b01d2303a99fa2e8a363.tar.gz
chore: improve code by getting prompt from config (#39)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
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
};