Skip to content

Commit 168bd71

Browse files
Jonas-Isrnewtork
andauthored
Update docs/guides/ORCHESTRATION_CHAT_COMPLETION.md
Co-authored-by: Alexander Dümont <[email protected]>
1 parent 9b1482d commit 168bd71

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

docs/guides/ORCHESTRATION_CHAT_COMPLETION.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
348348
var 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+
360357
var schemaFromMap = ResponseJsonSchema.of(schemaMap, "Translator-Schema");
361358
var config = new OrchestrationModuleConfig()
362-
.withLlmConfig(OrchestrationAiModel.GPT_4O);
359+
.withLlmConfig(OrchestrationAiModel.GPT_4O);
363360
var 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

Comments
 (0)