-
-
Notifications
You must be signed in to change notification settings - Fork 370
Adds OpeAI::AssistantFiles #356
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
Conversation
That was fast :D |
Missing threads and messages for the complete assistant flow. |
Looks like there is this too which is aiming for the same goal: |
Yeah sorry, I didn't see this PR until I'd already written most of mine. I've not added any of the file handling stuff though so it'd be good to add these changes in as you're further ahead there. Are you okay with that @codenamev? |
Woah, #361 is way better than this 😆 Haha, yeah for sure, I'll update to focus on assistant file updates. |
3dbeaa1
to
9532932
Compare
9532932
to
e6b0036
Compare
@alexrudall I don't really know how to fix the VCR issues 🆘 |
@client.multipart_post( | ||
path: "/files", | ||
parameters: parameters.merge( | ||
file: File.open(parameters[:file]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should require file
be an IO object instead of an actual file - thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree, can you say more about this though @allcentury ? What's the reasoning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an example, I am generating a "File" from a database query. With this current approach, I have to actually write to a file, then pass it here only to be read again. That said, in ruby File#open and other File
commands returns an IO
object which is what Net::HTTP
and other adapters want when sending over HTTP.
@client.upload(file: File.read("my_file"))
# OR
io = IO.new
output = SomeDatabaseQuery.extract
io.puts output
io.rewind
@client.upload(file: io)
In this case, it works for all use cases and users don't need to write temporary files to disk if they won't want to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allcentury thanks for the suggestion - this has now been added in #420 💨
e6b0036
to
a3d3fec
Compare
Thanks for your work on this @codenamev - closing as OpenAI have deprecated AssistantFiles for v2 of the beta |
This adds support for the new OpenAI Assistant Files API.
It is dependent on #361. I have rebased off of that.