Struct OpenRouterBuilder
pub struct OpenRouterBuilder { /* private fields */ }Expand description
Typed builder for OpenRouterModelProvider.
Only alias is required. credential treats whitespace-only inputs
as missing (defensive against stray config values). Timeout,
max_tokens, and extra_body all have sensible defaults.
Implementations§
Source§impl OpenRouterBuilder
impl OpenRouterBuilder
Sourcepub fn credential(self, credential: Option<&str>) -> OpenRouterBuilder
pub fn credential(self, credential: Option<&str>) -> OpenRouterBuilder
Explicit API credential. Whitespace-only inputs collapse to
None.
Sourcepub fn timeout_secs(self, secs: u64) -> OpenRouterBuilder
pub fn timeout_secs(self, secs: u64) -> OpenRouterBuilder
Override the HTTP request timeout for LLM API calls. Values of 0
are ignored (the default timeout is kept) so a stray Some(0)
from config cannot disable the safety timeout.
pub fn max_tokens(self, max_tokens: Option<u32>) -> OpenRouterBuilder
Sourcepub fn extra_body(self, extra: Value) -> OpenRouterBuilder
pub fn extra_body(self, extra: Value) -> OpenRouterBuilder
Set extra JSON parameters to merge into every API request body.
Keys in extra are inserted at the top level of the serialized
request, overriding any existing keys with the same name.
pub fn build(self) -> OpenRouterModelProvider
Auto Trait Implementations§
impl Freeze for OpenRouterBuilder
impl RefUnwindSafe for OpenRouterBuilder
impl Send for OpenRouterBuilder
impl Sync for OpenRouterBuilder
impl Unpin for OpenRouterBuilder
impl UnsafeUnpin for OpenRouterBuilder
impl UnwindSafe for OpenRouterBuilder
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