pub struct Timeout {
pub total: Option<Duration>,
pub step: Option<Duration>,
pub first_chunk: Option<Duration>,
pub chunk: Option<Duration>,
pub tool: Option<Duration>,
pub per_tool: HashMap<ToolName, Duration>,
}Expand description
Timeouts applied to a call.
first_chunk and chunk only apply to streaming calls; total covers
the whole call including tool execution.
Fields§
§total: Option<Duration>Whole call.
step: Option<Duration>One step (model call plus its tool executions).
first_chunk: Option<Duration>Streaming: from the request until the first content part.
chunk: Option<Duration>Streaming: between two consecutive content parts.
tool: Option<Duration>Default per tool execution.
per_tool: HashMap<ToolName, Duration>Per-tool overrides of tool.
Implementations§
Source§impl Timeout
impl Timeout
Sourcepub fn with_total(self, total: Duration) -> Self
pub fn with_total(self, total: Duration) -> Self
Sets the total timeout.
Sourcepub fn with_first_chunk(self, first_chunk: Duration) -> Self
pub fn with_first_chunk(self, first_chunk: Duration) -> Self
Sets the first-chunk timeout (streaming only).
Sourcepub fn with_chunk(self, chunk: Duration) -> Self
pub fn with_chunk(self, chunk: Duration) -> Self
Sets the inter-chunk timeout (streaming only).
Sourcepub fn with_tool_for(self, name: impl Into<ToolName>, timeout: Duration) -> Self
pub fn with_tool_for(self, name: impl Into<ToolName>, timeout: Duration) -> Self
Sets the timeout of one tool.
Sourcepub fn tool_timeout(&self, tool: &ToolName) -> Option<Duration>
pub fn tool_timeout(&self, tool: &ToolName) -> Option<Duration>
Returns the timeout for tool: the per-tool override, else the
default tool timeout.
Trait Implementations§
impl Eq for Timeout
impl StructuralPartialEq for Timeout
Auto Trait Implementations§
impl Freeze for Timeout
impl RefUnwindSafe for Timeout
impl Send for Timeout
impl Sync for Timeout
impl Unpin for Timeout
impl UnsafeUnpin for Timeout
impl UnwindSafe for Timeout
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.