pub struct WebSearchOptions { /* private fields */ }Expand description
Portable policy shared by hosted web-search adapters.
Implementations§
Source§impl WebSearchOptions
impl WebSearchOptions
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates unrestricted web-search options with no location disclosure.
Sourcepub fn with_allowed_domains<I, S>(
self,
domains: I,
) -> Result<Self, ModelRequestError>
pub fn with_allowed_domains<I, S>( self, domains: I, ) -> Result<Self, ModelRequestError>
Sets a canonical allowlist, replacing any previous allowlist.
§Errors
Returns an error for invalid domains, too many domains, or a configured blocklist.
Sourcepub fn with_blocked_domains<I, S>(
self,
domains: I,
) -> Result<Self, ModelRequestError>
pub fn with_blocked_domains<I, S>( self, domains: I, ) -> Result<Self, ModelRequestError>
Sets a canonical blocklist, replacing any previous blocklist.
§Errors
Returns an error for invalid domains, too many domains, or a configured allowlist.
Sourcepub fn with_location(self, location: WebSearchLocation) -> Self
pub fn with_location(self, location: WebSearchLocation) -> Self
Adds an approximate location disclosed only after the tool is active.
Sourcepub fn allowed_domains(&self) -> &[String]
pub fn allowed_domains(&self) -> &[String]
Returns allowed domains in deterministic canonical order.
Sourcepub fn blocked_domains(&self) -> &[String]
pub fn blocked_domains(&self) -> &[String]
Returns blocked domains in deterministic canonical order.
Sourcepub const fn location(&self) -> Option<&WebSearchLocation>
pub const fn location(&self) -> Option<&WebSearchLocation>
Returns the optional approximate location.
Trait Implementations§
Source§impl Clone for WebSearchOptions
impl Clone for WebSearchOptions
Source§fn clone(&self) -> WebSearchOptions
fn clone(&self) -> WebSearchOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WebSearchOptions
impl Debug for WebSearchOptions
Source§impl Default for WebSearchOptions
impl Default for WebSearchOptions
Source§fn default() -> WebSearchOptions
fn default() -> WebSearchOptions
Returns the “default value” for a type. Read more
impl Eq for WebSearchOptions
Source§impl PartialEq for WebSearchOptions
impl PartialEq for WebSearchOptions
impl StructuralPartialEq for WebSearchOptions
Auto Trait Implementations§
impl Freeze for WebSearchOptions
impl RefUnwindSafe for WebSearchOptions
impl Send for WebSearchOptions
impl Sync for WebSearchOptions
impl Unpin for WebSearchOptions
impl UnsafeUnpin for WebSearchOptions
impl UnwindSafe for WebSearchOptions
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