Annotation Type Resource


@Retention(RUNTIME) @Target(METHOD) public @interface Resource
Annotation used to declare a method as an executable resource provider within the generative-AI tools system.

Resource-annotated methods return raw configurations, schemas, or instructional assets (such as system guidelines or validation layouts) mapped to one or more URIs. The generative-AI provider uses these declarations to dynamically load context documents or schemas during generation processes.

Usage Example

Since:
1.2.0
Author:
Viktor Tovstyi
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Description of the resource's purpose, structure, or content.
    One or more unique URIs associated with this resource.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The MIME type of the resource content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Placeholder value indicating that a property is not defined.
  • Field Details

    • NOT_DEFINED

      static final String NOT_DEFINED
      Placeholder value indicating that a property is not defined.
      See Also:
  • Element Details

    • description

      String description
      Description of the resource's purpose, structure, or content.

      This metadata is shared with the generative-AI provider to help determine when and why this resource should be loaded.

      Returns:
      the resource description
    • uri

      String[] uri
      One or more unique URIs associated with this resource.

      The URIs serve as the primary identifiers (e.g., "file:///schemas/bindex.json") used by generative models to request and locate the resource content.

      Returns:
      an array of URIs mapping to this resource
    • mimeType

      String mimeType
      The MIME type of the resource content.

      Defaults to NOT_DEFINED. Providing a specific MIME type (such as "application/json" or "text/markdown") helps the AI provider process and parse the returning payload correctly.

      Returns:
      the MIME type of the resource, or NOT_DEFINED if unspecified
      Default:
      "___NOT_DEFINED___"