pub struct WebSearchPreviewTool {
pub type_: WebSearchPreviewToolType,
pub user_location: Option<ApproximateLocation>,
pub search_context_size: Option<WebSearchPreviewToolSearchContextSize>,
}
Expand description
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
Fields§
§type_: WebSearchPreviewToolType
The type of the web search tool. One of web_search_preview
or web_search_preview_2025_03_11
.
user_location: Option<ApproximateLocation>
The user’s location.
search_context_size: Option<WebSearchPreviewToolSearchContextSize>
High level guidance for the amount of context window space to use for the search. One of low
, medium
, or high
. medium
is the default.
Implementations§
Source§impl WebSearchPreviewTool
impl WebSearchPreviewTool
Sourcepub fn builder() -> WebSearchPreviewToolBuilder<((), (), ())>
pub fn builder() -> WebSearchPreviewToolBuilder<((), (), ())>
Create a builder for building WebSearchPreviewTool
.
On the builder, call .type_(...)
(optional), .user_location(...)
(optional), .search_context_size(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of WebSearchPreviewTool
.
Trait Implementations§
Source§impl Clone for WebSearchPreviewTool
impl Clone for WebSearchPreviewTool
Source§fn clone(&self) -> WebSearchPreviewTool
fn clone(&self) -> WebSearchPreviewTool
Returns a duplicate of the value. Read more
1.0.0 · 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 WebSearchPreviewTool
impl Debug for WebSearchPreviewTool
Source§impl Default for WebSearchPreviewTool
impl Default for WebSearchPreviewTool
Source§fn default() -> WebSearchPreviewTool
fn default() -> WebSearchPreviewTool
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WebSearchPreviewTool
impl<'de> Deserialize<'de> for WebSearchPreviewTool
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
Source§impl PartialEq for WebSearchPreviewTool
impl PartialEq for WebSearchPreviewTool
Source§impl Serialize for WebSearchPreviewTool
impl Serialize for WebSearchPreviewTool
impl StructuralPartialEq for WebSearchPreviewTool
Auto Trait Implementations§
impl Freeze for WebSearchPreviewTool
impl RefUnwindSafe for WebSearchPreviewTool
impl Send for WebSearchPreviewTool
impl Sync for WebSearchPreviewTool
impl Unpin for WebSearchPreviewTool
impl UnwindSafe for WebSearchPreviewTool
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