stuff
This commit is contained in:
parent
f0b53b67ce
commit
bab956387c
4 changed files with 163 additions and 46 deletions
|
|
@ -96,6 +96,17 @@ pub fn get_tools() -> Vec<Tool> {
|
|||
}),
|
||||
},
|
||||
},
|
||||
Tool {
|
||||
tool_type: "function".to_string(),
|
||||
function: FunctionDefinition {
|
||||
name: "get_current_time".to_string(),
|
||||
description: "Get the current date and time in ISO 8601 format".to_string(),
|
||||
parameters: serde_json::json!({
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
}),
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +209,8 @@ pub async fn handle_tool_call(
|
|||
));
|
||||
}
|
||||
(out, false)
|
||||
} else if name == "get_current_time" {
|
||||
(chrono::Utc::now().to_rfc3339(), false)
|
||||
} else {
|
||||
(format!("Error: Unknown tool {}", name), false)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue