#[non_exhaustive]pub struct OpenRouterOptions {
pub shared: OpenRouterShared,
}Expand description
OpenRouter’s request options, all sent on every route.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.The fields every route takes.
Implementations§
Source§impl OpenRouterOptions
impl OpenRouterOptions
Sourcepub fn provider(self, preferences: ProviderPreferences) -> Self
pub fn provider(self, preferences: ProviderPreferences) -> Self
Route by preferences.
Sourcepub fn models(self, models: ModelFallbacks) -> Self
pub fn models(self, models: ModelFallbacks) -> Self
Fall back to models, in order, after the request’s own model.
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Group the request under session id.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Attach the metadata pair key, value.
Sourcepub fn reasoning_exclude(self, exclude: bool) -> Self
pub fn reasoning_exclude(self, exclude: bool) -> Self
Reason but leave the reasoning out of the reply when exclude.
Sourcepub fn reasoning_summary(self, summary: ReasoningSummary) -> Self
pub fn reasoning_summary(self, summary: ReasoningSummary) -> Self
Summarize the reasoning at summary.
Sourcepub fn repetition_penalty(self, penalty: f64) -> Self
pub fn repetition_penalty(self, penalty: f64) -> Self
Set the repetition penalty.
Trait Implementations§
Source§impl Clone for OpenRouterOptions
impl Clone for OpenRouterOptions
Source§impl Debug for OpenRouterOptions
impl Debug for OpenRouterOptions
Source§impl Default for OpenRouterOptions
impl Default for OpenRouterOptions
Source§impl ExtensionOptions for OpenRouterOptions
impl ExtensionOptions for OpenRouterOptions
Source§type Ext = OpenRouterExt
type Ext = OpenRouterExt
The provider these options are for: the entry
ProviderOptions::set stores them under. A type that serves as the
Options of several providers names one of them here, and is stored
for the others with ProviderOptions::with.Source§fn unsupported(
&self,
target: &dyn ReplayTarget,
request: &CompletionRequest,
) -> Vec<(&'static str, String)>
fn unsupported( &self, target: &dyn ReplayTarget, request: &CompletionRequest, ) -> Vec<(&'static str, String)>
The fields
target cannot send for request, each a top-level body
key with the reason. Each one set is reported through the request’s
OnUnsupported policy under the
name "<provider>.<section>.<field>". It must not call
options::param, which reads
it. By default every field is sent.Source§impl PartialEq for OpenRouterOptions
impl PartialEq for OpenRouterOptions
Source§impl Serialize for OpenRouterOptions
impl Serialize for OpenRouterOptions
impl StructuralPartialEq for OpenRouterOptions
Auto Trait Implementations§
impl Freeze for OpenRouterOptions
impl RefUnwindSafe for OpenRouterOptions
impl Send for OpenRouterOptions
impl Sync for OpenRouterOptions
impl Unpin for OpenRouterOptions
impl UnsafeUnpin for OpenRouterOptions
impl UnwindSafe for OpenRouterOptions
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.