File size: 451 Bytes
345855e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pydantic import BaseModel, Field
from typing import Callable, Dict, Any


class TaskDefinition(BaseModel):
    name: str
    category: str
    description: str

    handler: Callable

    inputs: Dict[str, str] = Field(default_factory=dict)
    outputs: Dict[str, str] = Field(default_factory=dict)

    ui_schema: Dict[str, Any] = Field(default_factory=dict)

    autonomous: bool = True

    class Config:
        arbitrary_types_allowed = True