Annotation Interface CopilotToolParam
@Documented
@Retention(RUNTIME)
@Target(PARAMETER)
@CopilotExperimental
public @interface CopilotToolParam
Annotates a parameter of a
CopilotTool-annotated method to provide
metadata about the parameter that is sent to the model.
Example usage:
@CopilotTool("Search for issues")
public CompletableFuture<String> searchIssues(
@CopilotToolParam(value = "Search query", required = true) String query,
@CopilotToolParam(value = "Max results", required = false, defaultValue = "10") int limit) {
// ...
}
- Since:
- 1.0.2
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionOptional default value when the argument is omitted.Parameter name override.booleanWhether this parameter is required.Optional explicit JSON Schema for this parameter as a JSON string literal.Parameter description (sent to the model).
-
Element Details
-
value
-
name
-
required
boolean requiredWhether this parameter is required. Default true.- Default:
true
-
defaultValue
-
schema
String schemaOptional explicit JSON Schema for this parameter as a JSON string literal. When non-empty, bypasses automatic schema generation from the parameter type. The value must be a valid JSON object string.Example:
@CopilotTool("Schedule meeting") public String schedule( @CopilotToolParam(value = "When to meet", schema = "{\"type\":\"string\",\"format\":\"date-time\"}") MyCustomDateTime when) { // ... }- Default:
""
-