Class WebSearchCallPart
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.message.AbstractPart
uno.anahata.asi.agi.message.TextPart
uno.anahata.asi.agi.message.ModelTextPart
uno.anahata.asi.agi.message.web.WebSearchCallPart
- All Implemented Interfaces:
PropertyChangeSource, ThoughtSignature, Rebindable
A specialized part representing a search query or search intent generated by the model.
This part captures the explicit "Web Search" action performed by the model
on the server. While the results are typically aggregated in GroundingMetadata,
this part maintains the chronological record of the search query within the conversation flow.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe list of search queries generated by the model.Fields inherited from class BasicPropertyChangeSource
propertyChangeSupportModifier and TypeFieldDescriptionprotected PropertyChangeSupportSupport for firing property change events. -
Constructor Summary
ConstructorsConstructorDescriptionWebSearchCallPart(AbstractModelMessage message, String displayText, List<String> queries, byte[] thoughtSignature) Constructs a new ModelSearchCallPart. -
Method Summary
Modifier and TypeMethodDescriptionasText()Returns the content of the part as a simple string.protected intTemplate method hook for subclasses to provide their specific default max depth policy.Methods inherited from class ModelTextPart
isThoughtModifier and TypeMethodDescriptionbooleanIndicates if this text part represents a model thought process.Methods inherited from class TextPart
appendMetadata, appendText, calculateTokenCount, resetTokenCount, setTextModifier and TypeMethodDescriptionprotected voidHook for subclasses to inject specialized metadata into the part header.voidappendText(String delta) Appends text to the existing content and fires a property change event.protected voidPerforms the lazy, model-specific token calculation for this part.voidResets the cached token count, forcing a lazy, background recalculation on the next call to getTokenCount().voidSets the text content and fires a property change event for the "text" property.Methods inherited from class AbstractPart
createMetadataHeader, getAgi, getAgiConfig, getEffectiveMaxDepth, getEffectiveTokenCount, getIdentityLabel, getMetadataTokenCount, getPrunedHint, getRemainingDepth, getTokenCount, isAuto, isEffectivelyPruned, isPinned, isPruned, remove, setExpanded, setPruningState, setPruningState, setTokenCountModifier and TypeMethodDescriptionCreates a standardized text header containing metadata for this part.getAgi()Gets the parent agi session.Gets the agi configuration.final intThe definitive method for resolving the max depth policy for this part.intCalculates the total "effective" tokens contributed by this part.protected StringReturns the identity label for the metadata header (e.g., "Part ID: 45").intCalculates the token count of the metadata header for this part.Returns a summarized string representation of the part's content to be used as a "Hint" when the part is effectively pruned.intCalculates the remaining depth before this part is auto-pruned.intRetrieves the cached token count for this part.booleanisAuto()Checks if this part is managed automatically.booleanCalculates the EFFECTIVE pruned state of this part.booleanisPinned()Checks if this part is explicitly pinned.booleanisPruned()Checks if this part is explicitly pruned.voidremove()Removes this part from its parent message and severs the bidirectional link.voidsetExpanded(boolean expanded) Sets the expanded state and fires a property change event.voidsetPruningState(PruningState pruningState) Sets the pruning state of this part and fires a property change event.voidsetPruningState(PruningState pruningState, String reason) Sets the pruning state of this part with an optional reason.voidsetTokenCount(int tokenCount) Sets the token count and fires a property change event.Methods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerModifier and TypeMethodDescriptionvoidAdds a property change listener.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Adds a property change listener for a specific property.voidrebind()Re-initializes the transientPropertyChangeSupportafter deserialization.voidRemoves a property change listener.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Removes a property change listener for a specific property.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertyChangeSource
getPropertyChangeSupportModifier and TypeMethodDescriptionGets the PropertyChangeSupport instance for this object.Methods inherited from interface ThoughtSignature
getThoughtSignature, setThoughtSignatureModifier and TypeMethodDescriptionbyte[]Gets the signature of the thought process as a byte array.voidsetThoughtSignature(byte[] thoughtSignature) Sets the signature of the thought process as a byte array.
-
Field Details
-
queries
-
-
Constructor Details
-
WebSearchCallPart
public WebSearchCallPart(AbstractModelMessage message, String displayText, List<String> queries, byte[] thoughtSignature) Constructs a new ModelSearchCallPart.- Parameters:
message- The model message that triggered the search.displayText- A human-readable summary of the search action.queries- The list of search queries executed.thoughtSignature- The signature of the thought process associated with this search, if any.
-
-
Method Details
-
asText
-
getDefaultMaxDepth
protected int getDefaultMaxDepth()Template method hook for subclasses to provide their specific default max depth policy. This is the fallback value used when no explicitmaxDepthis set on the instance. Returns the default maximum depth to keep a text part in context, as defined in the agi configuration. Returns the default maximum depth for thoughts if this is a thought part, otherwise falls back to the standard text part depth.Returns the default maximum depth to keep a web search call part in context.
- Overrides:
getDefaultMaxDepthin classModelTextPart- Returns:
- The default maximum depth for this part type.
-

