From 571d1022f628cb7d2a3125664bd3293bac4471b5 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 1 Jun 2024 17:47:49 +0800 Subject: 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 --- src/client/azure_openai.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/client/azure_openai.rs') 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 { 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 ); -- cgit v1.2.3