Skip to content

Commit 979f8d6

Browse files
authored
update component names and add examples
1 parent ae21114 commit 979f8d6

1 file changed

Lines changed: 67 additions & 21 deletions

File tree

openapi.yaml

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,19 +1181,19 @@ paths:
11811181
schema:
11821182
type: array
11831183
items:
1184-
$ref: '#/components/schemas/Job'
1184+
$ref: '#/components/schemas/BatchJob'
11851185
'401':
11861186
description: Unauthorized
11871187
content:
11881188
application/json:
11891189
schema:
1190-
$ref: '#/components/schemas/ErrorResponse'
1190+
$ref: '#/components/schemas/BatchErrorResponse'
11911191
'500':
11921192
description: Internal Server Error
11931193
content:
11941194
application/json:
11951195
schema:
1196-
$ref: '#/components/schemas/ErrorResponse'
1196+
$ref: '#/components/schemas/BatchErrorResponse'
11971197
post:
11981198
tags: ['batches']
11991199
summary: Create a batch job
@@ -1212,31 +1212,31 @@ paths:
12121212
content:
12131213
application/json:
12141214
schema:
1215-
$ref: '#/components/schemas/JobWithWarning'
1215+
$ref: '#/components/schemas/BatchJobWithWarning'
12161216
'400':
12171217
description: Bad Request
12181218
content:
12191219
application/json:
12201220
schema:
1221-
$ref: '#/components/schemas/ErrorResponse'
1221+
$ref: '#/components/schemas/BatchErrorResponse'
12221222
'401':
12231223
description: Unauthorized
12241224
content:
12251225
application/json:
12261226
schema:
1227-
$ref: '#/components/schemas/ErrorResponse'
1227+
$ref: '#/components/schemas/BatchErrorResponse'
12281228
'429':
12291229
description: Too Many Requests
12301230
content:
12311231
application/json:
12321232
schema:
1233-
$ref: '#/components/schemas/ErrorResponse'
1233+
$ref: '#/components/schemas/BatchErrorResponse'
12341234
'500':
12351235
description: Internal Server Error
12361236
content:
12371237
application/json:
12381238
schema:
1239-
$ref: '#/components/schemas/ErrorResponse'
1239+
$ref: '#/components/schemas/BatchErrorResponse'
12401240

12411241
/batches/{id}:
12421242
get:
@@ -1252,43 +1252,44 @@ paths:
12521252
description: Job ID
12531253
schema:
12541254
type: string
1255+
example: "batch_job_abc123def456"
12551256
responses:
12561257
'200':
12571258
description: OK
12581259
content:
12591260
application/json:
12601261
schema:
1261-
$ref: '#/components/schemas/Job'
1262+
$ref: '#/components/schemas/BatchJob'
12621263
'400':
12631264
description: Bad Request
12641265
content:
12651266
application/json:
12661267
schema:
1267-
$ref: '#/components/schemas/ErrorResponse'
1268+
$ref: '#/components/schemas/BatchErrorResponse'
12681269
'401':
12691270
description: Unauthorized
12701271
content:
12711272
application/json:
12721273
schema:
1273-
$ref: '#/components/schemas/ErrorResponse'
1274+
$ref: '#/components/schemas/BatchErrorResponse'
12741275
'403':
12751276
description: Forbidden
12761277
content:
12771278
application/json:
12781279
schema:
1279-
$ref: '#/components/schemas/ErrorResponse'
1280+
$ref: '#/components/schemas/BatchErrorResponse'
12801281
'404':
12811282
description: Not Found
12821283
content:
12831284
application/json:
12841285
schema:
1285-
$ref: '#/components/schemas/ErrorResponse'
1286+
$ref: '#/components/schemas/BatchErrorResponse'
12861287
'500':
12871288
description: Internal Server Error
12881289
content:
12891290
application/json:
12901291
schema:
1291-
$ref: '#/components/schemas/ErrorResponse'
1292+
$ref: '#/components/schemas/BatchErrorResponse'
12921293

