Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added file upload endpoint #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,78 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/FileObject'
/files/upload:
post:
summary: Upload a file for fine-tuning
description: Endpoint to upload a file for fine-tuning purposes.
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: The file to upload.
file_name:
type: string
description: The name of the file.
purpose:
type: string
enum: ['fine-tune']
default: 'fine-tune'
description: The purpose of the file upload. Must be "fine-tune".
required:
- file
responses:
'200':
description: File uploaded successfully.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: File uploaded successfully.
file_id:
type: string
description: The unique ID of the uploaded file.
'400':
description: Bad request. Invalid purpose or file not found.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Unable to save the file - invalid purpose specified.
error:
type: string
example: File not found.
'401':
description: Unauthorized. User is not authorized to perform this activity.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: User is not authorized to perform this activity.
'500':
description: Internal Server Error
description: Internal server error. Unable to save the file due to an internal error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
type: object
properties:
message:
type: string
example: Unable to save the file - internal error.
/fine-tunes:
post:
tags: ['Fine-tuning']
Expand Down