Class AbstractToolkit<T extends AbstractTool<?,?>>
java.lang.Object
uno.anahata.asi.agi.tool.spi.AbstractToolkit<T>
- Type Parameters:
T- The specific type of AbstractTool contained in this toolkit.
- Direct Known Subclasses:
JavaObjectToolkit
Represents a collection of related tools, parsed from a single Java class.
This is the core domain model for a "toolkit".
- Author:
- anahata-gemini-pro-2.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe default maximum depth policy for tools in this toolkit.protected StringA description of the toolkit's purpose.protected booleanWhether the toolkit is currently enabled.protected StringThe name of the toolkit.protected final @NonNull ToolManagerThe parent ToolManager that manages this toolkit. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractToolkit(@NonNull ToolManager toolManager) Constructs a new AbstractToolkit. -
Method Summary
Modifier and TypeMethodDescriptionGets a list of tools that are allowed to be presented to the model.Gets all tools declared within this toolkit, regardless of their permission status.abstract ContextProviderIf this toolkit provides additional context.Gets a list of tools that are allowed to be presented to the model.intCalculates the total token count of this toolkit on-the-fly by aggregating the cached token counts of all its contained tools.voidPerforms one-time setup after the toolkit is registered.voidPerforms logic after the session has been activated and bound to the environment.
-
Field Details
-
toolManager
The parent ToolManager that manages this toolkit. -
name
The name of the toolkit. -
description
A description of the toolkit's purpose. -
defaultMaxDepth
protected int defaultMaxDepthThe default maximum depth policy for tools in this toolkit. -
enabled
protected boolean enabledWhether the toolkit is currently enabled.
-
-
Constructor Details
-
AbstractToolkit
Constructs a new AbstractToolkit.- Parameters:
toolManager- The parent ToolManager.
-
-
Method Details
-
getAllTools
-
getAllowedTools
Gets a list of tools that are allowed to be presented to the model. This filters out tools that have a permanentToolPermission.DENYpermission and also returns an empty list if the entire toolkit is disabled.- Returns:
- A filtered list of allowed tools.
-
getDisabledTools
Gets a list of tools that are allowed to be presented to the model. This filters out tools that have a permanentToolPermission.DENYpermission and also returns an empty list if the entire toolkit is disabled.- Returns:
- A filtered list of allowed tools.
-
getTokenCount
public int getTokenCount()Calculates the total token count of this toolkit on-the-fly by aggregating the cached token counts of all its contained tools.- Returns:
- The total token count for the entire toolkit.
-
getContextProvider
If this toolkit provides additional context.- Returns:
- the context provider if any.
-
initialize
public void initialize()Performs one-time setup after the toolkit is registered. -
postActivate
public void postActivate()Performs logic after the session has been activated and bound to the environment. Subclasses should override this to perform one-time setup that requires the entire session graph to be available.
-