12931294
components:
12941295
securitySchemes:
@@ -3917,72 +3918,115 @@ components:
39173918
properties:
39183919
endpoint:
39193920
type: string
3921+
description: The endpoint to use for batch processing
3922+
example: "/v1/chat/completions"
39203923
input_file_id:
39213924
type: string
3925+
description: ID of the uploaded input file containing batch requests
3926+
example: "file-abc123def456ghi789"
39223927
completion_window:
39233928
type: string
3924-
ErrorResponse:
3929+
description: Time window for batch completion (optional)
3930+
example: "24h"
3931+
priority:
3932+
type: integer
3933+
description: Priority for batch processing (optional)
3934+
example: 1
3935+
model_id:
3936+
type: string
3937+
description: "Model to use for processing batch requests"
3938+
example: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
3939+
BatchErrorResponse:
39253940
type: object
39263941
properties:
39273942
error:
39283943
type: string
3929-
JobWithWarning:
3944+
BatchJobWithWarning:
39303945
type: object
39313946
properties:
39323947
job:
3933-
$ref: '#/components/schemas/Job'
3948+
$ref: '#/components/schemas/BatchJob'
39343949
warning:
39353950
type: string
3936-
Job:
3951+
BatchJob:
39373952
type: object
39383953
properties:
39393954
id:
39403955
type: string
3956+
example: "batch_job_abc123def456"
39413957
user_id:
39423958
type: string
3959+
example: "user_789xyz012"
39433960
endpoint:
39443961
type: string
3962+
example: "/v1/chat/completions"
39453963
input_file_id:
39463964
type: string
3965+
example: "file-input123abc456def"
39473966
output_file_id:
39483967
type: string
3968+
example: "file-output789xyz012ghi"
39493969
error_file_id:
39503970
type: string
3971+
example: "file-errors456def789jkl"
39513972
status:
3952-
$ref: '#/components/schemas/JobStatus'
3973+
$ref: '#/components/schemas/BatchJobStatus'
39533974
created_at:
39543975
type: string
3976+
example: "2024-01-15T14:30:00Z"
39553977
updated_at:
39563978
type: string
3979+
example: "2024-01-15T14:35:22Z"
39573980
completed_at:
39583981
type: string
3982+
example: "2024-01-15T15:45:30Z"
39593983
heartbeat_at:
39603984
type: string
3985+
example: "2024-01-15T14:35:00Z"
39613986
job_deadline:
39623987
type: string
3988+
example: "2024-01-15T14:35:00Z"
39633989
tokens_reserved_at:
39643990
type: string
3991+
example: "2024-01-15T14:35:00Z"
39653992
tokens_released_at:
39663993
type: string
3994+
example: "2024-01-15T14:35:00Z"
39673995
priority:
39683996
type: integer
3997+
example: 1
3998+
description: "Job priority (1 = highest, 5 = lowest)"
39693999
file_size_bytes:
39704000
type: integer
4001+
example: 1048576
4002+
description: "Size of input file in bytes"
39714003
total_chunks:
39724004
type: integer
4005+
example: 250
4006+
description: "Total number of requests in the batch"
39734007
total_tokens:
39744008
type: integer
4009+
example: 125000
4010+
description: "Estimated total tokens for all requests"
39754011
request_count:
39764012
type: integer
4013+
example: 1000
4014+
description: "Total number of requests in the batch"
39774015
retry_count:
39784016
type: integer
4017+
example: 0
4018+
description: "Number of retries attempted"
39794019
model_id:
39804020
type: string
4021+
example: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
4022+
description: "Model used for processing requests"
39814023
progress:
39824024
type: number
4025+
example: 0.75
4026+
description: "Completion progress as a decimal (0.0 to 1.0)"
39834027
error:
39844028
type: string
3985-
JobStatus:
4029+
BatchJobStatus:
39864030
type: string
39874031
enum:
39884032
- VALIDATING
@@ -3994,4 +4038,6 @@ components:
39944038
- COMPLETED
39954039
- FAILED
39964040
- EXPIRED
3997-
- CANCELLED
4041+
- CANCELLED
4042+
example: "QUEUED"
4043+
description: "Current status of the batch job"

0 commit comments

Comments
 (0)