First of all, thank you for reviewing and merging my previous PRs so quickly! š
It's a pleasure to help you with this package. Learned already a lot about (Open)AI and even more from your way how to build a clean package.
I am a huge fan of using fully typed responses and requests. Therefore I gave it a try with the moderations endpoint to see how it could work.
Hi @nunomaduro
First of all, thank you for reviewing and merging my previous PRs so quickly! š It's a pleasure to help you with this package. Learned already a lot about (Open)AI and even more from your way how to build a clean package.
I am a huge fan of using fully typed responses and requests. Therefore I gave it a try with the moderations endpoint to see how it could work.
What I ended up with is the following:
In my opinion this gives the developers the better UX than plain arrays.
More or less I took the approach Steve McDougall described here: https://laravel-news.com/working-with-data-in-api-integrations
I also implemented request factories to give the user various options how to create the request instance:
If you want to have a look, I pushed the POC here: https://github.com/gehrisandro/openai-php-client/tree/poc-strong-typed-requests-and-responses