diff options
| author | sigoden <sigoden@gmail.com> | 2024-04-26 07:43:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-26 07:43:35 +0800 |
| commit | 740ca2413a1992d151c0a9ea62c12e69321c0973 (patch) | |
| tree | ccacd2fd5789064c091b212f26f3c46561f71f69 /src/client/azure_openai.rs | |
| parent | a21e1213ccdd11d76f6338436c431e459ab8e574 (diff) | |
| download | aichat-740ca2413a1992d151c0a9ea62c12e69321c0973.tar.gz | |
refactor: simplify impl client trait (#445)
Diffstat (limited to 'src/client/azure_openai.rs')
| -rw-r--r-- | src/client/azure_openai.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/azure_openai.rs b/src/client/azure_openai.rs index 9e96692..ab8c995 100644 --- a/src/client/azure_openai.rs +++ b/src/client/azure_openai.rs @@ -4,7 +4,6 @@ use super::{AzureOpenAIClient, ExtraConfig, Model, ModelConfig, PromptType, Send use crate::utils::PromptKind; use anyhow::Result; -use async_trait::async_trait; use reqwest::{Client as ReqwestClient, RequestBuilder}; use serde::Deserialize; @@ -17,8 +16,6 @@ pub struct AzureOpenAIConfig { pub extra: Option<ExtraConfig>, } -openai_compatible_client!(AzureOpenAIClient); - impl AzureOpenAIClient { list_models_fn!(AzureOpenAIConfig); config_get_fn!(api_base, get_api_base); @@ -55,3 +52,9 @@ impl AzureOpenAIClient { Ok(builder) } } + +impl_client_trait!( + AzureOpenAIClient, + crate::client::openai::openai_send_message, + crate::client::openai::openai_send_message_streaming +); |
