pub struct Tool {
pub tool_type: String,
pub name: String,
pub description: String,
pub parameters: Value,
}
Expand description
Tool definition for function calling
Defines a tool that GPT-5 can call during its response generation.
§Examples
use gpt5::Tool;
use serde_json::json;
let weather_tool = Tool {
tool_type: "function".to_string(),
name: "get_weather".to_string(),
description: "Get current weather".to_string(),
parameters: json!({
"type": "object",
"properties": {
"location": {"type": "string"}
}
}),
};
Fields§
§tool_type: String
§name: String
§description: String
§parameters: Value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tool
impl<'de> Deserialize<'de> for Tool
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 Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnwindSafe for Tool
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