pub struct ToolCall {
pub id: ToolCallId,
pub name: String,
pub input: Value,
pub status: ToolCallStatus,
pub output: Option<Value>,
pub error: Option<String>,
pub created_at: Timestamp,
pub started_at: Option<Timestamp>,
pub completed_at: Option<Timestamp>,
pub metadata: Metadata,
}Fields§
§id: ToolCallId§name: String§input: Value§status: ToolCallStatus§output: Option<Value>§error: Option<String>§created_at: Timestamp§started_at: Option<Timestamp>§completed_at: Option<Timestamp>§metadata: MetadataImplementations§
Source§impl ToolCall
impl ToolCall
pub fn new(name: impl Into<String>, input: Value) -> Self
pub fn with_id(self, id: ToolCallId) -> Self
pub fn start(&mut self)
pub fn complete(&mut self, output: Value)
pub fn complete_with_text(&mut self, text: impl Into<String>)
pub fn fail(&mut self, error: impl Into<String>)
pub fn cancel(&mut self)
pub fn is_pending(&self) -> bool
pub fn is_running(&self) -> bool
pub fn is_completed(&self) -> bool
pub fn is_failed(&self) -> bool
pub fn is_terminal(&self) -> bool
pub fn duration_ms(&self) -> Option<i64>
pub fn output_as_string(&self) -> Option<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
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 ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin for ToolCall
impl UnwindSafe for ToolCall
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