pub struct ToolCall {
pub id: String,
pub call_id: Option<String>,
pub function: ToolFunction,
pub signature: Option<String>,
pub additional_params: Option<Value>,
}Expand description
Describes a tool call with an id and function to call, generally produced by a provider.
Fields§
§id: StringProvider-supplied tool call ID.
call_id: Option<String>Provider-specific call ID used by some APIs for tool result correlation.
function: ToolFunctionFunction name and JSON arguments requested by the model.
signature: Option<String>Optional cryptographic signature for the tool call.
This field is used by some providers (e.g., Google) to provide a signature that can verify the authenticity and integrity of the tool call. When present, it allows verification that the tool call was actually generated by the model and has not been tampered with.
This is an optional, provider-specific feature and will be None for providers
that don’t support tool call signatures.
additional_params: Option<Value>Additional provider-specific parameters to be sent to the completion model provider
Implementations§
Source§impl ToolCall
impl ToolCall
pub fn new(id: String, function: ToolFunction) -> Self
pub fn with_call_id(self, call_id: String) -> Self
pub fn with_signature(self, signature: Option<String>) -> Self
pub fn with_additional_params(self, additional_params: Option<Value>) -> Self
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>,
Source§impl From<RawStreamingToolCall> for ToolCall
impl From<RawStreamingToolCall> for ToolCall
Source§fn from(tool_call: RawStreamingToolCall) -> Self
fn from(tool_call: RawStreamingToolCall) -> Self
Source§impl From<ToolCall> for FunctionCall
impl From<ToolCall> for FunctionCall
impl StructuralPartialEq for ToolCall
Auto Trait Implementations§
impl Freeze for ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin for ToolCall
impl UnsafeUnpin 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
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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