Class AbstractResourceView
java.lang.Object
uno.anahata.asi.agi.resource.view.AbstractResourceView
- All Implemented Interfaces:
ResourceView
Base implementation for resource views providing parent resource management.
This class manages the link back to the parent Resource, allowing
views to trigger reactive reloads when their internal configuration changes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTriggers a markDirty on the owner resource to signal that the view's settings have changed and need re-interpretation, and clears the cached token count.voidResets the cached token count of this view, forcing a lazy recalculation on the next query.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceView
getHeader, getInstructions, getTokenCount, getVisiblePercentage, hasContent, isTruncated, populateRag, reload, setOwnerModifier and TypeMethodDescriptiondefault StringReturns a machine-readable header summarizing the interpretation state.Provides system instructions if the resource is in that position.intReturns the token count for the current processed state of this viewdoubleReturns the percentage of the underlying resource content currently visible or provided by this view to the model.booleanChecks whether this view currently has its in-memory content loaded and ready.default booleanChecks whether this view's content is currently truncated or clipped (i.e. less than 100% of the underlying resource is visible).voidpopulateRag(RagMessage ragMessage) Populates the RAG message with the appropriate parts (Text or Blob).voidreload()Reloads and processes the content from the source.voidAssociates this view with its parent resource.
-
Field Details
-
tokenCount
The cached token count of this view's content under the active model. This is marked transient to prevent serializing stale counts across session restarts. -
owner
The parent resource orchestrator. Circularity is handled natively by Kryo.
-
-
Constructor Details
-
AbstractResourceView
public AbstractResourceView()
-
-
Method Details
-
resetTokenCount
public void resetTokenCount()Resets the cached token count of this view, forcing a lazy recalculation on the next query.Clears the cached token count, forcing a lazy, background recalculation on the next query.
- Specified by:
resetTokenCountin interfaceResourceView
-
markDirty
public void markDirty()Triggers a markDirty on the owner resource to signal that the view's settings have changed and need re-interpretation, and clears the cached token count.
-

