@@ -346,24 +346,18 @@ There is also a way to generate the schema from a map of key-value pairs. This c
346346
347347``` java
348348var schemaMap =
349- Map . of(
350- " type" ,
351- " object" ,
352- " properties" ,
353- Map . of(
354- " language" , Map . of(" type" , " string" ),
355- " translation" , Map . of(" type" , " string" )),
356- " required" ,
357- List . of(" language" , " translation" ),
358- " additionalProperties" ,
359- false );
349+ Map . ofEntries(
350+ entry(" type" , " object" ),
351+ entry(" properties" , Map . ofEntries(
352+ entry(" language" , Map . of(" type" , " string" )),
353+ entry(" translation" , Map . of(" type" , " string" ))),
354+ entry(" required" , List . of(" language" ," translation" )),
355+ entry(" additionalProperties" , false )));
356+
360357var schemaFromMap = ResponseJsonSchema . of(schemaMap, " Translator-Schema" );
361358var config = new OrchestrationModuleConfig ()
362- .withLlmConfig(OrchestrationAiModel . GPT_4O );
359+ .withLlmConfig(OrchestrationAiModel . GPT_4O );
363360var configWithResponseSchema = config. withJsonSchemaResponse(schemaFromMap);
364-
365- var prompt = new OrchestrationPrompt (Message . user(" Some message." ));
366- var response = client. chatCompletion(prompt, configWithTemplate). getContent();
367361```
368362
369363</details >
0 commit comments