pub struct HostedToolActivity { /* private fields */ }Expand description
One complete provider-hosted tool activity retained in assistant content.
Implementations§
Source§impl HostedToolActivity
impl HostedToolActivity
Sourcepub fn new(
tool_call_id: ToolCallId,
provider_call_id: impl Into<String>,
tool_name: impl Into<String>,
arguments: Value,
outcome: HostedToolOutcome,
sources: Vec<ExternalSource>,
continuation: Option<ProviderContinuation>,
) -> Result<Self, ExternalContentError>
pub fn new( tool_call_id: ToolCallId, provider_call_id: impl Into<String>, tool_name: impl Into<String>, arguments: Value, outcome: HostedToolOutcome, sources: Vec<ExternalSource>, continuation: Option<ProviderContinuation>, ) -> Result<Self, ExternalContentError>
Creates a validated complete hosted tool activity.
§Errors
Returns an error for invalid identity, arguments, source count, or continuation data.
Sourcepub const fn tool_call_id(&self) -> ToolCallId
pub const fn tool_call_id(&self) -> ToolCallId
Returns the canonical activity identifier.
Sourcepub fn provider_call_id(&self) -> &str
pub fn provider_call_id(&self) -> &str
Returns the provider-owned activity identifier.
Sourcepub const fn outcome(&self) -> &HostedToolOutcome
pub const fn outcome(&self) -> &HostedToolOutcome
Returns the terminal hosted outcome.
Sourcepub fn sources(&self) -> &[ExternalSource]
pub fn sources(&self) -> &[ExternalSource]
Returns normalized sources in provider order.
Sourcepub const fn continuation(&self) -> Option<&ProviderContinuation>
pub const fn continuation(&self) -> Option<&ProviderContinuation>
Returns provider-owned continuation data for matching adapters.
Trait Implementations§
Source§impl Clone for HostedToolActivity
impl Clone for HostedToolActivity
Source§fn clone(&self) -> HostedToolActivity
fn clone(&self) -> HostedToolActivity
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 HostedToolActivity
impl Debug for HostedToolActivity
Source§impl<'de> Deserialize<'de> for HostedToolActivity
impl<'de> Deserialize<'de> for HostedToolActivity
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
impl Eq for HostedToolActivity
Source§impl PartialEq for HostedToolActivity
impl PartialEq for HostedToolActivity
Source§impl Serialize for HostedToolActivity
impl Serialize for HostedToolActivity
impl StructuralPartialEq for HostedToolActivity
Auto Trait Implementations§
impl Freeze for HostedToolActivity
impl RefUnwindSafe for HostedToolActivity
impl Send for HostedToolActivity
impl Sync for HostedToolActivity
impl Unpin for HostedToolActivity
impl UnsafeUnpin for HostedToolActivity
impl UnwindSafe for HostedToolActivity
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