diff --git a/src/prediction/toolbox.rs b/src/prediction/toolbox.rs index a5151dc..71f4b82 100644 --- a/src/prediction/toolbox.rs +++ b/src/prediction/toolbox.rs @@ -63,12 +63,15 @@ pub struct ArchiveToolbox { #[derive(Debug, Deserialize, Serialize, JsonSchema)] enum TaskListOperation { + /// Marks the given task as complete Complete(String), + /// Adds a new item to the task list Add(String) } +/// # A sequence of operations to apply to the task list #[derive(Debug, Deserialize, Serialize, JsonSchema, Default)] -struct TaskListArgs { +struct TaskListOperations { operations: Vec } @@ -111,7 +114,7 @@ impl Toolbox for ArchiveToolbox { impl ArchiveToolbox { async fn tasklist_operation(&mut self, json_args: &str) -> Result { - let args: TaskListArgs = serde_json::from_str(json_args)?; + let args: TaskListOperations = serde_json::from_str(json_args)?; let mut locked = self.todo_list.lock().await;