pub enum Tool {
Function(FunctionTool),
FileSearch(FileSearchTool),
ComputerUsePreview(ComputerUsePreviewTool),
WebSearch(WebSearchTool),
WebSearch20250826(WebSearchTool),
Mcp(MCPTool),
CodeInterpreter(CodeInterpreterTool),
ImageGeneration(ImageGenTool),
LocalShell,
Custom(CustomToolParam),
WebSearchPreview(WebSearchTool),
WebSearchPreview20250311(WebSearchTool),
}Expand description
Definitions for model-callable tools.
Variants§
Function(FunctionTool)
Defines a function in your own code the model can choose to call. Learn more about function calling.
FileSearch(FileSearchTool)
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
ComputerUsePreview(ComputerUsePreviewTool)
A tool that controls a virtual computer. Learn more about the computer use tool.
WebSearch(WebSearchTool)
Search the Internet for sources related to the prompt. Learn more about the web search tool.
WebSearch20250826(WebSearchTool)
type: web_search_2025_08_26
Mcp(MCPTool)
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
CodeInterpreter(CodeInterpreterTool)
A tool that runs Python code to help generate a response to a prompt.
ImageGeneration(ImageGenTool)
A tool that generates images using a model like gpt-image-1.
LocalShell
A tool that allows the model to execute shell commands in a local environment.
Custom(CustomToolParam)
A custom tool that processes input using a specified format. Learn more about custom tools
WebSearchPreview(WebSearchTool)
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
WebSearchPreview20250311(WebSearchTool)
type: web_search_preview_2025_03_11
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>,
impl StructuralPartialEq for Tool
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)