Skip to content

Task

Task

Bases: BaseModel

The Task Model This is the one we will pull and ask for the task from the API

Source code in Agent/models/task.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class Task(BaseModel):
    """
    The Task Model
    This is the one we will pull and ask for the task from the API
    """

    id: int = Field(description="The ID of the task")
    name: str = Field(description="A unique name to track the cluster of tasks")
    user_id: Optional[int] = Field(
        None, description="The ID of the user who created the task"
    )
    task_name: TaskName = Field(description="The name of the task")
    parameters: dict = Field(
        default_factory=dict, description="The parameters for the task"
    )
    result_status: ResultStatus = Field(
        ResultStatus.pending, description="The status of the task"
    )
    result_json: TaskResultJSON = Field(
        default_factory=lambda: TaskResultJSON(result_profile={}, latency_profile={}),
        description="The result of the task",
    )
    description: Optional[str] = Field(
        None, description="The description of the task result"
    )