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: String§call_id: Option<String>§function: ToolFunction§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) -> ToolCall
pub fn with_call_id(self, call_id: String) -> ToolCall
pub fn with_signature(self, signature: Option<String>) -> ToolCall
pub fn with_additional_params( self, additional_params: Option<Value>, ) -> ToolCall
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCall, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCall, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RawStreamingToolCall> for ToolCall
impl From<RawStreamingToolCall> for ToolCall
Source§fn from(tool_call: RawStreamingToolCall) -> ToolCall
fn from(tool_call: RawStreamingToolCall) -> ToolCall
Converts to this type from the input type.
Source§impl From<ToolCall> for FunctionCall
impl From<ToolCall> for FunctionCall
Source§fn from(tool_call: ToolCall) -> FunctionCall
fn from(tool_call: ToolCall) -> FunctionCall
Converts to this type from the input type.
Source§impl Serialize for ToolCall
impl Serialize for ToolCall
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more