Class JavaMethodToolParameter
java.lang.Object
uno.anahata.asi.agi.tool.spi.AbstractToolParameter<JavaMethodTool>
uno.anahata.asi.agi.tool.spi.java.JavaMethodToolParameter
A subclass of AbstractToolParameter that holds Java-specific reflection
information, namely the full generic Type of the parameter.
- Author:
- anahata-gemini-pro-2.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe index of this parameter in the method's parameter list.private TypeThe full Java reflection Type, preserving generics.Fields inherited from class AbstractToolParameter
tool -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateJavaMethodToolParameter(@NonNull JavaMethodTool tool, @NonNull String name, @NonNull String description, @NonNull String jsonSchema, boolean required, String rendererId, @NonNull Type javaType, int index) Private constructor for initializing a JavaMethodToolParameter. -
Method Summary
Modifier and TypeMethodDescriptionReturns the full Java reflection Type, restoring it lazily if necessary.static JavaMethodToolParameterof(JavaMethodTool tool, Parameter p, int index) The definitive factory method for creating a JavaMethodToolParameter from a reflection Parameter.Methods inherited from class AbstractToolParameter
getTokenCount
-
Field Details
-
javaType
The full Java reflection Type, preserving generics. -
index
private final int indexThe index of this parameter in the method's parameter list.
-
-
Constructor Details
-
JavaMethodToolParameter
private JavaMethodToolParameter(@NonNull @NonNull JavaMethodTool tool, @NonNull @NonNull String name, @NonNull @NonNull String description, @NonNull @NonNull String jsonSchema, boolean required, String rendererId, @NonNull @NonNull Type javaType, int index) Private constructor for initializing a JavaMethodToolParameter.- Parameters:
tool- The parent JavaMethodTool.name- The parameter name.description- A descriptive label/instruction for the parameter.jsonSchema- The raw OpenAPI 3 JSON schema.required- Whether this parameter is mandatory.rendererId- An optional custom renderer ID.javaType- The native Java reflection type.index- The parameter position.
-
-
Method Details
-
getJavaType
Returns the full Java reflection Type, restoring it lazily if necessary.- Returns:
- The parameter's Java type.
-
of
public static JavaMethodToolParameter of(JavaMethodTool tool, Parameter p, int index) throws Exception The definitive factory method for creating a JavaMethodToolParameter from a reflection Parameter. This method encapsulates all the logic for parsing annotations and generating the schema.- Parameters:
tool- The parent JavaMethodTool.p- The reflection Parameter to parse.index- The index of the parameter.- Returns:
- A new, fully configured JavaMethodToolParameter.
- Throws:
Exception- if schema generation fails.
-

