-
Notifications
You must be signed in to change notification settings - Fork 30
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
Builders are unnecessarily complex in some cases #53
Comments
Since ChatCompletionUserMessageParam used, why role is not set automatically, it's very annoying.
` |
Yes, I agree! We are actually planning to update the SDK to automatically set this value for you.
In Java, builders are the common approach to make construction of complex deeply nested objects readable and flexible. Otherwise you'd have to pass the parameters to a constructor in the right order, which is easy to get wrong. Curious if you encountered any difficulties other than the |
still good approach |
Are you referring to the builders or something else? |
ya i am talking regarding builder |
Well, using builders make sense in SOME situations where you have 6-7 or more constructor arguments
I am capable to pass 3-4-5 parameters to constructor in right order, this is not a problem (and having Javadoc helps) In my code I have to do this (unfortunately):
This code above seriously over-engineered (because it use over-engineered API):
The question is WHY?
|
I hear you, but there are other benefits:
I agree this code is not ideal! As I mentioned above, we're working on improving this part. Here are some of the upcoming improvements that we're planning to make before the beta release (SDK is currently alpha):
To answer "why" it's currently like this: we are generating this code from the OpenAI OpenAPI spec using our Stainless code generator and we're still iterating! I can assure you we'll work out all the issues before the GA release of the SDK. |
Are those all kinds of builder necessary?
The text was updated successfully, but these errors were encountered: