lehcode / soakp

Secure OpenAI interactions with confidence - safeguard your OpenAI API keys and boost your app security
MIT License
6 stars 1 forks source link

Implement uploading of files for model fine-tuning to OpenAI API #162

Open sweep-ai[bot] opened 1 year ago

sweep-ai[bot] commented 1 year ago

Description

This PR implements the functionality to upload files for model fine-tuning to the OpenAI API. It adds a new method uploadFineTuneFile to the SoakpProxy class, which uses the OpenAI API's createFile method to upload the file. The purpose is set to 'fine-tune'. Additionally, a new endpoint POST /openai/fine-tunes/upload is added to the OpenaiFinetunesApi class, which handles the HTTP request for file upload and calls the uploadFineTuneFile method in the SoakpProxy class.

To ensure compatibility with the OpenAI API, the uploaded files are converted into JSONL format using Python means. The conversion functionality is added to the OpenaiFilesApi class.

Summary of Changes

Fixes #153.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/upload-files-for-fine-tuning

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.