alexrudall / ruby-openai

OpenAI API + Ruby! 🤖❤️ NEW: Assistant Vector Stores
MIT License
2.61k stars 302 forks source link

Add support for File and StringIO `file` parameter in `upload`. #420

Closed simonx1 closed 2 months ago

simonx1 commented 5 months ago

File upload method accepts only path to the local file as a parameter. This is problematic for files from ActiveStorage, where file usually reside in the cloud. This PR addresses this issue and adds also possibility to pass an instance of a Fila or StringIO to the upload method.

More validation. This PR also adds validation for purpose parameter.

All Submissions: