pub struct RequestOptions {
pub response_format: ResponseFormat,
pub reasoning_effort: Option<String>,
pub single_attempt: bool,
pub fallback_when_unspent: bool,
pub cache_key: Option<String>,
}Expand description
How a provider should answer, beyond the messages and tools. Providers map what their API supports and ignore the rest.
Fields§
§response_format: ResponseFormat§reasoning_effort: Option<String>Provider-neutral reasoning effort: "low", "medium" or "high";
"off" turns reasoning off. None keeps the provider’s default.
single_attempt: boolExactly one attempt: providers skip their own internal retries, and
Retry and crate::Failover give up at the first error. For a
call that must not run twice.
fallback_when_unspent: boolWith single_attempt, lets a crate::Failover chain move on to
its next step after an error that proves the attempt used nothing
(ProviderError::proves_nothing_spent) or after the policy
refused the attempt before sending it. Any other error still ends
the chain, and no step is retried. For a call charged against a
fixed budget, where unknown spend must not be repeated.
cache_key: Option<String>Identifies the conversation for providers that route prompt-cache lookups by key, so its calls reach the same cache. Only a routing hint: providers that do not route by key ignore it.
Trait Implementations§
Source§impl Clone for RequestOptions
impl Clone for RequestOptions
Source§fn clone(&self) -> RequestOptions
fn clone(&self) -> RequestOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestOptions
impl Debug for RequestOptions
Source§impl Default for RequestOptions
impl Default for RequestOptions
Source§fn default() -> RequestOptions
fn default() -> RequestOptions
Source§impl PartialEq for RequestOptions
impl PartialEq for RequestOptions
impl StructuralPartialEq for RequestOptions
Auto Trait Implementations§
impl Forget for RequestOptions
impl Freeze for RequestOptionswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for RequestOptions
impl RefUnwindSafe for RequestOptions
impl Send for RequestOptions
impl Sync for RequestOptions
impl Unpin for RequestOptions
impl UnsafeUnpin for RequestOptionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for RequestOptions
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
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> ⓘ
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> ⓘ
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