Struct OpenAiBuilder
pub struct OpenAiBuilder { /* private fields */ }Expand description
Typed builder for OpenAiModelProvider.
Only alias is required. base_url defaults to the module-level
BASE_URL constant, credential treats whitespace-only inputs as
missing, and timeout_secs uses the 120 s workspace default.
Implementations§
Source§impl OpenAiBuilder
impl OpenAiBuilder
Sourcepub fn credential(self, credential: Option<&str>) -> OpenAiBuilder
pub fn credential(self, credential: Option<&str>) -> OpenAiBuilder
Explicit API credential. Whitespace-only inputs collapse to
None.
Sourcepub fn base_url(self, base_url: &str) -> OpenAiBuilder
pub fn base_url(self, base_url: &str) -> OpenAiBuilder
Override the API endpoint. Trailing slashes are stripped.
Sourcepub fn max_tokens(self, max_tokens: Option<u32>) -> OpenAiBuilder
pub fn max_tokens(self, max_tokens: Option<u32>) -> OpenAiBuilder
Set the maximum output tokens for API requests.
Sourcepub fn timeout_secs(self, secs: u64) -> OpenAiBuilder
pub fn timeout_secs(self, secs: u64) -> OpenAiBuilder
Override the HTTP request timeout for LLM API calls. Values of 0
are ignored (the default 120 s is kept) so a stray Some(0) from
config cannot silently disable the safety timeout.
pub fn build(self) -> OpenAiModelProvider
Auto Trait Implementations§
impl Freeze for OpenAiBuilder
impl RefUnwindSafe for OpenAiBuilder
impl Send for OpenAiBuilder
impl Sync for OpenAiBuilder
impl Unpin for OpenAiBuilder
impl UnsafeUnpin for OpenAiBuilder
impl UnwindSafe for OpenAiBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more