Skip to content

Commit 3d8315e

Browse files
committed
Update docs
1 parent dc69ad1 commit 3d8315e

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/guides/ORCHESTRATION_CHAT_COMPLETION.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -266,37 +266,33 @@ It's possible to add images and multiple text inputs to a message.
266266

267267
### Add images to a message
268268

269-
An image can be added to an existing message as follows.
269+
An image can be added to a message as follows.
270270

271271
```java
272-
var newMessage = message.andImage("https://url.to/image.jpg");
272+
var message = Message.user("Describe the following image");
273+
var newMessage = message.withImage("https://url.to/image.jpg");
273274
```
274275

275-
You can also construct a message with an image directly, using the `MessageContent` class.
276+
You can also construct a message with an image directly, using the `ImageItem` class.
276277

277278
```java
278-
var message = Message.user(MessageContent.image("https://url.to/image.jpg"));
279+
var message = Message.user(new ImageItem("https://url.to/image.jpg"));
279280
```
280281

281282
Some AI models, like GPT 4o, support additionally setting the detail level with which the image is read. This can be set via the `DetailLevel` parameter.
282283

283284
```java
284-
var newMessage = message.andImage("https://url.to/image.jpg", ImageItem.DetailLevel.low);
285+
var newMessage = message.withImage("https://url.to/image.jpg", ImageItem.DetailLevel.LOW);
285286
```
286287
Note, that currently only user messages are supported for image attachments.
287288

288289
### Add multiple text inputs to a message
289290

290-
It's also possible to add multiple text inputs to a message. This can be useful for providing additional context to the AI model. You can construct a message with multiple text inputs as follows.
291+
It's also possible to add multiple text inputs to a message. This can be useful for providing additional context to the AI model. You can add additional text inputs as follows.
291292

292293
```java
293-
var message = Message.user("What is chess about?", "Answer in two sentences.");
294-
```
295-
296-
Or you can add additional text inputs to an existing message.
297-
298-
```java
299-
var newMessage = message.andText("Please use many emojis in your answer.");
294+
var message = Message.user("What is chess about?");
295+
var newMessage = message.withText("Answer in two sentences.");
300296
```
301297

302298
Note, that only user and system messages are supported for multiple text inputs.

docs/release-notes/release_notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
### 🔧 Compatibility Notes
1010

11-
- `Message.content()` returns a `ContentItem` now instead of a `String`. Use `((TextItem) Message.content().contentItemList().get(0)).text()` if the corresponding `ContentItem` is a `TextItem` and the string representation is needed.
11+
- `Message.content()` returns a `ContentItem` now instead of a `String`. Use `((TextItem) Message.content().items().get(0)).text()` if the corresponding `ContentItem` is a `TextItem` and the string representation is needed.
1212

1313
### ✨ New Functionality
1414

0 commit comments

Comments
 (0)