Class AbstractToolParameter<T extends AbstractTool<?,?>>
java.lang.Object
uno.anahata.asi.agi.tool.spi.AbstractToolParameter<T>
- Type Parameters:
T- The type of the tool this parameter belongs to.
- Direct Known Subclasses:
BadToolParam, JavaMethodToolParameter
A rich, self-documenting, abstract representation of a single parameter for a tool method.
This is the base class for all tool parameters.
- Author:
- anahata-gemini-pro-2.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull StringA detailed description of the parameter's purpose and expected format.private final @NonNull StringA pre-generated, language-agnostic JSON schema for this parameter.private final @NonNull StringThe name of the parameter.private final StringAn optional identifier for a custom UI renderer for this parameter.private final booleanWhether this parameter is required for the tool call.protected final TThe tool this parameter belongs to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetTokenCount(AbstractModel model) Calculates the token count of this parameter on-the-fly using the active model's tokenizer.
-
Field Details
-
tool
The tool this parameter belongs to. -
name
The name of the parameter. -
description
A detailed description of the parameter's purpose and expected format. -
jsonSchema
A pre-generated, language-agnostic JSON schema for this parameter. -
required
private final boolean requiredWhether this parameter is required for the tool call. -
rendererId
An optional identifier for a custom UI renderer for this parameter.
-
-
Constructor Details
-
AbstractToolParameter
public AbstractToolParameter()
-
-
Method Details
-
getTokenCount
Calculates the token count of this parameter on-the-fly using the active model's tokenizer. The count is a provider-agnostic approximation of the token overhead, calculated by summing the tokens in its description and JSON schema.- Parameters:
model- The active model instance to use for tokenization.- Returns:
- The total token count.
-

