Skip to content

Commit

Permalink
fix: Make Config Clone (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Jun 21, 2023
1 parent f7ba6e3 commit c3a761d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion async-openai/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub const OPENAI_ORGANIZATION_HEADER: &str = "OpenAI-Organization";

/// [crate::Client] relies on this for every API call on OpenAI
/// or Azure OpenAI service
pub trait Config {
pub trait Config: Clone {
fn headers(&self) -> HeaderMap;
fn url(&self, path: &str) -> String;
fn query(&self) -> Vec<(&str, &str)>;
Expand All @@ -19,6 +19,7 @@ pub trait Config {
}

/// Configuration for OpenAI API
#[derive(Clone, Debug)]
pub struct OpenAIConfig {
api_base: String,
api_key: String,
Expand Down Expand Up @@ -100,6 +101,7 @@ impl Config for OpenAIConfig {
}

/// Configuration for Azure OpenAI Service
#[derive(Clone, Debug)]
pub struct AzureConfig {
api_version: String,
deployment_id: String,
Expand Down

0 comments on commit c3a761d

Please sign in to comment.