use super::llm_builder::LLMBuilder;
impl LLMBuilder {
pub fn openai_enable_web_search(mut self, enable: bool) -> Self {
self.state.openai_enable_web_search = Some(enable);
self
}
pub fn openai_web_search_context_size(mut self, context_size: impl Into<String>) -> Self {
self.state.openai_web_search_context_size = Some(context_size.into());
self
}
pub fn openai_web_search_user_location_type(
mut self,
location_type: impl Into<String>,
) -> Self {
self.state.openai_web_search_user_location_type = Some(location_type.into());
self
}
pub fn openai_web_search_user_location_approximate_country(
mut self,
country: impl Into<String>,
) -> Self {
self.state
.openai_web_search_user_location_approximate_country = Some(country.into());
self
}
pub fn openai_web_search_user_location_approximate_city(
mut self,
city: impl Into<String>,
) -> Self {
self.state.openai_web_search_user_location_approximate_city = Some(city.into());
self
}
pub fn openai_web_search_user_location_approximate_region(
mut self,
region: impl Into<String>,
) -> Self {
self.state
.openai_web_search_user_location_approximate_region = Some(region.into());
self
}
#[deprecated(note = "Renamed to `xai_search_mode`.")]
pub fn search_mode(self, mode: impl Into<String>) -> Self {
self.xai_search_mode(mode)
}
pub fn xai_search_mode(mut self, mode: impl Into<String>) -> Self {
self.state.xai_search_mode = Some(mode.into());
self
}
pub fn xai_search_source(
mut self,
source_type: impl Into<String>,
excluded_websites: Option<Vec<String>>,
) -> Self {
self.state.xai_search_source_type = Some(source_type.into());
self.state.xai_search_excluded_websites = excluded_websites;
self
}
pub fn xai_max_search_results(mut self, max: u32) -> Self {
self.state.xai_search_max_results = Some(max);
self
}
pub fn xai_search_date_range(mut self, from: impl Into<String>, to: impl Into<String>) -> Self {
self.state.xai_search_from_date = Some(from.into());
self.state.xai_search_to_date = Some(to.into());
self
}
pub fn xai_search_from_date(mut self, date: impl Into<String>) -> Self {
self.state.xai_search_from_date = Some(date.into());
self
}
pub fn xai_search_to_date(mut self, date: impl Into<String>) -> Self {
self.state.xai_search_to_date = Some(date.into());
self
}
}