pub struct AgentResponse {
pub content: String,
pub usage: TokenUsage,
pub finish_reason: FinishReason,
pub is_quit: bool,
}Expand description
Flattened response type for public API.
This hides internal implementation details like AgentRunResult::Finished
and provides a clean, simple interface.
Fields§
§content: StringFinal text content from the agent.
usage: TokenUsageToken usage for this turn.
finish_reason: FinishReasonWhy the turn ended.
is_quit: boolWhether this response indicates a quit command.
Implementations§
Source§impl AgentResponse
impl AgentResponse
Sourcepub fn new(
content: impl Into<String>,
usage: TokenUsage,
finish_reason: FinishReason,
) -> Self
pub fn new( content: impl Into<String>, usage: TokenUsage, finish_reason: FinishReason, ) -> Self
Create a normal response.
Sourcepub fn command_output(output: impl Into<String>) -> Self
pub fn command_output(output: impl Into<String>) -> Self
Create a command output response.
Trait Implementations§
Source§impl Clone for AgentResponse
impl Clone for AgentResponse
Source§fn clone(&self) -> AgentResponse
fn clone(&self) -> AgentResponse
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 AgentResponse
impl RefUnwindSafe for AgentResponse
impl Send for AgentResponse
impl Sync for AgentResponse
impl Unpin for AgentResponse
impl UnsafeUnpin for AgentResponse
impl UnwindSafe for AgentResponse
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