Annotation Interface Tool


@Retention(RUNTIME) @Target(METHOD) public @interface Tool
Java methods annotated with @Tool are considered tools/functions that language model can execute/call. Tool/function calling LLM capability (e.g., see OpenAI function calling documentation) is used under the hood. A low-level ToolSpecification will be automatically created from the method signature (e.g. method name, method parameters (names and types), @Tool and @P annotations, etc.) and will be sent to the LLM. If LLM decides to call the tool, the arguments are automatically parsed and injected as method arguments.
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    Name of the tool.
    Description of the tool.
  • 元素详细资料

    • name

      String name
      Name of the tool. If not provided, method name will be used.
      返回:
      name of the tool.
      默认值:
      ""
    • value

      String[] value
      Description of the tool. It should be clear and descriptive to allow language model to understand the tool's purpose and its intended use.
      返回:
      description of the tool.
      默认值:
      {""}