Add deprecated with* methods to FunctionCallingOptions
Add backwards compatibility methods from FunctionCallingOptionsBuilder to the Builder interface in FunctionCallingOptions. This allows users to gradually migrate from the old builder style (with* methods) to the new style while maintaining the same functionality. Each deprecated method is marked for removal in 1.0.0-M5 and includes proper Javadoc directing users to the new method names. The methods are implemented as default methods that delegate to their new counterparts.
This commit is contained in:
@@ -172,6 +172,86 @@ public interface FunctionCallingOptions extends ChatOptions {
|
||||
@Override
|
||||
Builder topP(Double topP);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #model(String)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withModel(String model) {
|
||||
return model(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #frequencyPenalty(Double)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withFrequencyPenalty(Double frequencyPenalty) {
|
||||
return frequencyPenalty(frequencyPenalty);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #maxTokens(Integer)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withMaxTokens(Integer maxTokens) {
|
||||
return maxTokens(maxTokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #presencePenalty(Double)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withPresencePenalty(Double presencePenalty) {
|
||||
return presencePenalty(presencePenalty);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #stopSequences(List)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withStopSequences(List<String> stopSequences) {
|
||||
return stopSequences(stopSequences);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #temperature(Double)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withTemperature(Double temperature) {
|
||||
return temperature(temperature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #functionCallbacks(List)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withFunctionCallbacks(List<FunctionCallback> functionCallbacks) {
|
||||
return functionCallbacks(functionCallbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #functionCallbacks(FunctionCallback...)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withFunctionCallbacks(FunctionCallback... functionCallbacks) {
|
||||
return functionCallbacks(functionCallbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #functions(Set)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withFunctions(Set<String> functions) {
|
||||
return functions(functions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #function(String)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-M5")
|
||||
default Builder withFunction(String function) {
|
||||
return function(function);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user