pub struct WebSearchTool20250305 {
pub name: String,
pub allowed_domains: Option<Vec<String>>,
pub blocked_domains: Option<Vec<String>>,
pub cache_control: Option<CacheControlEphemeral>,
pub max_uses: Option<i32>,
pub user_location: Option<UserLocation>,
}Expand description
Parameters for the web search tool.
This tool allows the model to search the web for information.
Fields§
§name: StringName of the tool. This is how the tool will be called by the model and in tool_use blocks.
allowed_domains: Option<Vec<String>>If provided, only these domains will be included in results.
Cannot be used alongside blocked_domains.
blocked_domains: Option<Vec<String>>If provided, these domains will never appear in results.
Cannot be used alongside allowed_domains.
cache_control: Option<CacheControlEphemeral>Create a cache control breakpoint at this content block.
max_uses: Option<i32>Maximum number of times the tool can be used in the API request.
user_location: Option<UserLocation>Parameters for the user’s location. Used to provide more relevant search results.
Implementations§
Source§impl WebSearchTool20250305
impl WebSearchTool20250305
Sourcepub fn with_allowed_domains(self, domains: Vec<String>) -> Self
pub fn with_allowed_domains(self, domains: Vec<String>) -> Self
Sets the allowed domains for the web search
If provided, only these domains will be included in results.
Cannot be used alongside blocked_domains.
Sourcepub fn with_blocked_domains(self, domains: Vec<String>) -> Self
pub fn with_blocked_domains(self, domains: Vec<String>) -> Self
Sets the blocked domains for the web search
If provided, these domains will never appear in results.
Cannot be used alongside allowed_domains.
Sourcepub fn with_cache_control(self, cache_control: CacheControlEphemeral) -> Self
pub fn with_cache_control(self, cache_control: CacheControlEphemeral) -> Self
Sets the cache control for the web search
Sourcepub fn with_max_uses(self, max_uses: i32) -> Self
pub fn with_max_uses(self, max_uses: i32) -> Self
Sets the maximum number of times the tool can be used in the API request
Sourcepub fn with_user_location(self, user_location: UserLocation) -> Self
pub fn with_user_location(self, user_location: UserLocation) -> Self
Sets the user location for the web search
Trait Implementations§
Source§impl Clone for WebSearchTool20250305
impl Clone for WebSearchTool20250305
Source§fn clone(&self) -> WebSearchTool20250305
fn clone(&self) -> WebSearchTool20250305
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebSearchTool20250305
impl Debug for WebSearchTool20250305
Source§impl Default for WebSearchTool20250305
impl Default for WebSearchTool20250305
Source§impl<'de> Deserialize<'de> for WebSearchTool20250305
impl<'de> Deserialize<'de> for WebSearchTool20250305
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>,
Source§impl PartialEq for WebSearchTool20250305
impl PartialEq for WebSearchTool20250305
Source§fn eq(&self, other: &WebSearchTool20250305) -> bool
fn eq(&self, other: &WebSearchTool20250305) -> bool
self and other values to be equal, and is used by ==.