pub struct RunResult {
pub input: Vec<InputItem>,
pub new_items: Vec<RunItem>,
pub raw_responses: Vec<ModelResponse>,
pub final_output: String,
pub usage: Usage,
}Expand description
Result of an agent run
Fields§
§input: Vec<InputItem>The original input
new_items: Vec<RunItem>New items generated during the run
raw_responses: Vec<ModelResponse>Raw model responses
final_output: StringThe final output
usage: UsageTotal usage statistics
Implementations§
Source§impl RunResult
impl RunResult
Sourcepub fn new(
input: Vec<InputItem>,
new_items: Vec<RunItem>,
raw_responses: Vec<ModelResponse>,
final_output: String,
usage: Usage,
) -> Self
pub fn new( input: Vec<InputItem>, new_items: Vec<RunItem>, raw_responses: Vec<ModelResponse>, final_output: String, usage: Usage, ) -> Self
Create a new run result
Sourcepub fn to_input_list(&self) -> Vec<InputItem>
pub fn to_input_list(&self) -> Vec<InputItem>
Convert the result back to a list of input items
This merges the original input with all new items, useful for continuing a conversation.
Sourcepub fn last_message(&self) -> Option<&str>
pub fn last_message(&self) -> Option<&str>
Get the last message content from the result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunResult
impl<'de> Deserialize<'de> for RunResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RunResult
impl RefUnwindSafe for RunResult
impl Send for RunResult
impl Sync for RunResult
impl Unpin for RunResult
impl UnsafeUnpin for RunResult
impl UnwindSafe for RunResult
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