Convenience factory — fills ``start_time`` from ``time.time()``.
(
*,
id: str,
type: TaskType,
description: str,
output_file: str,
tool_use_id: str | None = None,
status: TaskStatus = "pending",
)
| 138 | |
| 139 | |
| 140 | def create_task_state_base( |
| 141 | *, |
| 142 | id: str, |
| 143 | type: TaskType, |
| 144 | description: str, |
| 145 | output_file: str, |
| 146 | tool_use_id: str | None = None, |
| 147 | status: TaskStatus = "pending", |
| 148 | ) -> TaskStateBase: |
| 149 | """Convenience factory — fills ``start_time`` from ``time.time()``.""" |
| 150 | return TaskStateBase( |
| 151 | id=id, |
| 152 | type=type, |
| 153 | status=status, |
| 154 | description=description, |
| 155 | start_time=time.time(), |
| 156 | output_file=output_file, |
| 157 | tool_use_id=tool_use_id, |
| 158 | ) |
| 159 | |
| 160 | |
| 161 | __all__ = [ |