use serde_json::{json, Value};
#[must_use]
pub fn web_search(search_context_size: Option<String>) -> Value {
let mut tool = json!({ "type": "web_search" });
if let Some(s) = search_context_size {
tool["search_context_size"] = json!(s);
}
tool
}
#[must_use]
pub fn code_execution() -> Value {
json!({ "type": "code_execution" })
}
#[must_use]
pub fn file_search(vector_store_ids: Vec<String>) -> Value {
json!({
"type": "file_search",
"vector_store_ids": vector_store_ids,
})
}
#[must_use]
pub fn mcp_server(server_label: String, server_url: Option<String>) -> Value {
let mut tool = json!({
"type": "mcp",
"server_label": server_label,
});
if let Some(u) = server_url {
tool["server_url"] = json!(u);
}
tool
}
#[must_use]
pub fn view_image() -> Value {
json!({ "type": "view_image" })
}
#[must_use]
pub fn view_x_video() -> Value {
json!({ "type": "view_x_video" })
}
#[must_use]
pub fn x_search() -> Value {
json!({ "type": "x_search" })
}