How to upload files using the batch method
I first used the batch API, but found that I couldn't seem to upload files. So I'm wondering if there are any examples for me to refer to.
Hey @dcsunny sorry we don't have a full example yet. You have to upload a file using .Files.New() - (example) and then pass the ID to the .Batches.New() - (example). Does that help?
.File.New() does not support file uploads. You can only upload the file after obtaining its content. However, if you obtain the file content and then upload it, there will be no file name.
I'll try to get an example up, sorry you had difficulty here.
I suspect the solution involves using the openai.File(rdr io.Reader, filename, contentType string) helper utility