Skip to content

Conversation

@bso-AL
Copy link

@bso-AL bso-AL commented Aug 27, 2025

Description

First of all thanks for this Package, TJ. I needed some extra functionality for a personal project, but thought maybe more people could make use of it - if you believe this fits within Prism's scope.

This PR adds the functionality of interacting with OpenAI's file storage. It implements the functionality of uploading a file, listing all files in your storage, deleting a file, retrieving a file's information and retrieving a file's content.

I've tried to mimic the current structure as best as possible, but I was a little stumped with regards to making a ResponseBuilder as I see the other "types" have. I ended up making it into a provider specific concern that formats the Responses.

I've tried to keep the Responses as generic as possible in order to future proof if other people want to implement the File storage interaction with other Providers other than OpenAI.

@bso-AL bso-AL force-pushed the feature/add-file-functionality-to-openai branch 2 times, most recently from 3777857 to 3fa3082 Compare August 28, 2025 12:04
@sixlive
Copy link
Contributor

sixlive commented Sep 2, 2025

Since this is very specific to OpenAI, what if we use use it as Prism::provider('openai')->uploadFile() etc..

@sixlive sixlive force-pushed the feature/add-file-functionality-to-openai branch from 3fa3082 to 4e360a9 Compare September 2, 2025 20:51
@bso-AL
Copy link
Author

bso-AL commented Sep 4, 2025

Since this is very specific to OpenAI, what if we use use it as Prism::provider('openai')->uploadFile() etc..

I think that Anthropic, Mistral and Gemini - possibly xAI as well? - all offer file storage interactions as well, so my thinking was keeping it as generic as possible, in case someone wants to add it to the Mistral provider the functionality is already there and they just have to add the handler/methods to the Mistral Provider.

That being said I have no issue with making this OpenAI specific if that is acceptable for the Prism package? It was how I had initially written it in my personal project, so should be a quick rewrite :)

@khalidmaquilang
Copy link

@bso-AL Thanks for this.. I am going to use this for now until there is a new update

@sixlive
Copy link
Contributor

sixlive commented Oct 14, 2025

Going to give this another set of eyes here shortly

@sixlive
Copy link
Contributor

sixlive commented Oct 20, 2025

I've thought a lot about this and I think I'm going to pass on this for now. I may reconsider in the future but for now I feel likes its out of scope... for now

@sixlive sixlive closed this Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants