Hello all! Just wondering if the following could be implemented, introducing a validator in the ToolParam interface.


@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ToolParam {

    /**
     * Whether the tool argument is required.
     */
    boolean required() default true;

    /**
     * The description of the tool argument.
     */
    String description() default "";

    /**
     * The validator that should be called upon Tool invocation.
     */
    ContraintValidator validator();

}

Thanks for your awesome job!

Comment From: sunyuhan1998

Hi @jirou97 Can you expand on this a bit more? What scenarios would you like to realize with this validator? What exactly does it "validate" during a tool call?