-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CompletionModel class - narrower scope #5
Add CompletionModel class - narrower scope #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, first of all thanks for raising a PR. Appreciate it a lot! I think the narrow scope is cleaner. As a design, I am thinking CompletionModel
can be renamed to OpenAIModel
and then all models can be put there and used by the different builders in future PRs. This way there would be no need to maintain several classes and would keep the library easier to maintain and to reason about. What do you think?
src/main/java/io/github/stefanbratanov/jvm/openai/CompletionModel.java
Outdated
Show resolved
Hide resolved
3788acc
to
86c8d63
Compare
My intention was to only allow suitable models per endpoint (e.g. to not be able to use dall-e model for completion). But this approach has the maintenance overhead drawback you mentioned. I'll apply your suggestions (hopefully today) and propagate |
12ea892
to
50fe106
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. LGTM, only need to run spotlessApply
to fix some formatting issues and have a green build. :)
50fe106
to
e42660e
Compare
e42660e
to
6d1de94
Compare
Thanks for the fix. The failing tests are because pull request builds don't get access to secrets. Will merge this one and figure out how to do this for any future PRs. |
Fixed it in fe32392. Future PRs should be able to have green builds and don't run the integration tests. Thanks again for this change. Will include it in the next release. Just need to finish off the Assistants streaming functionality first. |
First of all, thanks for your effort of creating this project @StefanBratanov . It makes OpenAI usage much more convenient.
Now, to the point, the purpose of this change is to replace completion model parameter (currently
String
) with a value object with predefined values available.I created 2 versions of this change (the other one is #4). This one is a bit narrower:
CompletionModel
is an enumString
is still a valid model parameterPlease suggest, which version you prefer (if any).
In case of positive feedback, I can spread this change to other APIs' models.