Class InputUserMessage
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.message.AbstractMessage
uno.anahata.asi.agi.message.UserMessage
uno.anahata.asi.agi.message.InputUserMessage
- All Implemented Interfaces:
PropertyChangeSource, Rebindable
A specialized UserMessage designed for direct manipulation by UI components like
an input panel.
This class encapsulates the logic of managing a primary, editable text part,
providing convenient methods to get and set its content. This avoids cluttering
the generic UserMessage with UI-specific concerns and prevents
unintended side effects on other subclasses like RagMessage.
- Author:
- Anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TextPartThe primary, editable text part of this message.Fields inherited from class BasicPropertyChangeSource
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionInputUserMessage(Agi agi) Constructs a new InputUserMessage bound to an active session context. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(File file) Adds a singleFileobject as an attachment to this message.voidaddAttachment(Path path) Adds a single file path as an attachment to this message.voidaddAttachments(Collection<Path> paths) Adds a collection of file paths as attachments to this message.Gets a list of all attachedBlobParts.getText()Gets the text content of the primary editable part.voidSets the text content of the primary editable part.Methods inherited from class UserMessage
addBlobPart, addBlobPart, addTextPart, getDevice, getFrom, getRoleMethods inherited from class AbstractMessage
addPart, appendMetadata, asText, createMetadataHeader, getDepth, getEffectiveTokenCount, getIdentityLabel, getParts, getParts, getRemainingDepth, getTokenCount, isAllPinned, isAllPruned, isAnyPinned, isEffectivelyPruned, isEmpty, isGarbageCollectable, isPrunnableOrRemovable, pinAllParts, pruneAllParts, remove, removePart, resetTokenCounts, setAutoAllParts, shouldCreateMetadataMethods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertyChangeSource
getPropertyChangeSupport
-
Field Details
-
editableTextPart
The primary, editable text part of this message.
-
-
Constructor Details
-
InputUserMessage
Constructs a new InputUserMessage bound to an active session context.- Parameters:
agi- The active Agi orchestrator.
-
-
Method Details
-
getText
Gets the text content of the primary editable part.- Returns:
- The text content, or an empty string if no text part exists.
-
setText
Sets the text content of the primary editable part. If the text is empty, the text part is automatically removed from the message.- Parameters:
text- The new text content.
-
getAttachments
-
addAttachment
-
addAttachment
-
addAttachments
Adds a collection of file paths as attachments to this message.- Parameters:
paths- The collection of file paths to attach.- Throws:
Exception- if a BlobPart cannot be created from a path (e.g., file read error).
-

