Class ThinkingStatusItem
java.lang.Object
io.jmix.aichat.component.messagelist.ThinkingStatusItem
- All Implemented Interfaces:
Serializable
One reported unit of work shown in the thinking region of an
AiMessageList while the assistant is working — typically a tool call.
Instances come from ThinkingStatusPublisher.start(String), which
returns the handle its caller keeps for the lifetime of the work:
ThinkingStatusItem item = chat.getThinkingStatusPublisher().start("Searching customers by name");
List<Customer> found = repository.searchByName(name);
item.complete("found " + found.size());
An item is mutable while in flight and frozen once completed: after
complete(), both update(java.lang.String) and a second completion throw
IllegalStateException. An item that has been dropped from its feed
(by ThinkingStatusPublisher.remove(io.jmix.aichat.component.messagelist.ThinkingStatusItem) or
ThinkingStatusPublisher.clear()) is detached, and its mutators
become silent no-ops instead — a turn ending underneath a still-running
background thread is not a caller error.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
id
-
text
-
detail
-
completed
protected boolean completed -
owner
The owning feed, ornullonce this item has been detached from it. Deliberately nottransient: the publisher's own list already keeps this item reachable, so marking it transient would buy nothing and would silently detach every in-flight handle across session passivation.
-
-
Constructor Details
-
ThinkingStatusItem
-
-
Method Details
-
getId
- Returns:
- the identity the client keys its rendered row by; unique within the feed
-
getText
- Returns:
- the text describing what this status is doing
-
update
Re-states what this status is currently doing, e.g. "Reading document 1 of 5" becoming "Reading document 3 of 5". A no-op on a detached item.- Parameters:
text- the new text, notnulland not blank- Throws:
IllegalStateException- if this item has already been completed
-
getDetail
- Returns:
- the short result of a completed status, or
nullif there is none
-
isCompleted
public boolean isCompleted()Whether this status has finished. An explicit flag: a status completed with nothing to report is completed all the same.- Returns:
- whether this status has finished
-
complete
public void complete()Completes this status with nothing to report. A no-op on a detached item.- Throws:
IllegalStateException- if this item has already been completed
-
complete
Completes this status. A no-op on a detached item.- Parameters:
detail- a short result of the finished work, ornull- Throws:
IllegalStateException- if this item has already been completed
-
checkNotCompleted
protected void checkNotCompleted()
-