3838 *
3939 * @author Christian Tzolov
4040 * @author Thomas Vitale
41+ * @author Alexandros Pappas
4142 * @since 1.0.0
4243 */
4344@ JsonInclude (Include .NON_NULL )
@@ -89,17 +90,17 @@ public static Builder builder() {
8990 }
9091
9192 public static AnthropicChatOptions fromOptions (AnthropicChatOptions fromOptions ) {
92- return builder ().withModel (fromOptions .getModel ())
93- .withMaxTokens (fromOptions .getMaxTokens ())
94- .withMetadata (fromOptions .getMetadata ())
95- .withStopSequences (fromOptions .getStopSequences ())
96- .withTemperature (fromOptions .getTemperature ())
97- .withTopP (fromOptions .getTopP ())
98- .withTopK (fromOptions .getTopK ())
99- .withFunctionCallbacks (fromOptions .getFunctionCallbacks ())
100- .withFunctions (fromOptions .getFunctions ())
101- .withProxyToolCalls (fromOptions .getProxyToolCalls ())
102- .withToolContext (fromOptions .getToolContext ())
93+ return builder ().model (fromOptions .getModel ())
94+ .maxTokens (fromOptions .getMaxTokens ())
95+ .metadata (fromOptions .getMetadata ())
96+ .stopSequences (fromOptions .getStopSequences ())
97+ .temperature (fromOptions .getTemperature ())
98+ .topP (fromOptions .getTopP ())
99+ .topK (fromOptions .getTopK ())
100+ .functionCallbacks (fromOptions .getFunctionCallbacks ())
101+ .functions (fromOptions .getFunctions ())
102+ .proxyToolCalls (fromOptions .getProxyToolCalls ())
103+ .toolContext (fromOptions .getToolContext ())
103104 .build ();
104105 }
105106
@@ -227,69 +228,69 @@ public static class Builder {
227228
228229 private final AnthropicChatOptions options = new AnthropicChatOptions ();
229230
230- public Builder withModel (String model ) {
231+ public Builder model (String model ) {
231232 this .options .model = model ;
232233 return this ;
233234 }
234235
235- public Builder withModel (AnthropicApi .ChatModel model ) {
236+ public Builder model (AnthropicApi .ChatModel model ) {
236237 this .options .model = model .getValue ();
237238 return this ;
238239 }
239240
240- public Builder withMaxTokens (Integer maxTokens ) {
241+ public Builder maxTokens (Integer maxTokens ) {
241242 this .options .maxTokens = maxTokens ;
242243 return this ;
243244 }
244245
245- public Builder withMetadata (ChatCompletionRequest .Metadata metadata ) {
246+ public Builder metadata (ChatCompletionRequest .Metadata metadata ) {
246247 this .options .metadata = metadata ;
247248 return this ;
248249 }
249250
250- public Builder withStopSequences (List <String > stopSequences ) {
251+ public Builder stopSequences (List <String > stopSequences ) {
251252 this .options .stopSequences = stopSequences ;
252253 return this ;
253254 }
254255
255- public Builder withTemperature (Double temperature ) {
256+ public Builder temperature (Double temperature ) {
256257 this .options .temperature = temperature ;
257258 return this ;
258259 }
259260
260- public Builder withTopP (Double topP ) {
261+ public Builder topP (Double topP ) {
261262 this .options .topP = topP ;
262263 return this ;
263264 }
264265
265- public Builder withTopK (Integer topK ) {
266+ public Builder topK (Integer topK ) {
266267 this .options .topK = topK ;
267268 return this ;
268269 }
269270
270- public Builder withFunctionCallbacks (List <FunctionCallback > functionCallbacks ) {
271+ public Builder functionCallbacks (List <FunctionCallback > functionCallbacks ) {
271272 this .options .functionCallbacks = functionCallbacks ;
272273 return this ;
273274 }
274275
275- public Builder withFunctions (Set <String > functionNames ) {
276+ public Builder functions (Set <String > functionNames ) {
276277 Assert .notNull (functionNames , "Function names must not be null" );
277278 this .options .functions = functionNames ;
278279 return this ;
279280 }
280281
281- public Builder withFunction (String functionName ) {
282+ public Builder function (String functionName ) {
282283 Assert .hasText (functionName , "Function name must not be empty" );
283284 this .options .functions .add (functionName );
284285 return this ;
285286 }
286287
287- public Builder withProxyToolCalls (Boolean proxyToolCalls ) {
288+ public Builder proxyToolCalls (Boolean proxyToolCalls ) {
288289 this .options .proxyToolCalls = proxyToolCalls ;
289290 return this ;
290291 }
291292
292- public Builder withToolContext (Map <String , Object > toolContext ) {
293+ public Builder toolContext (Map <String , Object > toolContext ) {
293294 if (this .options .toolContext == null ) {
294295 this .options .toolContext = toolContext ;
295296 }
@@ -299,6 +300,110 @@ public Builder withToolContext(Map<String, Object> toolContext) {
299300 return this ;
300301 }
301302
303+ /**
304+ * @deprecated use {@link #model(String)} instead.
305+ */
306+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
307+ public Builder withModel (String model ) {
308+ return model (model );
309+ }
310+
311+ /**
312+ * @deprecated use {@link #model(AnthropicApi.ChatModel)} instead.
313+ */
314+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
315+ public Builder withModel (AnthropicApi .ChatModel model ) {
316+ return model (model );
317+ }
318+
319+ /**
320+ * @deprecated use {@link #maxTokens(Integer)} instead.
321+ */
322+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
323+ public Builder withMaxTokens (Integer maxTokens ) {
324+ return maxTokens (maxTokens );
325+ }
326+
327+ /**
328+ * @deprecated use {@link #metadata(ChatCompletionRequest.Metadata)} instead.
329+ */
330+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
331+ public Builder withMetadata (ChatCompletionRequest .Metadata metadata ) {
332+ return metadata (metadata );
333+ }
334+
335+ /**
336+ * @deprecated use {@link #stopSequences(List)} instead.
337+ */
338+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
339+ public Builder withStopSequences (List <String > stopSequences ) {
340+ return stopSequences (stopSequences );
341+ }
342+
343+ /**
344+ * @deprecated use {@link #temperature(Double)} instead.
345+ */
346+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
347+ public Builder withTemperature (Double temperature ) {
348+ return temperature (temperature );
349+ }
350+
351+ /**
352+ * @deprecated use {@link #topP(Double)} instead.
353+ */
354+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
355+ public Builder withTopP (Double topP ) {
356+ return topP (topP );
357+ }
358+
359+ /**
360+ * @deprecated use {@link #topK(Integer)} instead.
361+ */
362+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
363+ public Builder withTopK (Integer topK ) {
364+ return topK (topK );
365+ }
366+
367+ /**
368+ * @deprecated use {@link #functionCallbacks(List)} instead.
369+ */
370+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
371+ public Builder withFunctionCallbacks (List <FunctionCallback > functionCallbacks ) {
372+ return functionCallbacks (functionCallbacks );
373+ }
374+
375+ /**
376+ * @deprecated use {@link #functions(Set)} instead.
377+ */
378+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
379+ public Builder withFunctions (Set <String > functionNames ) {
380+ return functions (functionNames );
381+ }
382+
383+ /**
384+ * @deprecated use {@link #function(String)} instead.
385+ */
386+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
387+ public Builder withFunction (String functionName ) {
388+ return function (functionName );
389+ }
390+
391+ /**
392+ * @deprecated use {@link #proxyToolCalls(Boolean)} instead.
393+ */
394+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
395+ public Builder withProxyToolCalls (Boolean proxyToolCalls ) {
396+ return proxyToolCalls (proxyToolCalls );
397+ }
398+
399+ /**
400+ * @deprecated use {@link #toolContext(Map)} instead.
401+ */
402+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
403+ public Builder withToolContext (Map <String , Object > toolContext ) {
404+ return toolContext (toolContext );
405+ }
406+
302407 public AnthropicChatOptions build () {
303408 return this .options ;
304409 }
0 commit comments