Annotation Interface ToolParam
Describes a parameter of a
Tool-annotated method. The name() and description() are surfaced to the model; required() controls whether the model must
supply a value.
Set name() explicitly: reflection only recovers parameter names when the
-parameters javac flag is enabled, and otherwise returns arg0, arg1, etc. —
which the model can't meaningfully use.
Example:
@Tool("Looks up the current weather for a city.")
public String getWeather(
@ToolParam(name = "city", description = "City name, e.g. 'Folsom'") String city,
@ToolParam(name = "units", description = "'metric' or 'imperial'", required = false)
String units) {
...
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionParameter description surfaced to the model.Parameter name surfaced to the model.booleanWhether the parameter is required.
-
Element Details
-
name
String nameParameter name surfaced to the model. Defaults to the reflected parameter name; set this explicitly unless the build passes-parametersto javac.- Default:
""
-
description
-
required
boolean requiredWhether the parameter is required. Defaults totrue.- Default:
true
-