diff options
| author | sigoden <sigoden@gmail.com> | 2024-05-30 17:10:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-30 17:10:02 +0800 |
| commit | 54a837784c3df7e73c7c95adfef96e68c842984b (patch) | |
| tree | e090da40436bd3c1220d5ab88071ac33397ce57c /src/client/ollama.rs | |
| parent | fa4bf14e02b1e6361b38014fe6a986738cf06837 (diff) | |
| download | aichat-54a837784c3df7e73c7c95adfef96e68c842984b.tar.gz | |
refactor: rename `SendData` to `CompletionData` (#553)
Diffstat (limited to 'src/client/ollama.rs')
| -rw-r--r-- | src/client/ollama.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/ollama.rs b/src/client/ollama.rs index a650f40..014824b 100644 --- a/src/client/ollama.rs +++ b/src/client/ollama.rs @@ -1,6 +1,6 @@ use super::{ - catch_error, json_stream, message::*, Client, CompletionOutput, ExtraConfig, Model, ModelData, - ModelPatches, OllamaClient, PromptAction, PromptKind, SendData, SseHandler, + catch_error, json_stream, message::*, Client, CompletionData, CompletionOutput, ExtraConfig, + Model, ModelData, ModelPatches, OllamaClient, PromptAction, PromptKind, SseHandler, }; use anyhow::{anyhow, bail, Result}; @@ -35,7 +35,11 @@ impl OllamaClient { ), ]; - fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> { + fn request_builder( + &self, + client: &ReqwestClient, + data: CompletionData, + ) -> Result<RequestBuilder> { let api_base = self.get_api_base()?; let api_auth = self.get_api_auth().ok(); @@ -101,8 +105,8 @@ async fn send_message_streaming(builder: RequestBuilder, handler: &mut SseHandle Ok(()) } -fn build_body(data: SendData, model: &Model) -> Result<Value> { - let SendData { +fn build_body(data: CompletionData, model: &Model) -> Result<Value> { + let CompletionData { messages, temperature, top_p, |
