pub struct StreamResult {
pub text: String,
pub tool_calls: Vec<ToolCall>,
pub usage: Option<TokenUsage>,
pub stop_reason: Option<StopReason>,
}Expand description
Result of stream collection used by runtime and plugin phase contracts.
Fields§
§text: StringAccumulated text content.
tool_calls: Vec<ToolCall>Collected tool calls.
usage: Option<TokenUsage>Token usage from the LLM response.
stop_reason: Option<StopReason>Why the model stopped generating. None when the backend cannot
determine or map the provider stop reason.
Implementations§
Source§impl StreamResult
impl StreamResult
Sourcepub fn needs_tools(&self) -> bool
pub fn needs_tools(&self) -> bool
Check if tool execution is needed.
Trait Implementations§
Source§impl Clone for StreamResult
impl Clone for StreamResult
Source§fn clone(&self) -> StreamResult
fn clone(&self) -> StreamResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StreamResult
impl RefUnwindSafe for StreamResult
impl Send for StreamResult
impl Sync for StreamResult
impl Unpin for StreamResult
impl UnwindSafe for StreamResult
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