pub struct OpenAIToolCall {
pub id: String,
pub call_type: String,
pub function: OpenAIFunction,
}Expand description
OpenAI tool call representation in API messages.
Represents a request from the model to execute a specific function/tool.
This is the wire format used in the OpenAI API, distinct from the internal
ToolUseBlock representation.
§Structure
Each tool call has:
- A unique ID for correlation with results
- A type (always “function” in current OpenAI API)
- Function details (name and arguments)
§Example JSON
{
"id": "call_abc123",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\":\"San Francisco\"}"
}
}Fields§
§id: StringUnique identifier for this tool call.
Generated by the model. Used to correlate tool results back to this specific call.
call_type: StringType of the call (always “function” in current API).
The rename attribute ensures this serializes as "type" in JSON
since type is a Rust keyword.
function: OpenAIFunctionFunction/tool details (name and arguments).
Trait Implementations§
Source§impl Clone for OpenAIToolCall
impl Clone for OpenAIToolCall
Source§fn clone(&self) -> OpenAIToolCall
fn clone(&self) -> OpenAIToolCall
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 OpenAIToolCall
impl Debug for OpenAIToolCall
Source§impl<'de> Deserialize<'de> for OpenAIToolCall
impl<'de> Deserialize<'de> for OpenAIToolCall
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 OpenAIToolCall
impl RefUnwindSafe for OpenAIToolCall
impl Send for OpenAIToolCall
impl Sync for OpenAIToolCall
impl Unpin for OpenAIToolCall
impl UnsafeUnpin for OpenAIToolCall
impl UnwindSafe for OpenAIToolCall
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