Skip to main content


Hi all,

Nelson Ferraz has been working with generative AI for a while. I've started collaborating with him on his OpenAI modules. He wrote a module named OpenAI::API, but it required manually writing the code for all of the behavior. With the size of the OpenAI API, the rapid evolution, of said API, the birth of new models and the deprecation of old models, this approach turned out to be unmaintainable.

Thus, that module was deprecated in favor of Nelson's OpenAPI::Client::OpenAI module. Throw the 13K+ lines OpenAPI spec for OpenAI at it and it just works. Further, the module is pretty much a single Perl class rather than a bunch of hand-crafted code.

CPAN authors know it can be hard to keep modules up-to-date (mea culpa, mea culpa!) and this module is no exception. I need this module so I offered to collaborate and created a PR to update it to version 2.0.0 of the OpenAI spec. It now passes all the tests (for those wondering, you need an OpenAI key and it costs $0.04 USD to run the test suite).

In trying to build a Whisper pipeline for that, I found that I couldn't. There was a PR for Whisper support for the older module, but for the newer one, I can't figure out how to get it to issue a request with multipart/form-data support. I've noted the issue in the PR.

If anyone would like to see OpenAI support for Perl, we would dearly love to collaborate with you to make this happen.

submitted by /u/OvidPerl
[link] [comments]