summaryrefslogtreecommitdiffstats
path: root/src/client/cloudflare.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-05-30 17:10:02 +0800
committerGitHub <noreply@github.com>2024-05-30 17:10:02 +0800
commit54a837784c3df7e73c7c95adfef96e68c842984b (patch)
treee090da40436bd3c1220d5ab88071ac33397ce57c /src/client/cloudflare.rs
parentfa4bf14e02b1e6361b38014fe6a986738cf06837 (diff)
downloadaichat-54a837784c3df7e73c7c95adfef96e68c842984b.tar.gz
refactor: rename `SendData` to `CompletionData` (#553)
Diffstat (limited to 'src/client/cloudflare.rs')
-rw-r--r--src/client/cloudflare.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/cloudflare.rs b/src/client/cloudflare.rs
index 659c7c0..15dd5bb 100644
--- a/src/client/cloudflare.rs
+++ b/src/client/cloudflare.rs
@@ -1,6 +1,6 @@
use super::{
- catch_error, sse_stream, Client, CloudflareClient, CompletionOutput, ExtraConfig, Model,
- ModelData, ModelPatches, PromptAction, PromptKind, SendData, SseHandler, SseMmessage,
+ catch_error, sse_stream, Client, CloudflareClient, CompletionData, CompletionOutput,
+ ExtraConfig, Model, ModelData, ModelPatches, PromptAction, PromptKind, SseHandler, SseMmessage,
};
use anyhow::{anyhow, Result};
@@ -30,7 +30,11 @@ impl CloudflareClient {
("api_key", "API Key:", true, PromptKind::String),
];
- fn request_builder(&self, client: &ReqwestClient, data: SendData) -> Result<RequestBuilder> {
+ fn request_builder(
+ &self,
+ client: &ReqwestClient,
+ data: CompletionData,
+ ) -> Result<RequestBuilder> {
let account_id = self.get_account_id()?;
let api_key = self.get_api_key()?;
@@ -79,8 +83,8 @@ async fn send_message_streaming(builder: RequestBuilder, handler: &mut SseHandle
sse_stream(builder, handle).await
}
-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,