#[non_exhaustive]pub struct ClientConfigBuilder { /* private fields */ }Expand description
EN: Builder for SDK client configuration. 中文:SDK 客户端配置构建器。
Implementations§
Source§impl ClientConfigBuilder
impl ClientConfigBuilder
Sourcepub fn api_key(self, api_key: impl Into<String>) -> Self
pub fn api_key(self, api_key: impl Into<String>) -> Self
EN: Sets the OpenAI API key used for bearer authentication. 中文:设置用于 Bearer 认证的 OpenAI API key。
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
EN: Sets the OpenAI API base URL. 中文:设置 OpenAI API 基础 URL。
Sourcepub fn organization(self, organization: impl Into<String>) -> Self
pub fn organization(self, organization: impl Into<String>) -> Self
EN: Sets the optional OpenAI organization header. 中文:设置可选的 OpenAI 组织请求头。
Sourcepub fn project(self, project: impl Into<String>) -> Self
pub fn project(self, project: impl Into<String>) -> Self
EN: Sets the optional OpenAI project header. 中文:设置可选的 OpenAI 项目请求头。
Sourcepub fn retry_policy(self, retry_policy: RetryPolicy) -> Self
pub fn retry_policy(self, retry_policy: RetryPolicy) -> Self
EN: Sets the retry policy. 中文:设置重试策略。
Sourcepub fn retry_sleeper(self, retry_sleeper: Arc<dyn RetrySleeper>) -> Self
pub fn retry_sleeper(self, retry_sleeper: Arc<dyn RetrySleeper>) -> Self
EN: Sets the retry sleeper used between retry attempts. 中文:设置两次重试之间使用的休眠器。
Sourcepub fn build(self) -> Result<ClientConfig, LingerError>
pub fn build(self) -> Result<ClientConfig, LingerError>
EN: Builds and validates the client configuration. 中文:构建并校验客户端配置。
Trait Implementations§
Source§impl Clone for ClientConfigBuilder
impl Clone for ClientConfigBuilder
Source§fn clone(&self) -> ClientConfigBuilder
fn clone(&self) -> ClientConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ClientConfigBuilder
impl Debug for ClientConfigBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfigBuilder
impl !UnwindSafe for ClientConfigBuilder
impl Freeze for ClientConfigBuilder
impl Send for ClientConfigBuilder
impl Sync for ClientConfigBuilder
impl Unpin for ClientConfigBuilder
impl UnsafeUnpin for ClientConfigBuilder
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