summaryrefslogtreecommitdiffstats
path: root/src/client/localai.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-10-26 19:19:22 +0800
committersigoden <sigoden@gmail.com>2023-10-26 19:19:22 +0800
commit66fd547c0fac30d98565a92d93824237a4813669 (patch)
tree332ca0d0927739de69ff4e7b8ac589f4f001f9f1 /src/client/localai.rs
parent7d8564cafb45afc4bccb666a310615b164800a9a (diff)
downloadaichat-66fd547c0fac30d98565a92d93824237a4813669.tar.gz
refactor: improve code quanity
remove tokio::runtime::Runtime from client
Diffstat (limited to 'src/client/localai.rs')
-rw-r--r--src/client/localai.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/client/localai.rs b/src/client/localai.rs
index 4375c1d..52d7ab3 100644
--- a/src/client/localai.rs
+++ b/src/client/localai.rs
@@ -11,7 +11,6 @@ use reqwest::{Client as ReqwestClient, Proxy, RequestBuilder};
use serde::Deserialize;
use serde_json::json;
use std::time::Duration;
-use tokio::runtime::Runtime;
#[allow(clippy::module_name_repetitions)]
#[derive(Debug)]
@@ -19,7 +18,6 @@ pub struct LocalAIClient {
global_config: SharedConfig,
local_config: LocalAIConfig,
model_info: ModelInfo,
- runtime: Runtime,
}
#[derive(Debug, Clone, Deserialize)]
@@ -44,10 +42,6 @@ impl Client for LocalAIClient {
&self.global_config
}
- fn get_runtime(&self) -> &Runtime {
- &self.runtime
- }
-
async fn send_message_inner(&self, content: &str) -> Result<String> {
let builder = self.request_builder(content, false)?;
openai_send_message(builder).await
@@ -68,13 +62,11 @@ impl LocalAIClient {
global_config: SharedConfig,
local_config: LocalAIConfig,
model_info: ModelInfo,
- runtime: Runtime,
) -> Self {
Self {
global_config,
local_config,
model_info,
- runtime,
}
}