4141 * @author Ricken Bazolo
4242 * @author Christian Tzolov
4343 * @author Thomas Vitale
44+ * @author Alexandros Pappas
4445 * @since 0.8.1
4546 */
4647@ JsonInclude (JsonInclude .Include .NON_NULL )
@@ -145,20 +146,20 @@ public static Builder builder() {
145146 }
146147
147148 public static MistralAiChatOptions fromOptions (MistralAiChatOptions fromOptions ) {
148- return builder ().withModel (fromOptions .getModel ())
149- .withMaxTokens (fromOptions .getMaxTokens ())
150- .withSafePrompt (fromOptions .getSafePrompt ())
151- .withRandomSeed (fromOptions .getRandomSeed ())
152- .withTemperature (fromOptions .getTemperature ())
153- .withTopP (fromOptions .getTopP ())
154- .withResponseFormat (fromOptions .getResponseFormat ())
155- .withStop (fromOptions .getStop ())
156- .withTools (fromOptions .getTools ())
157- .withToolChoice (fromOptions .getToolChoice ())
158- .withFunctionCallbacks (fromOptions .getFunctionCallbacks ())
159- .withFunctions (fromOptions .getFunctions ())
160- .withProxyToolCalls (fromOptions .getProxyToolCalls ())
161- .withToolContext (fromOptions .getToolContext ())
149+ return builder ().model (fromOptions .getModel ())
150+ .maxTokens (fromOptions .getMaxTokens ())
151+ .safePrompt (fromOptions .getSafePrompt ())
152+ .randomSeed (fromOptions .getRandomSeed ())
153+ .temperature (fromOptions .getTemperature ())
154+ .topP (fromOptions .getTopP ())
155+ .responseFormat (fromOptions .getResponseFormat ())
156+ .stop (fromOptions .getStop ())
157+ .tools (fromOptions .getTools ())
158+ .toolChoice (fromOptions .getToolChoice ())
159+ .functionCallbacks (fromOptions .getFunctionCallbacks ())
160+ .functions (fromOptions .getFunctions ())
161+ .proxyToolCalls (fromOptions .getProxyToolCalls ())
162+ .toolContext (fromOptions .getToolContext ())
162163 .build ();
163164 }
164165
@@ -357,84 +358,84 @@ public static class Builder {
357358
358359 private final MistralAiChatOptions options = new MistralAiChatOptions ();
359360
360- public Builder withModel (String model ) {
361+ public Builder model (String model ) {
361362 this .options .setModel (model );
362363 return this ;
363364 }
364365
365- public Builder withModel (MistralAiApi .ChatModel chatModel ) {
366+ public Builder model (MistralAiApi .ChatModel chatModel ) {
366367 this .options .setModel (chatModel .getName ());
367368 return this ;
368369 }
369370
370- public Builder withMaxTokens (Integer maxTokens ) {
371+ public Builder maxTokens (Integer maxTokens ) {
371372 this .options .setMaxTokens (maxTokens );
372373 return this ;
373374 }
374375
375- public Builder withSafePrompt (Boolean safePrompt ) {
376+ public Builder safePrompt (Boolean safePrompt ) {
376377 this .options .setSafePrompt (safePrompt );
377378 return this ;
378379 }
379380
380- public Builder withRandomSeed (Integer randomSeed ) {
381+ public Builder randomSeed (Integer randomSeed ) {
381382 this .options .setRandomSeed (randomSeed );
382383 return this ;
383384 }
384385
385- public Builder withStop (List <String > stop ) {
386+ public Builder stop (List <String > stop ) {
386387 this .options .setStop (stop );
387388 return this ;
388389 }
389390
390- public Builder withTemperature (Double temperature ) {
391+ public Builder temperature (Double temperature ) {
391392 this .options .setTemperature (temperature );
392393 return this ;
393394 }
394395
395- public Builder withTopP (Double topP ) {
396+ public Builder topP (Double topP ) {
396397 this .options .setTopP (topP );
397398 return this ;
398399 }
399400
400- public Builder withResponseFormat (ResponseFormat responseFormat ) {
401+ public Builder responseFormat (ResponseFormat responseFormat ) {
401402 this .options .responseFormat = responseFormat ;
402403 return this ;
403404 }
404405
405- public Builder withTools (List <FunctionTool > tools ) {
406+ public Builder tools (List <FunctionTool > tools ) {
406407 this .options .tools = tools ;
407408 return this ;
408409 }
409410
410- public Builder withToolChoice (ToolChoice toolChoice ) {
411+ public Builder toolChoice (ToolChoice toolChoice ) {
411412 this .options .toolChoice = toolChoice ;
412413 return this ;
413414 }
414415
415- public Builder withFunctionCallbacks (List <FunctionCallback > functionCallbacks ) {
416+ public Builder functionCallbacks (List <FunctionCallback > functionCallbacks ) {
416417 this .options .functionCallbacks = functionCallbacks ;
417418 return this ;
418419 }
419420
420- public Builder withFunctions (Set <String > functionNames ) {
421+ public Builder functions (Set <String > functionNames ) {
421422 Assert .notNull (functionNames , "Function names must not be null" );
422423 this .options .functions = functionNames ;
423424 return this ;
424425 }
425426
426- public Builder withFunction (String functionName ) {
427+ public Builder function (String functionName ) {
427428 Assert .hasText (functionName , "Function name must not be empty" );
428429 this .options .functions .add (functionName );
429430 return this ;
430431 }
431432
432- public Builder withProxyToolCalls (Boolean proxyToolCalls ) {
433+ public Builder proxyToolCalls (Boolean proxyToolCalls ) {
433434 this .options .proxyToolCalls = proxyToolCalls ;
434435 return this ;
435436 }
436437
437- public Builder withToolContext (Map <String , Object > toolContext ) {
438+ public Builder toolContext (Map <String , Object > toolContext ) {
438439 if (this .options .toolContext == null ) {
439440 this .options .toolContext = toolContext ;
440441 }
@@ -444,6 +445,134 @@ public Builder withToolContext(Map<String, Object> toolContext) {
444445 return this ;
445446 }
446447
448+ /**
449+ * @deprecated use {@link #model(String)} instead.
450+ */
451+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
452+ public Builder withModel (String model ) {
453+ return model (model );
454+ }
455+
456+ /**
457+ * @deprecated use {@link #model(MistralAiApi.ChatModel)} instead.
458+ */
459+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
460+ public Builder withModel (MistralAiApi .ChatModel chatModel ) {
461+ return model (chatModel );
462+ }
463+
464+ /**
465+ * @deprecated use {@link #maxTokens(Integer)} instead.
466+ */
467+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
468+ public Builder withMaxTokens (Integer maxTokens ) {
469+ return maxTokens (maxTokens );
470+ }
471+
472+ /**
473+ * @deprecated use {@link #safePrompt(Boolean)} instead.
474+ */
475+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
476+ public Builder withSafePrompt (Boolean safePrompt ) {
477+ return safePrompt (safePrompt );
478+ }
479+
480+ /**
481+ * @deprecated use {@link #randomSeed(Integer)} instead.
482+ */
483+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
484+ public Builder withRandomSeed (Integer randomSeed ) {
485+ return randomSeed (randomSeed );
486+ }
487+
488+ /**
489+ * @deprecated use {@link #stop(List)} instead.
490+ */
491+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
492+ public Builder withStop (List <String > stop ) {
493+ return stop (stop );
494+ }
495+
496+ /**
497+ * @deprecated use {@link #temperature(Double)} instead.
498+ */
499+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
500+ public Builder withTemperature (Double temperature ) {
501+ return temperature (temperature );
502+ }
503+
504+ /**
505+ * @deprecated use {@link #topP(Double)} instead.
506+ */
507+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
508+ public Builder withTopP (Double topP ) {
509+ return topP (topP );
510+ }
511+
512+ /**
513+ * @deprecated use {@link #responseFormat(ResponseFormat)} instead.
514+ */
515+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
516+ public Builder withResponseFormat (ResponseFormat responseFormat ) {
517+ return responseFormat (responseFormat );
518+ }
519+
520+ /**
521+ * @deprecated use {@link #tools(List)} instead.
522+ */
523+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
524+ public Builder withTools (List <FunctionTool > tools ) {
525+ return tools (tools );
526+ }
527+
528+ /**
529+ * @deprecated use {@link #toolChoice(ToolChoice)} instead.
530+ */
531+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
532+ public Builder withToolChoice (ToolChoice toolChoice ) {
533+ return toolChoice (toolChoice );
534+ }
535+
536+ /**
537+ * @deprecated use {@link #functionCallbacks(List)} instead.
538+ */
539+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
540+ public Builder withFunctionCallbacks (List <FunctionCallback > functionCallbacks ) {
541+ return functionCallbacks (functionCallbacks );
542+ }
543+
544+ /**
545+ * @deprecated use {@link #functions(Set)} instead.
546+ */
547+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
548+ public Builder withFunctions (Set <String > functionNames ) {
549+ return functions (functionNames );
550+ }
551+
552+ /**
553+ * @deprecated use {@link #function(String)} instead.
554+ */
555+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
556+ public Builder withFunction (String functionName ) {
557+ return function (functionName );
558+ }
559+
560+ /**
561+ * @deprecated use {@link #proxyToolCalls(Boolean)} instead.
562+ */
563+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
564+ public Builder withProxyToolCalls (Boolean proxyToolCalls ) {
565+ return proxyToolCalls (proxyToolCalls );
566+ }
567+
568+ /**
569+ * @deprecated use {@link #toolContext(Map)} instead.
570+ */
571+ @ Deprecated (forRemoval = true , since = "1.0.0-M5" )
572+ public Builder withToolContext (Map <String , Object > toolContext ) {
573+ return toolContext (toolContext );
574+ }
575+
447576 public MistralAiChatOptions build () {
448577 return this .options ;
449578 }
0 commit comments