@@ -224,13 +224,11 @@ private ChatRequest toChatRequest(LlmRequest llmRequest) {
224224 .mode ()
225225 .ifPresent (
226226 functionMode -> {
227- if (functionMode
228- .knownEnum ()
229- .equals (FunctionCallingConfigMode .Known .AUTO )) {
227+ if (FunctionCallingConfigMode .Known .AUTO .equals (
228+ functionMode .knownEnum ())) {
230229 requestBuilder .toolChoice (ToolChoice .AUTO );
231- } else if (functionMode
232- .knownEnum ()
233- .equals (FunctionCallingConfigMode .Known .ANY )) {
230+ } else if (FunctionCallingConfigMode .Known .ANY .equals (
231+ functionMode .knownEnum ())) {
234232 // TODO check if it's the correct
235233 // mapping
236234 requestBuilder .toolChoice (ToolChoice .REQUIRED );
@@ -246,9 +244,8 @@ private ChatRequest toChatRequest(LlmRequest llmRequest) {
246244 toolSpecification .name ()))
247245 .toList ());
248246 });
249- } else if (functionMode
250- .knownEnum ()
251- .equals (FunctionCallingConfigMode .Known .NONE )) {
247+ } else if (FunctionCallingConfigMode .Known .NONE .equals (
248+ functionMode .knownEnum ())) {
252249 requestBuilder .toolSpecifications (List .of ());
253250 }
254251 });
@@ -349,7 +346,7 @@ private List<ChatMessage> toUserOrToolResultMessage(Content content) {
349346 .mimeType (mimeType )
350347 .build ());
351348 } else if (mimeType .startsWith ("text/" )
352- || mimeType . equals ( "application/json" )
349+ || "application/json" . equals ( mimeType )
353350 || mimeType .endsWith ("+json" )
354351 || mimeType .endsWith ("+xml" )) {
355352 // TODO are there missing text based mime types?
@@ -454,7 +451,7 @@ private List<ToolSpecification> toToolSpecifications(LlmRequest llmRequest) {
454451 }
455452
456453 private JsonObjectSchema toParameters (Schema schema ) {
457- if (schema .type ().isPresent () && schema .type ().get ().knownEnum (). equals ( Type . Known . OBJECT )) {
454+ if (schema .type ().isPresent () && Type . Known . OBJECT . equals ( schema .type ().get ().knownEnum ())) {
458455 return JsonObjectSchema .builder ()
459456 .addProperties (toProperties (schema ))
460457 .required (schema .required ().orElse (List .of ()))
0 commit comments