pub enum ModelResponse {
Message {
text: String,
stop_reason: String,
usage: Option<HarnessUsage>,
},
ToolCall {
preface: Option<String>,
invocation: ToolInvocation,
usage: Option<HarnessUsage>,
},
}Expand description
Response from a single model call. Message is a final answer (no
follow-up tool needed); ToolCall hands control back to the harness
loop to execute the tool and feed the result back next turn.
usage carries the provider-reported token tally for this call.
AgentLoopHarness accumulates these across all steps of a turn and
attaches the total to the final HarnessInternalEvent::TurnEnd.
None ⇒ provider didn’t report usage on this call (e.g. mid-stream
chunk, scripted fake client).
Variants§
Implementations§
Source§impl ModelResponse
impl ModelResponse
Sourcepub fn usage(&self) -> Option<&HarnessUsage>
pub fn usage(&self) -> Option<&HarnessUsage>
Per-call usage, regardless of variant. Pulled out so AgentLoopHarness can fold it into the running total without matching on every branch.
Trait Implementations§
Source§impl Clone for ModelResponse
impl Clone for ModelResponse
Source§fn clone(&self) -> ModelResponse
fn clone(&self) -> ModelResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelResponse
impl Debug for ModelResponse
Source§impl PartialEq for ModelResponse
impl PartialEq for ModelResponse
Source§fn eq(&self, other: &ModelResponse) -> bool
fn eq(&self, other: &ModelResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ModelResponse
Auto Trait Implementations§
impl Freeze for ModelResponse
impl RefUnwindSafe for ModelResponse
impl Send for ModelResponse
impl Sync for ModelResponse
impl Unpin for ModelResponse
impl UnsafeUnpin for ModelResponse
impl UnwindSafe for ModelResponse
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