Skip to content

Commit 50f0f45

Browse files
Added docs and release notes
1 parent 986924e commit 50f0f45

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

docs/guides/ORCHESTRATION_CHAT_COMPLETION.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -206,31 +206,16 @@ In this example, the input will be masked before the call to the LLM and will re
206206
Use the grounding module to provide additional context to the AI model.
207207

208208
```java
209-
var message =
210-
Message.user(
211-
"{{?groundingInput}} Use the following information as additional context: {{?groundingOutput}}");
212-
var prompt =
213-
new OrchestrationPrompt(Map.of("groundingInput", "What does Joule do?"), message);
214-
215-
var filterInner =
216-
DocumentGroundingFilter.create().id("someID").dataRepositoryType(DataRepositoryType.VECTOR);
217-
var groundingConfigConfig =
218-
GroundingModuleConfigConfig.create()
219-
.inputParams(List.of("groundingInput"))
220-
.outputParam("groundingOutput")
221-
.addFiltersItem(filterInner);
222-
223-
var groundingConfig =
224-
GroundingModuleConfig.create()
225-
.type(GroundingModuleConfig.TypeEnum.DOCUMENT_GROUNDING_SERVICE)
226-
.config(groundingConfigConfig);
227-
var configWithGrounding = config.withGroundingConfig(groundingConfig);
228-
229-
var result =
230-
new OrchestrationClient().chatCompletion(prompt, configWithGrounding);
209+
var groundingConfig = Grounding.create();
210+
var prompt = groundingConfig.createGroundingPrompt("What does Joule do?");
211+
var configWithGrounding = config.withGrounding(groundingConfig);
212+
213+
var result = client.chatCompletion(prompt, configWithGrounding);
231214
```
232215

233-
In this example, the AI model is provided with additional context in the form of grounding information. Note, that it is necessary to provide the grounding input via one or more input variables.
216+
In this example, the AI model is provided with additional context in the form of grounding information.
217+
218+
`Grounding.create()` is by default a document grounding service with a vector data repository and id `"someID"`.
234219

235220
## Stream chat completion
236221

docs/release-notes/release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- New Orchestration features:
1818
- [Spring AI integration](../guides/ORCHESTRATION_CHAT_COMPLETION.md#spring-ai-integration)
19+
- [Add Grounding configuration convenience](../guides/ORCHESTRATION_CHAT_COMPLETION.md#grounding)
1920
- Images are now supported as input in newly introduced `MultiChatMessage`.
2021
- `MultiChatMessage` also allows for multiple content items (text or image) in one object.
2122
- Grounding input can be masked with `DPIConfig`.

0 commit comments

Comments
 (0)