Trait Config

Source
pub trait Config {
    // Required methods
    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;
}
Expand description

crate::Client relies on this for every API call on OpenAI or Azure OpenAI service

Required Methods§

Source

fn headers(&self) -> HeaderMap

Source

fn url(&self, path: &str) -> String

Source

fn query(&self) -> Vec<(&str, &str)>

Source

fn api_base(&self) -> &str

Source

fn api_key(&self) -> &SecretString

Trait Implementations§

Source§

impl Config for Box<dyn Config>

Source§

fn headers(&self) -> HeaderMap

Source§

fn url(&self, path: &str) -> String

Source§

fn query(&self) -> Vec<(&str, &str)>

Source§

fn api_base(&self) -> &str

Source§

fn api_key(&self) -> &SecretString

Implementations on Foreign Types§

Source§

impl Config for Box<dyn Config>

Source§

fn headers(&self) -> HeaderMap

Source§

fn url(&self, path: &str) -> String

Source§

fn query(&self) -> Vec<(&str, &str)>

Source§

fn api_base(&self) -> &str

Source§

fn api_key(&self) -> &SecretString

Source§

impl Config for Rc<dyn Config>

Source§

fn headers(&self) -> HeaderMap

Source§

fn url(&self, path: &str) -> String

Source§

fn query(&self) -> Vec<(&str, &str)>

Source§

fn api_base(&self) -> &str

Source§

fn api_key(&self) -> &SecretString

Source§

impl Config for Arc<dyn Config>

Source§

fn headers(&self) -> HeaderMap

Source§

fn url(&self, path: &str) -> String

Source§

fn query(&self) -> Vec<(&str, &str)>

Source§

fn api_base(&self) -> &str

Source§

fn api_key(&self) -> &SecretString

Implementors§