@@ -144,14 +144,14 @@ private static String doOpenAIChatCompletion(Context ctx, OpenAIClient openaiCli
144144
145145 var builder = ChatCompletionCreateParams .builder ();
146146 builder .model (payload .optString ("model" ));
147-
147+
148148 // Parse messages array
149149 JSONArray messages = payload .getJSONArray ("messages" );
150150 for (int i = 0 ; i < messages .length (); i ++) {
151151 JSONObject message = messages .getJSONObject (i );
152152 String role = message .getString ("role" );
153153 String content = message .getString ("content" );
154-
154+
155155 if ("user" .equals (role )) {
156156 builder .addUserMessage (content );
157157 } else if ("system" .equals (role )) {
@@ -166,13 +166,13 @@ private static String doOpenAIChatCompletion(Context ctx, OpenAIClient openaiCli
166166 // maxCompletionTokens is preferable
167167 builder .maxTokens (parameters .optLong ("max_tokens" ));
168168 }
169- if (!Double .isNaN (parameters .optDouble ("temperature" ))) {
169+ if (!Double .isNaN (parameters .optDouble ("temperature" ))) {
170170 builder .temperature (parameters .optDouble ("temperature" ));
171171 }
172172 if (tools != null ) {
173173 for (int i = 0 ; i < tools .length (); i ++) {
174174 JSONObject tool = tools .getJSONObject (i );
175-
175+
176176 JSONObject functionObj = tool .getJSONObject ("function" );
177177 Map <String , Object > functionMap = functionObj .toMap ();
178178
@@ -212,7 +212,7 @@ private static String doOpenAIEmbedding (Context ctx, OpenAIClient openaiClient)
212212 builder .input (input );
213213
214214 openaiClient .embeddings ().create (builder .build ());
215-
215+
216216 return toJson (new HashMap <String , String >());
217217 }
218218
@@ -242,7 +242,7 @@ private static String doOpenAIResponsesCreate (Context ctx, OpenAIClient openaiC
242242 builder .maxOutputTokens ((long ) parameters .getDouble ("max_output_tokens" ));
243243 }
244244
245- if (!Double .isNaN (parameters .optDouble ("temperature" ))) {
245+ if (!Double .isNaN (parameters .optDouble ("temperature" ))) {
246246 builder .temperature (parameters .getDouble ("temperature" ));
247247 }
248248
@@ -257,7 +257,7 @@ private static String doOpenAIResponsesCreate (Context ctx, OpenAIClient openaiC
257257
258258 if (tools != null ) {
259259 List <Object > toolsList = (List <Object >) deepConvertJsonToJava (tools );
260-
260+
261261 builder .tools (JsonValue .from (toolsList ));
262262 builder .toolChoice (JsonValue .from ("auto" ));
263263 }
@@ -267,7 +267,7 @@ private static String doOpenAIResponsesCreate (Context ctx, OpenAIClient openaiC
267267 streamResponse .stream ().forEach (chunk -> {
268268 // consume the stream
269269 });
270- }
270+ }
271271 } else {
272272 openaiClient .responses ().create (builder .build ());
273273 }
@@ -303,7 +303,7 @@ private static String doAnthropicCreate (Context ctx, AnthropicClient anthropicC
303303 List <Object > systemList = (List <Object >) deepConvertJsonToJava (system );
304304 builder .system (com .anthropic .core .JsonValue .from (systemList ));
305305 }
306-
306+
307307 builder .model (model );
308308
309309 if (messages != null ) {
@@ -402,8 +402,8 @@ private static String doCreateTrace (JSONObject traceStructure) {
402402 }
403403
404404 private static void doTraceChildren (JSONArray children ) {
405- if (children == null ) {
406- return ;
405+ if (children == null ) {
406+ return ;
407407 }
408408
409409 for (int i = 0 ; i < children .length (); i ++) {
0 commit comments