summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-10-19 18:25:40 +0800
committerGitHub <noreply@github.com>2024-10-19 18:25:40 +0800
commit7e29f642a99682ea7bb074eb4e7aa7d34d523515 (patch)
tree248bbcb5d3af83981e451eb115f1fde23c8386de /src/main.rs
parentc5e4421e0da6d647a636ec4cf23c110ff515e79a (diff)
downloadaichat-7e29f642a99682ea7bb074eb4e7aa7d34d523515.tar.gz
feat: support openai o1 models (#935)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index ec61370..a7cc9f1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -174,7 +174,7 @@ async fn start_directive(
let client = input.create_client()?;
let extract_code = !*IS_STDOUT_TERMINAL && code_mode;
config.write().before_chat_completion(&input)?;
- let (output, tool_results) = if !config.read().stream || extract_code {
+ let (output, tool_results) = if !input.stream() || extract_code {
let task = client.chat_completions(input.clone());
let ret = run_with_spinner(task, "Generating").await;
match ret {
@@ -288,7 +288,7 @@ async fn shell_execute(config: &GlobalConfig, shell: &Shell, mut input: Input) -
let role = config.read().retrieve_role(EXPLAIN_SHELL_ROLE)?;
let input = Input::from_str(config, &eval_str, Some(role));
let abort = create_abort_signal();
- if config.read().stream {
+ if input.stream() {
call_chat_completions_streaming(&input, client.as_ref(), config, abort)
.await?;
} else {