summaryrefslogtreecommitdiffstats
path: root/src/client/ollama.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-23 14:32:06 +0800
committerGitHub <noreply@github.com>2024-04-23 14:32:06 +0800
commit1cc89eff514669d6459f62cc4eed8e0b34d8ef0c (patch)
treeecbee07510fbdbe5f6bf8fdc98dfd25a3a23a5d5 /src/client/ollama.rs
parentc5506fe39377d864f80175821712b33949241583 (diff)
downloadaichat-1cc89eff514669d6459f62cc4eed8e0b34d8ef0c.tar.gz
refactor: more async code (#427)
Diffstat (limited to 'src/client/ollama.rs')
-rw-r--r--src/client/ollama.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/ollama.rs b/src/client/ollama.rs
index 2c51f44..e652634 100644
--- a/src/client/ollama.rs
+++ b/src/client/ollama.rs
@@ -1,9 +1,9 @@
use super::{
message::*, patch_system_message, Client, ExtraConfig, Model, ModelConfig, OllamaClient,
- PromptType, SendData,
+ PromptType, ReplyHandler, SendData,
};
-use crate::{render::ReplyHandler, utils::PromptKind};
+use crate::utils::PromptKind;
use anyhow::{anyhow, bail, Result};
use async_trait::async_trait;
@@ -118,7 +118,7 @@ async fn send_message_streaming(builder: RequestBuilder, handler: &mut ReplyHand
while let Some(chunk) = stream.next().await {
let chunk = chunk?;
if chunk.is_empty() {
- continue;
+ continue;
}
let data: Value = serde_json::from_slice(&chunk)?;
if data["done"].is_boolean() {