pub struct WebSearchTool {
pub search_engine: Option<SearchEngine>,
pub enable: Option<bool>,
pub search_query: Option<String>,
pub count: Option<u32>,
pub search_domain_filter: Option<String>,
pub search_recency_filter: Option<SearchRecencyFilter>,
pub content_size: Option<ContentSize>,
pub result_sequence: Option<ResultSequence>,
pub search_result: Option<bool>,
pub require_search: Option<bool>,
pub search_prompt: Option<String>,
}Expand description
GLM’s web_search tool: lets the model call Zhipu’s web search.
A zai-gated variant of
RequestTool; the wire shape
is {"type": "web_search", "web_search": { ... }}. Every field except
search_engine is optional and omitted when unset, so GLM applies its own
default.
Fields§
§search_engine: Option<SearchEngine>The search backend. Required by GLM; currently only
SearchEngine::SearchProJina is accepted.
enable: Option<bool>Whether the tool is enabled. GLM’s default is false.
search_query: Option<String>An explicit query to search for, instead of letting the model phrase it.
count: Option<u32>Number of results to return, 1..=50. GLM’s default is 10.
search_domain_filter: Option<String>Restrict results to this domain.
search_recency_filter: Option<SearchRecencyFilter>Only return results published within this window. GLM’s default is
SearchRecencyFilter::NoLimit.
content_size: Option<ContentSize>How much of each page to keep. GLM’s default is
ContentSize::Medium.
result_sequence: Option<ResultSequence>Whether search results are placed before or after the model’s answer.
GLM’s default is ResultSequence::After.
search_result: Option<bool>Return the raw search results alongside the answer. GLM’s default is
false.
require_search: Option<bool>Force a search even when the model thinks none is needed. GLM’s default
is false.
search_prompt: Option<String>Extra instructions steering what the model searches for.