Skip to content

Commit d4c648d

Browse files
committed
docs: state the write order requirement of the history example
1 parent cef8358 commit d4c648d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎articles/flow/ai-support/conversation-history.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ this.orchestrator = AiOrchestrator
3333
.build();
3434
----
3535

36-
In this example, [methodname]`historyWriter()` returns an application-managed background executor that writes each conversation's snapshots in submission order. Implement [methodname]`saveToDatabase()` to store the snapshot.
36+
In this example, [methodname]`historyWriter()` returns a background executor that the application manages. Make sure that it runs the writes of a conversation in the order they were submitted, as a single-threaded executor does. Otherwise, an older snapshot can overwrite a newer one. Implement [methodname]`saveToDatabase()` to store the snapshot.
3737

3838
The listener fires once per turn for both successful and failed exchanges -- check [methodname]`event.getError()` to tell them apart. It is not called when history is restored via [methodname]`withHistory()`, and empty responses (turns where the model emitted only tool calls or no visible content) are not appended to history. The event also carries the [since:com.vaadin:vaadin@V25.3]#finish reason and token usage# of the turn -- see <<listeners#response-metadata,Response Metadata>>.
3939

0 commit comments

Comments
 (0)