|
1 | 1 | # generated by fastapi-codegen: |
2 | 2 | # filename: ../../openapi.yml |
3 | | -# timestamp: 2023-08-07T12:14:43+00:00 |
| 3 | +# timestamp: 2023-08-11T14:24:22+00:00 |
4 | 4 |
|
5 | 5 | from __future__ import annotations |
6 | 6 |
|
|
12 | 12 |
|
13 | 13 | class TaskInput(BaseModel): |
14 | 14 | __root__: Any = Field( |
15 | | - ..., description="Input parameters for the task. Any value is allowed." |
| 15 | + ..., |
| 16 | + description="Input parameters for the task. Any value is allowed.", |
| 17 | + example='{\n"debug": false,\n"mode": "benchmarks"\n}', |
16 | 18 | ) |
17 | 19 |
|
18 | 20 |
|
19 | 21 | class Artifact(BaseModel): |
20 | | - artifact_id: str = Field(..., description="ID of the artifact.") |
21 | | - file_name: str = Field(..., description="Filename of the artifact.") |
| 22 | + artifact_id: str = Field( |
| 23 | + ..., |
| 24 | + description="ID of the artifact.", |
| 25 | + example="b225e278-8b4c-4f99-a696-8facf19f0e56", |
| 26 | + ) |
| 27 | + file_name: str = Field( |
| 28 | + ..., description="Filename of the artifact.", example="main.py" |
| 29 | + ) |
22 | 30 | relative_path: Optional[str] = Field( |
23 | | - None, description="Relative path of the artifact in the agent's workspace." |
| 31 | + None, |
| 32 | + description="Relative path of the artifact in the agent's workspace.", |
| 33 | + example="python/code/", |
24 | 34 | ) |
25 | 35 |
|
26 | 36 |
|
27 | 37 | class ArtifactUpload(BaseModel): |
28 | 38 | file: bytes = Field(..., description="File to upload.") |
29 | 39 | relative_path: Optional[str] = Field( |
30 | | - None, description="Relative path of the artifact in the agent's workspace." |
| 40 | + None, |
| 41 | + description="Relative path of the artifact in the agent's workspace.", |
| 42 | + example="python/code", |
31 | 43 | ) |
32 | 44 |
|
33 | 45 |
|
34 | 46 | class StepInput(BaseModel): |
35 | 47 | __root__: Any = Field( |
36 | | - ..., description="Input parameters for the task step. Any value is allowed." |
| 48 | + ..., |
| 49 | + description="Input parameters for the task step. Any value is allowed.", |
| 50 | + example='{\n"file_to_refactor": "models.py"\n}', |
37 | 51 | ) |
38 | 52 |
|
39 | 53 |
|
40 | 54 | class StepOutput(BaseModel): |
41 | 55 | __root__: Any = Field( |
42 | | - ..., description="Output that the task step has produced. Any value is allowed." |
| 56 | + ..., |
| 57 | + description="Output that the task step has produced. Any value is allowed.", |
| 58 | + example='{\n"tokens": 7894,\n"estimated_cost": "0,24$"\n}', |
43 | 59 | ) |
44 | 60 |
|
45 | 61 |
|
46 | 62 | class TaskRequestBody(BaseModel): |
47 | | - input: Optional[str] = Field(None, description="Input prompt for the task.") |
| 63 | + input: Optional[str] = Field( |
| 64 | + None, |
| 65 | + description="Input prompt for the task.", |
| 66 | + example="Write the words you receive to the file 'output.txt'.", |
| 67 | + ) |
48 | 68 | additional_input: Optional[TaskInput] = None |
49 | 69 |
|
50 | 70 |
|
51 | 71 | class Task(TaskRequestBody): |
52 | | - task_id: str = Field(..., description="The ID of the task.") |
| 72 | + task_id: str = Field( |
| 73 | + ..., |
| 74 | + description="The ID of the task.", |
| 75 | + example="50da533e-3904-4401-8a07-c49adf88b5eb", |
| 76 | + ) |
53 | 77 | artifacts: List[Artifact] = Field( |
54 | | - [], description="A list of artifacts that the task has produced." |
| 78 | + [], |
| 79 | + description="A list of artifacts that the task has produced.", |
| 80 | + example=[ |
| 81 | + "7a49f31c-f9c6-4346-a22c-e32bc5af4d8e", |
| 82 | + "ab7b4091-2560-4692-a4fe-d831ea3ca7d6", |
| 83 | + ], |
55 | 84 | ) |
56 | 85 |
|
57 | 86 |
|
58 | 87 | class StepRequestBody(BaseModel): |
59 | | - input: Optional[str] = Field(None, description="Input prompt for the step.") |
| 88 | + input: Optional[str] = Field( |
| 89 | + None, description="Input prompt for the step.", example="Washington" |
| 90 | + ) |
60 | 91 | additional_input: Optional[StepInput] = None |
61 | 92 |
|
62 | 93 |
|
63 | 94 | class Status(Enum): |
64 | 95 | created = "created" |
| 96 | + running = "running" |
65 | 97 | completed = "completed" |
66 | 98 |
|
67 | 99 |
|
68 | 100 | class Step(StepRequestBody): |
69 | | - task_id: str = Field(..., description="The ID of the task this step belongs to.") |
70 | | - step_id: str = Field(..., description="The ID of the task step.") |
71 | | - name: Optional[str] = Field(None, description="The name of the task step.") |
| 101 | + task_id: str = Field( |
| 102 | + ..., |
| 103 | + description="The ID of the task this step belongs to.", |
| 104 | + example="50da533e-3904-4401-8a07-c49adf88b5eb", |
| 105 | + ) |
| 106 | + step_id: str = Field( |
| 107 | + ..., |
| 108 | + description="The ID of the task step.", |
| 109 | + example="6bb1801a-fd80-45e8-899a-4dd723cc602e", |
| 110 | + ) |
| 111 | + name: Optional[str] = Field( |
| 112 | + None, description="The name of the task step.", example="Write to file" |
| 113 | + ) |
72 | 114 | status: Status = Field(..., description="The status of the task step.") |
73 | | - output: Optional[str] = Field(None, description="Output of the task step.") |
| 115 | + output: Optional[str] = Field( |
| 116 | + None, |
| 117 | + description="Output of the task step.", |
| 118 | + example="I am going to use the write_to_file command and write Washington to a file called output.txt <write_to_file('output.txt', 'Washington')", |
| 119 | + ) |
74 | 120 | additional_output: Optional[StepOutput] = None |
75 | 121 | artifacts: List[Artifact] = Field( |
76 | 122 | [], description="A list of artifacts that the step has produced." |
|
0 commit comments