use serde_json::{json, Value};
#[must_use]
pub fn google_search() -> Value {
json!({ "google_search": {} })
}
#[must_use]
pub fn enterprise_web_search() -> Value {
json!({ "enterprise_web_search": {} })
}
#[must_use]
pub fn google_maps() -> Value {
json!({ "google_maps": {} })
}
#[must_use]
pub fn url_context() -> Value {
json!({ "url_context": {} })
}
#[must_use]
pub fn file_search(
store_names: Vec<String>,
metadata_filter: Option<String>,
top_k: Option<u32>,
) -> Value {
let mut tool = json!({
"file_search": {
"store_names": store_names,
}
});
if let Some(mf) = metadata_filter {
tool["file_search"]["metadata_filter"] = json!(mf);
}
if let Some(k) = top_k {
tool["file_search"]["top_k"] = json!(k);
}
tool
}
#[must_use]
pub fn code_execution() -> Value {
json!({ "code_execution": {} })
}
#[must_use]
pub fn vertex_rag_store(rag_corpora: Vec<String>) -> Value {
json!({
"vertex_rag_store": {
"rag_corpora": rag_corpora,
}
})
}