nodestep.middleware.todolist ¶
TodoListMiddleware, which gives the model a to-do list per thread.
See Built-in middleware.
| Name | What it is |
|---|---|
| Middleware | |
TodoListMiddleware | Give the model a todo list per thread, kept in this instance's memory. |
| Items | |
TodoItem | A todo item with its task and state. |
TodoItemState | Progress state of a todo item. |
TodoListSnapshot | The current todo list. |
| Errors | |
TodoListMiddlewareError | Raised when the todo tools run without a thread id. |
Middleware¶
TodoListMiddleware¶
Give the model a todo list per thread, kept in this instance's memory.
Subclass of Middleware.
The list is not part of the graph state: a state store, history,
fork and other processes do not see it. Without a state store, a run
without thread_id= gets a generated thread and so an empty list.
Methods
items_for(thread_id)¶
Return the todo list of a thread.
items_for(thread_id)¶Items¶
TodoItem¶
TodoItem(*, task, state=TodoItemState.PENDING)
A todo item with its task and state.
task | str | |
state | TodoItemState | |
TodoItemState¶
Progress state of a todo item.
PENDING |
| |
IN_PROGRESS |
| |
COMPLETED |
| |
BLOCKED |
| |
CANCELLED |
| |
FAILED |
|
Errors¶
TodoListMiddlewareError¶
Raised when the todo tools run without a thread id.
Subclass of NodestepError.