choonkeat / elm-openai / OpenAI.File

Files are used to upload documents that can be used with features like Fine-tuning.

See https://beta.openai.com/docs/api-reference/files

uploadFile : UploadInput -> Ext.Http.TaskInput (Ext.Http.Error String) OpenAI.Common.File

https://beta.openai.com/docs/api-reference/files/upload

getFile : { file_id : String } -> Ext.Http.TaskInput (Ext.Http.Error String) OpenAI.Common.File

https://beta.openai.com/docs/api-reference/files/retrieve

getFileContent : { file_id : String } -> Ext.Http.TaskInput (Ext.Http.Error Bytes) OpenAI.Common.BinaryBlob

https://beta.openai.com/docs/api-reference/files/retrieve-content

getFiles : Ext.Http.TaskInput (Ext.Http.Error String) (List OpenAI.Common.File)

https://beta.openai.com/docs/api-reference/files/list

deleteFile : { file_id : String } -> Ext.Http.TaskInput (Ext.Http.Error String) OpenAI.Common.DeleteOutput

https://beta.openai.com/docs/api-reference/files/delete


type UploadInput
    = FilePurposeFineTune (List PromptCompletion)
    | FilePurposeGeneral String File

FilePurposeGeneral


type alias PromptCompletion =
{ prompt : String
, completion : String 
}