summaryrefslogtreecommitdiffstats
path: root/src/client/azure_openai.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-01 17:47:49 +0800
committerGitHub <noreply@github.com>2024-06-01 17:47:49 +0800
commit571d1022f628cb7d2a3125664bd3293bac4471b5 (patch)
tree67034aaf0a656ae9dce0cd0d3aae3605d2ea1767 /src/client/azure_openai.rs
parent259583f4f750e4ece7aed07858a9589110d7cf5d (diff)
downloadaichat-571d1022f628cb7d2a3125664bd3293bac4471b5.tar.gz
refactor: rename some client structs and methods (#555)
* rename `Completeion*` to `ChatCompletions*` * rename `send_message*` to `chat_completions*` * rename `request_builder` to `chat_completions_builder` * rename `build_body` to `build_chat_completions_body` * rename `extract_completion` to `extract_chat_completions` * format * remove unused config fields
Diffstat (limited to 'src/client/azure_openai.rs')
-rw-r--r--src/client/azure_openai.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/azure_openai.rs b/src/client/azure_openai.rs
index 75f8455..52c8a34 100644
--- a/src/client/azure_openai.rs
+++ b/src/client/azure_openai.rs
@@ -1,5 +1,5 @@
use super::{
- openai::*, AzureOpenAIClient, Client, CompletionData, ExtraConfig, Model, ModelData,
+ openai::*, AzureOpenAIClient, ChatCompletionsData, Client, ExtraConfig, Model, ModelData,
ModelPatches, PromptAction, PromptKind,
};
@@ -33,15 +33,15 @@ impl AzureOpenAIClient {
),
];
- fn request_builder(
+ fn chat_completions_builder(
&self,
client: &ReqwestClient,
- data: CompletionData,
+ data: ChatCompletionsData,
) -> Result<RequestBuilder> {
let api_base = self.get_api_base()?;
let api_key = self.get_api_key()?;
- let mut body = openai_build_body(data, &self.model);
+ let mut body = openai_build_chat_completions_body(data, &self.model);
self.patch_request_body(&mut body);
let url = format!(
@@ -60,6 +60,6 @@ impl AzureOpenAIClient {
impl_client_trait!(
AzureOpenAIClient,
- crate::client::openai::openai_send_message,
- crate::client::openai::openai_send_message_streaming
+ crate::client::openai::openai_chat_completions,
+ crate::client::openai::openai_chat_completions_streaming
);