From 1cc89eff514669d6459f62cc4eed8e0b34d8ef0c Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 23 Apr 2024 14:32:06 +0800 Subject: refactor: more async code (#427) --- src/client/ollama.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/ollama.rs') 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() { -- cgit v1.2.3