()
| 2184 | } |
| 2185 | |
| 2186 | fn anthropic_tool_definitions() -> Vec<Value> { |
| 2187 | openai_tool_definitions() |
| 2188 | .into_iter() |
| 2189 | .filter_map(|tool| { |
| 2190 | let function = tool.get("function")?; |
| 2191 | let name = function.get("name")?.as_str()?; |
| 2192 | let description = function.get("description")?.as_str()?; |
| 2193 | let input_schema = function.get("parameters")?; |
| 2194 | |
| 2195 | Some(json!({ |
| 2196 | "name": name, |
| 2197 | "description": description, |
| 2198 | "input_schema": input_schema, |
| 2199 | })) |
| 2200 | }) |
| 2201 | .collect() |
| 2202 | } |
| 2203 | |
| 2204 | fn map_tool_name(name: &str) -> Option<ToolName> { |
| 2205 | match name { |
no test coverage detected