pub struct WebSearchBody {
pub search_query: String,
pub search_engine: SearchEngine,
pub search_intent: Option<bool>,
pub count: Option<i32>,
pub search_domain_filter: Option<String>,
pub search_recency_filter: Option<SearchRecencyFilter>,
pub content_size: Option<ContentSize>,
pub request_id: Option<String>,
pub user_id: Option<String>,
}Expand description
Web search request body
Fields§
§search_query: StringSearch query content (max 70 characters)
search_engine: SearchEngineSearch engine to use
search_intent: Option<bool>Whether to perform search intent recognition
count: Option<i32>Number of results to return (1-50)
search_domain_filter: Option<String>Domain filter for search results (whitelist)
search_recency_filter: Option<SearchRecencyFilter>Time range filter for search results
content_size: Option<ContentSize>Content size control
request_id: Option<String>Unique request identifier
user_id: Option<String>End user unique ID (6-128 characters)
Implementations§
Source§impl WebSearchBody
impl WebSearchBody
Sourcepub fn new(search_query: String, search_engine: SearchEngine) -> Self
pub fn new(search_query: String, search_engine: SearchEngine) -> Self
Create a new web search request body with required parameters
Sourcepub fn with_search_intent(self, enabled: bool) -> Self
pub fn with_search_intent(self, enabled: bool) -> Self
Enable search intent recognition
Sourcepub fn with_count(self, count: i32) -> Self
pub fn with_count(self, count: i32) -> Self
Set the number of results to return
Sourcepub fn with_domain_filter(self, domain: String) -> Self
pub fn with_domain_filter(self, domain: String) -> Self
Set domain filter for search results
Sourcepub fn with_recency_filter(self, filter: SearchRecencyFilter) -> Self
pub fn with_recency_filter(self, filter: SearchRecencyFilter) -> Self
Set time range filter for search results
Sourcepub fn with_content_size(self, size: ContentSize) -> Self
pub fn with_content_size(self, size: ContentSize) -> Self
Set content size preference
Sourcepub fn with_request_id(self, request_id: String) -> Self
pub fn with_request_id(self, request_id: String) -> Self
Set custom request ID
Sourcepub fn with_user_id(self, user_id: String) -> Self
pub fn with_user_id(self, user_id: String) -> Self
Set user ID
Sourcepub fn validate_constraints(&self) -> ZaiResult<()>
pub fn validate_constraints(&self) -> ZaiResult<()>
Validate the request body constraints
Trait Implementations§
Source§impl Clone for WebSearchBody
impl Clone for WebSearchBody
Source§fn clone(&self) -> WebSearchBody
fn clone(&self) -> WebSearchBody
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 WebSearchBody
impl Debug for WebSearchBody
Source§impl Serialize for WebSearchBody
impl Serialize for WebSearchBody
Source§impl Validate for WebSearchBody
impl Validate for WebSearchBody
Source§impl<'v_a> ValidateArgs<'v_a> for WebSearchBody
impl<'v_a> ValidateArgs<'v_a> for WebSearchBody
Auto Trait Implementations§
impl Freeze for WebSearchBody
impl RefUnwindSafe for WebSearchBody
impl Send for WebSearchBody
impl Sync for WebSearchBody
impl Unpin for WebSearchBody
impl UnsafeUnpin for WebSearchBody
impl UnwindSafe for WebSearchBody
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