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