OAIConfig

Trait OAIConfig 

Source
pub trait OAIConfig:
    Config
    + Send
    + Sync
    + 'static {
    // Required methods
    fn create() -> Self;
    fn with_api_key<S: Into<String>>(&mut self, api_key: S) -> Self;
    fn with_api_base<S: Into<String>>(&mut self, api_base: S) -> Self;
    fn model_config() -> (String, Vec<String>);
    fn tokenizer(&self) -> Box<dyn Tokenizer>;
}
Expand description

config extension

Required Methods§

Source

fn create() -> Self

Source

fn with_api_key<S: Into<String>>(&mut self, api_key: S) -> Self

Source

fn with_api_base<S: Into<String>>(&mut self, api_base: S) -> Self

To use a API base url different from default OPENAI_API_BASE

Source

fn model_config() -> (String, Vec<String>)

Source

fn tokenizer(&self) -> Box<dyn Tokenizer>

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§