Package io.jmix.aitools.tool
Class AiToolStatusUpdate
java.lang.Object
io.jmix.aitools.tool.AiToolStatusUpdate
Ephemeral status update emitted by an AI tool through
AiToolStatusPublisher.
Two-phase semantics. A tool publishes the SAME message
twice during its lifetime:
-
first with
resultSnippet == null— meaning "I started this step" (the consumer renders it as an in-flight indicator); -
then with the same message and a non-blank
resultSnippet— meaning "this step finished, here is the short result" (the consumer folds the second into the first, marks it as completed and shows the snippet next to the base text).
isCompleted() to tell the two apart.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAiToolStatusUpdate(String message) Convenience constructor for an in-flight ("started, no result yet") update.AiToolStatusUpdate(String message, @Nullable String resultSnippet) -
Method Summary
Modifier and TypeMethodDescriptionReturns the status message.@Nullable StringReturns the short result snippet of a completed step.booleantrueif the update carries a non-blankresultSnippet(i.e.
-
Field Details
-
message
-
resultSnippet
-
-
Constructor Details
-
AiToolStatusUpdate
-
AiToolStatusUpdate
Convenience constructor for an in-flight ("started, no result yet") update. Equivalent tonew AiToolStatusUpdate(message, null).- Parameters:
message- status text describing the step that has started
-
-
Method Details
-
getMessage
Returns the status message.- Returns:
- status message
-
getResultSnippet
Returns the short result snippet of a completed step.- Returns:
- result snippet, or
nullfor an in-flight update
-
isCompleted
public boolean isCompleted()trueif the update carries a non-blankresultSnippet(i.e. is the "completed" half of the two-phase publish).- Returns:
- whether this update represents a completed step
-