pub struct ClientOptions {
pub api_key: Option<String>,
pub organization: Option<String>,
pub project: Option<String>,
pub base_url: Option<String>,
pub timeout: Duration,
pub max_retries: u32,
pub default_headers: HashMap<String, String>,
pub default_query: HashMap<String, String>,
}Expand description
客户端初始化选项。
边界约束:
api_key可通过显式传入或环境变量OPENAI_API_KEY提供。default_headers与default_query会应用于每次请求。
Fields§
§api_key: Option<String>§organization: Option<String>§project: Option<String>§base_url: Option<String>§timeout: Duration§max_retries: u32§default_headers: HashMap<String, String>§default_query: HashMap<String, String>Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientOptions
impl Debug for ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin for ClientOptions
impl UnwindSafe for ClientOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more