You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Params object which stores some desired "default" configuration settings; I want to use it as "template" when creating new API requests, which I can then configure for specific calls. This in principle work except for some parameters, e.g.:
CompletionCreateParams template = CompletionCreateParams.builder().prompt("").maxTokens(500).echo(false).n(1).build()
// Now I want to create a copy of template, to use in a specific setting, changing only some of its parameters.
// This works
CompletionCreateParams copy = template.toBuilder().maxTokens(250).build();
// But this doesn't so I cannot say "use default value for max tokens"
copy = template.toBuilder().maxTokens(null).build();
I think for optional parameters builder should always take nullable values (Integer in this case), otherwise is impossible to "unset" a parameter once it has been set. This will be consistent with same parameters returning Optional<> when they are read.
Is there a workaround already I do not see?
The text was updated successfully, but these errors were encountered:
I have created a
Params
object which stores some desired "default" configuration settings; I want to use it as "template" when creating new API requests, which I can then configure for specific calls. This in principle work except for some parameters, e.g.:I think for optional parameters builder should always take nullable values (
Integer
in this case), otherwise is impossible to "unset" a parameter once it has been set. This will be consistent with same parameters returning Optional<> when they are read.Is there a workaround already I do not see?
The text was updated successfully, but these errors were encountered: