use serde_json::{Value, json};
use crate::tool::Tool;
pub fn to_openai(tools: &[Tool]) -> Vec<Value> {
tools
.iter()
.map(|t| json!({"type": "function", "function": {"name": t.name, "description": t.description, "parameters": t.input_schema}}))
.collect()
}
pub fn to_anthropic(tools: &[Tool]) -> Vec<Value> {
tools.iter().map(|t| json!({"name": t.name, "description": t.description, "input_schema": t.input_schema})).collect()
}
pub fn to_gemini(tools: &[Tool]) -> Vec<Value> {
let decls: Vec<Value> = tools
.iter()
.map(
|t| json!({"name": t.name, "description": t.description, "parameters": t.input_schema}),
)
.collect();
vec![json!({"functionDeclarations": decls})]
}