async_openai_wasm::config

Trait Config

Source
pub trait Config: Clone {
    // 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§