deepseek_rust_cli/tools/schemas/
mod.rs1use crate::api::types::Tool;
2use serde_json::json;
3
4mod file_io;
5mod git;
6mod github;
7mod system;
8mod web;
9
10pub fn get_tools_schemas() -> Vec<Tool> {
12 get_filtered_tools_schemas(true, true)
13}
14
15pub fn get_filtered_tools_schemas(is_git_repo: bool, has_github_token: bool) -> Vec<Tool> {
21 let mut tools = Vec::with_capacity(40);
22
23 system::add_system_schemas(&mut tools);
25
26 file_io::add_file_io_schemas(&mut tools);
28
29 web::add_web_schemas(&mut tools);
31
32 if is_git_repo {
34 git::add_git_schemas(&mut tools);
35 }
36
37 if has_github_token {
39 github::add_github_schemas(&mut tools);
40 }
41
42 tools
43}
44
45fn create_tool(name: &str, desc: &str, props: serde_json::Value, required: Vec<&str>) -> Tool {
46 Tool {
47 r#type: "function".to_string(),
48 function: crate::api::types::FunctionDefinition {
49 name: name.to_string(),
50 description: desc.to_string(),
51 parameters: json!({
52 "type": "object",
53 "properties": props,
54 "required": required
55 }),
56 },
57 }
58}