StefanBratanov / jvm-openai

A minimalistic OpenAI API client for the JVM, written in Java 🤖
Apache License 2.0
35 stars 8 forks source link

Class namings #8

Open fmatak opened 1 month ago

fmatak commented 1 month ago

io.github.stefanbratanov.jvm.openai.Thread class, sharing the same name java.lang.Thread, which is imported by default, causes some issues when using the library. Each time prefixing it with the full package name become a bit tedious. Maybe changing the class names that could potentially cause conflicts could help?

This is also applicable for some other classes like File, Constants etc. But since these classes are not included automatically, it is not that big problem.

thank you

fmatak commented 1 month ago

Also, CreateThreadRequest.Message and ChatCompletion.Choice.Message classes are confusing for the people who are not very familiar with the api. Even if the name changing is not possible, code samples could be updated to specify which one is used. Otherwise, because the imports are not provided, default Eclipse automatic imports cause many compilation errors.

StefanBratanov commented 1 month ago

Hi, thanks a lot for raising this. I was thinking about simplifying the nested classes. Would also update the README when done.

StefanBratanov commented 1 month ago

For the moment updated the README in https://github.com/StefanBratanov/jvm-openai/commit/694eb6d3ea26f656f19495607ffc976171faabc6 . Will keep this issue open if I come up with namings, reorganization to make usage of classes easier.