Jvm-openai - A minimalistic Java client for the OpenAI API

Hi, for any JVM developers, last few weeks I worked on a Java client for the OpenAI API focusing on simplicity and minimal dependencies (only Jackson )

I have tried to cover all functionalities and request/response types/parameters and as of last version 0.4.0, it also supports the Beta APIs.

Would be cool to get feedback. Be free to open an issue or even a PR if you feel like it.

Good day. :slightly_smiling_face:

2 Likes

Nice! :laughing:

Unfortunately, the API changes quite frequently - and it’s difficult to trust third party libraries to stay maintained.

Do you have any strategies to deal with this?

A working, self-maintaining library would be so cool

Thanks for the comment.

I will try to keep track of any changes in https://platform.openai.com/docs/changelog . I hope it gets maintained.

I would like also to get a hold of a testing environment (if any??) and run a bigger suite of automated integration tests to capture any changes.

Also if library gets traction, I hope to get PRs from external contributors.

Just FYI, I think you’re in pretty questionable territory there with the name of your project. It’s catchy and cute, but probably too similar to “ChatGPT.”

Haven’t thought about it, but given it’s open-source project and actually based on the OpenAI API not a competing product, don’t think it should be a problem in my opinion.

From last version 0.5.0 the project has been renamed to jvm-openai

More information on Release v0.5.0 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.5.2 covering the latest API changes at GitHub - openai/openai-openapi: OpenAPI specification for the OpenAI API

Also worked on a test which verifies the Java objects against the openapi yaml spec file. Makes it much easier to capture breaking changes.

2 Likes

For anyone interested in contributing to the project added CONTRIBUTING.md to the repo: jvm-openai/CONTRIBUTING.md at master · StefanBratanov/jvm-openai · GitHub

Released new version 0.6.0 covering the latest API changes at GitHub - openai/openai-openapi: OpenAPI specification for the OpenAI API

Released new version 0.6.1 (removing instance_id parameter and adding ability to configure a request timeout) Release v0.6.1 · StefanBratanov/jvm-openai · GitHub