pub struct ToolResult {
pub call: ToolCallId,
pub provider: Option<ProviderCallId>,
pub name: String,
pub content: Vec<ToolResultContent>,
}Expand description
Tool result content containing information about a tool call and it’s resulting content.
Fields§
§call: ToolCallIdWhich call this result answers — rig’s correlation handle, always
present. Copied from the answered ToolCall::id, which is minted
at the provider boundary when the provider issued no identifier.
provider: Option<ProviderCallId>What the provider issued for the answered call, if anything — the only identifiers that may travel back on that provider’s wire.
name: StringName of the tool that produced this result — the executed tool, which can differ from the model’s call when a hook repaired it.
Required: several wires key the replay on it (Gemini’s
functionResponse.name, Ollama’s tool messages), and an identifier
is not a name — rig used to smuggle the name through the id, which
collided two calls to the same tool and misnamed cross-provider
replays (review 84a43e9e #5).
content: Vec<ToolResultContent>One or more content items produced by the tool.
Implementations§
Source§impl ToolResult
impl ToolResult
Sourcepub fn wire_call_id(&self) -> &str
pub fn wire_call_id(&self) -> &str
The identifier for a wire whose call-id slot is required: the
provider-issued call_id when the provider issued one, else rig’s
minted handle — always non-empty.
Wires whose id slot is optional (Gemini REST, gRPC) must read
ToolResult::provider directly instead: minted handles never
travel upstream there.
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl<'de> Deserialize<'de> for ToolResult
impl<'de> Deserialize<'de> for ToolResult
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>,
Source§impl From<ToolResult> for Message
impl From<ToolResult> for Message
Source§fn from(value: ToolResult) -> Self
fn from(value: ToolResult) -> Self
Source§impl PartialEq for ToolResult
impl PartialEq for ToolResult
Source§impl Serialize for ToolResult
impl Serialize for ToolResult
impl StructuralPartialEq for ToolResult
Source§impl TryFrom<ToolResult> for Message
impl TryFrom<ToolResult> for Message
Source§type Error = MessageError
type Error = MessageError
Auto Trait Implementations§
impl Freeze for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin for ToolResult
impl UnwindSafe for ToolResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more