Skip to content

Commit 45fccc9

Browse files
authored
Merge pull request #98 from togethercomputer/justindriemeyer/eng-30551-add-filesupload-endpoint-support
feat(api): Add support for files/upload endpoint
2 parents a6bf10b + b0ceef7 commit 45fccc9

File tree

1 file changed

+77
-7
lines changed

1 file changed

+77
-7
lines changed

openapi.yaml

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,60 @@ paths:
636636
application/json:
637637
schema:
638638
$ref: '#/components/schemas/ErrorData'
639+
/files/upload:
640+
post:
641+
tags: ['Files']
642+
summary: Upload a file
643+
description: Upload a file with specified purpose, file name, and file type.
644+
requestBody:
645+
required: true
646+
content:
647+
multipart/form-data:
648+
schema:
649+
type: object
650+
required:
651+
- purpose
652+
- file_name
653+
- file
654+
properties:
655+
purpose:
656+
$ref: '#/components/schemas/FilePurpose'
657+
file_name:
658+
type: string
659+
description: The name of the file being uploaded
660+
example: 'dataset.csv'
661+
file_type:
662+
$ref: '#/components/schemas/FileType'
663+
file:
664+
type: string
665+
format: binary
666+
description: The content of the file being uploaded
667+
responses:
668+
'200':
669+
description: File uploaded successfully
670+
content:
671+
application/json:
672+
schema:
673+
$ref: '#/components/schemas/FileResponse'
674+
'500':
675+
description: Internal Server Error
676+
content:
677+
application/json:
678+
schema:
679+
$ref: '#/components/schemas/ErrorData'
680+
'400':
681+
description: Bad Request
682+
content:
683+
application/json:
684+
schema:
685+
$ref: '#/components/schemas/ErrorData'
686+
'401':
687+
description: Unauthorized
688+
content:
689+
application/json:
690+
schema:
691+
$ref: '#/components/schemas/ErrorData'
692+
639693
/fine-tunes:
640694
post:
641695
tags: ['Fine-tuning']
@@ -2571,16 +2625,11 @@ components:
25712625
type: integer
25722626
example: 2664
25732627
purpose:
2574-
enum:
2575-
- fine-tune
2576-
example: 'fine-tune'
2628+
$ref: '#/components/schemas/FilePurpose'
25772629
Processed:
25782630
type: boolean
25792631
FileType:
2580-
enum:
2581-
- jsonl
2582-
- parquet
2583-
example: 'jsonl'
2632+
$ref: '#/components/schemas/FileType'
25842633
LineCount:
25852634
type: integer
25862635
FileList:
@@ -2603,6 +2652,27 @@ components:
26032652
type: string
26042653
size:
26052654
type: integer
2655+
FilePurpose:
2656+
type: string
2657+
description: The purpose of the file
2658+
example: 'fine-tune'
2659+
enum:
2660+
- fine-tune
2661+
- eval
2662+
- eval-sample
2663+
- eval-output
2664+
- eval-summary
2665+
- batch-generated
2666+
- batch-api
2667+
FileType:
2668+
type: string
2669+
description: The type of the file
2670+
default: 'jsonl'
2671+
example: 'jsonl'
2672+
enum:
2673+
- 'csv'
2674+
- 'jsonl'
2675+
- 'parquet'
26062676
FileDeleteResponse:
26072677
type: object
26082678
properties:

0 commit comments

Comments
 (0)