Annotation Interface Schema


@Retention(RUNTIME) @Target({TYPE,FIELD,METHOD,PARAMETER}) public @interface Schema
Augment the schema used for an object when it is part of a tool argument or structured output.

All tools have an input schema derived from the types of its tool arguments. Tools with structured content also have an output schema derived from its return type. Generally the schema is created by looking at the structure of the types and how they are serialized by JSON-B. This annotation allows the created schema for a class to be overridden or augmented with a description.

This annotation can be placed:

  • on a Tool method to affect its output schema
  • on a ToolArg parameter to affect the input schema for that argument
  • on a class to affect the schema generated for that class
  • on a field, setter method or getter method to affect the schema generated for that property (overriding any schema that would have been generated from the type of that property)
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Augment the schema used for the annotated element with a description
    Override the schema used for the annotated element
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Field Details

  • Element Details

    • value

      String value
      Override the schema used for the annotated element
      Returns:
      the JSON schema for the annotated element
      Default:
      "<<unset>>"
    • description

      String description
      Augment the schema used for the annotated element with a description
      Returns:
      the description
      Default:
      "<<unset>>"