Class SwingAgiConfig
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.AgiConfig
uno.anahata.asi.swing.agi.SwingAgiConfig
- All Implemented Interfaces:
PropertyChangeSource, Rebindable
- Direct Known Subclasses:
AsiDesktopAgiConfig, NetBeansAgiConfig
A concrete AgiConfig for standalone Swing applications, providing UI-specific settings like themes and colors.
- Author:
- anahata
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA collection of color and font definitions that define the visual identity of the Anahata Swing UI. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanIf true, sound notifications will be played on status changes.private IconProviderThe provider for context-related icons, used to visually distinguish between different types of resources and tools.private booleanIf true, parts and messages that are effectively pruned will still be rendered in the UI (e.g., in a collapsed state) to allow the user to inspect and un-prune them.Fields inherited from class BasicPropertyChangeSource
propertyChangeSupportModifier and TypeFieldDescriptionprotected PropertyChangeSupportSupport for firing property change events. -
Constructor Summary
ConstructorsConstructorDescriptionSwingAgiConfig(AbstractAsiContainer aiConfig) Constructs a new SwingAgiConfig with a randomly generated session ID.SwingAgiConfig(AbstractAsiContainer aiConfig, String sessionId) Constructs a new SwingAgiConfig with a specific session ID. -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorRetrieves the thematic color associated with a specific agi status.static ColorgetColor(ToolExecutionStatus status) Retrieves the color associated with a specific tool execution status.static ColorgetColor(ToolPermission permission) Retrieves the color associated with a specific tool permission level.static ColorgetColorForContextUsage(double percentage) Calculates a color representing context window usage, shifting from green to red as the usage approaches the threshold.getTheme()Returns a new theme object containing the color and font definitions for the UI.voidsetShowPruned(boolean showPruned) Sets whether pruned parts and messages should be shown in the UI.Methods inherited from class AgiConfig
createResourceHandle, getHostApplicationId, getTokenThreshold, setApiInitialDelayMillis, setApiMaxDelayMillis, setApiMaxRetries, setAutoReplyTools, setDefaultBlobPartMaxDepth, setDefaultModelCodeExecutionMaxDepth, setDefaultTextPartMaxDepth, setDefaultThoughtPartMaxDepth, setDefaultToolMaxDepth, setDefaultWebSearchMaxDepth, setExpandThoughts, setExpandTools, setHostedToolsEnabled, setIncludeThoughts, setLocalToolsEnabled, setSelectedModelId, setSelectedProviderUuid, setStreaming, setTokenThresholdModifier and TypeMethodDescriptioncreateResourceHandle(URI uri) Creates a specializedResourceHandlebased on the URI scheme.Convenience method to get the host application ID from the parent AsiContainer.intGets the maximum number of tokens allowed in the context window.voidsetApiInitialDelayMillis(long apiInitialDelayMillis) Sets the initial API retry delay and fires a property change event.voidsetApiMaxDelayMillis(long apiMaxDelayMillis) Sets the max API retry delay and fires a property change event.voidsetApiMaxRetries(int apiMaxRetries) Sets the max API retries and fires a property change event.voidsetAutoReplyTools(boolean autoReplyTools) Sets whether tool calls should be auto-replied and fires a property change event.voidsetDefaultBlobPartMaxDepth(int defaultBlobPartMaxDepth) Sets the default blob part max depth and fires a property change event.voidsetDefaultModelCodeExecutionMaxDepth(int defaultModelCodeExecutionMaxDepth) Sets the default model code execution max depth and fires a property change event.voidsetDefaultTextPartMaxDepth(int defaultTextPartMaxDepth) Sets the default text part max depth and fires a property change event.voidsetDefaultThoughtPartMaxDepth(int defaultThoughtPartMaxDepth) Sets the default thought part max depth and fires a property change event.voidsetDefaultToolMaxDepth(int defaultToolMaxDepth) Sets the default tool response max depth and fires a property change event.voidsetDefaultWebSearchMaxDepth(int defaultWebSearchMaxDepth) Sets the default web search max depth and fires a property change event.voidsetExpandThoughts(boolean expandThoughts) Sets whether thoughts should be expanded and fires a property change event.voidsetExpandTools(ExpandToolsPreference expandTools) Sets the tool expansion preference and fires a property change event.voidsetHostedToolsEnabled(boolean enabled) Configures the session to utilize hosted server-side tools (e.g., Google Search).voidsetIncludeThoughts(boolean includeThoughts) Sets whether thoughts should be included and fires a property change event.voidsetLocalToolsEnabled(boolean enabled) Configures the session to utilize local Java-based toolkits.voidsetSelectedModelId(String selectedModelId) Sets the selected model ID and fires a property change event.voidsetSelectedProviderUuid(String selectedProviderUuid) Sets the selected provider UUID and fires a property change event.voidsetStreaming(boolean streaming) Sets whether streaming is enabled and fires a property change event.voidsetTokenThreshold(int tokenThreshold) Sets the token threshold 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.
-
Field Details
-
iconProvider
The provider for context-related icons, used to visually distinguish between different types of resources and tools. -
showPruned
private boolean showPrunedIf true, parts and messages that are effectively pruned will still be rendered in the UI (e.g., in a collapsed state) to allow the user to inspect and un-prune them. -
audioFeedbackEnabled
private boolean audioFeedbackEnabledIf true, sound notifications will be played on status changes.
-
-
Constructor Details
-
SwingAgiConfig
Constructs a new SwingAgiConfig with a randomly generated session ID.- Parameters:
aiConfig- The global AI configuration.
-
SwingAgiConfig
Constructs a new SwingAgiConfig with a specific session ID.- Parameters:
aiConfig- The global AI configuration.sessionId- The unique session ID.
-
-
Method Details
-
setShowPruned
public void setShowPruned(boolean showPruned) Sets whether pruned parts and messages should be shown in the UI. Fires a property change event for reactive UI updates.- Parameters:
showPruned- true to show pruned content.
-
getColor
-
getColor
Retrieves the color associated with a specific tool execution status.- Parameters:
status- The status to look up.- Returns:
- The color representing that execution state.
-
getColor
Retrieves the color associated with a specific tool permission level.- Parameters:
permission- The permission level.- Returns:
- The color representing that permission.
-
getColorForContextUsage
Calculates a color representing context window usage, shifting from green to red as the usage approaches the threshold.- Parameters:
percentage- The usage percentage (0.0 to 1.0+).- Returns:
- The appropriate color for the usage bar.
-
getTheme
Returns a new theme object containing the color and font definitions for the UI.- Returns:
- The UI theme.
-

