Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions async-openai/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ pub trait Config: Send + Sync {
fn headers(&self) -> HeaderMap;
fn url(&self, path: &str) -> String;
fn query(&self) -> Vec<(&str, &str)>;

fn api_base(&self) -> &str;

fn api_key(&self) -> &SecretString;
}

/// Macro to implement Config trait for pointer types with dyn objects
Expand All @@ -38,12 +34,6 @@ macro_rules! impl_config_for_ptr {
fn query(&self) -> Vec<(&str, &str)> {
self.as_ref().query()
}
fn api_base(&self) -> &str {
self.as_ref().api_base()
}
fn api_key(&self) -> &SecretString {
self.as_ref().api_key()
}
}
};
}
Expand Down Expand Up @@ -145,14 +135,6 @@ impl Config for OpenAIConfig {
format!("{}{}", self.api_base, path)
}

fn api_base(&self) -> &str {
&self.api_base
}

fn api_key(&self) -> &SecretString {
&self.api_key
}

fn query(&self) -> Vec<(&str, &str)> {
vec![]
}
Expand Down Expand Up @@ -225,14 +207,6 @@ impl Config for AzureConfig {
)
}

fn api_base(&self) -> &str {
&self.api_base
}

fn api_key(&self) -> &SecretString {
&self.api_key
}

fn query(&self) -> Vec<(&str, &str)> {
vec![("api-version", &self.api_version)]
}
Expand Down