pub enum Tool {
Function {
name: String,
description: Option<String>,
parameters: Option<Value>,
strict: Option<bool>,
},
WebSearch,
WebExtractor,
CodeInterpreter,
WebSearchImage,
ImageSearch,
FileSearch {
vector_store_ids: Vec<String>,
},
Mcp {
server_protocol: String,
server_label: String,
server_url: String,
server_description: Option<String>,
headers: Option<HashMap<String, String>>,
},
}Expand description
A tool the model may call while generating a response.
Variants§
Function
A user-defined function.
Fields
§
name: StringThe name of the function. Must be non-empty, at most 128
characters, and match ^[a-zA-Z0-9_-]+$; names must be unique.
WebSearch
A server-side web search tool.
WebExtractor
Qwen: a web page extraction tool. Must be used together with
web_search.
CodeInterpreter
Qwen: a code interpreter tool that executes code and returns the result. Some models require thinking mode to be enabled.
WebSearchImage
Qwen: a text-to-image search tool.
ImageSearch
Qwen: an image-to-image search tool; the input must contain an image URL.
FileSearch
Qwen: a knowledge-base search tool over one uploaded vector store.
Fields
Mcp
Qwen: a Model Context Protocol (MCP) tool.
Fields
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin 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