Annotation Type Prompt


@Retention(RUNTIME) @Target(METHOD) public @interface Prompt
Annotation to mark a method as a prompt within the AI provider framework.

Methods annotated with @Prompt are recognized as prompt definitions, typically used for dynamic invocation, prompt cataloging, or role-based message handling. The annotation provides metadata such as the prompt's name, description, and associated role.

  • name: Optional prompt name. If not specified, NOT_DEFINED is used as a placeholder.
  • description: Required description of the prompt's purpose and content.
  • role: The participant role associated with the prompt (default: Role.ASSISTANT).

The annotation is retained at runtime and applicable to methods only.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Description of the prompt's purpose and content.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional prompt name.
    The participant role associated with the prompt.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Placeholder value indicating that the prompt name is not defined.
  • Field Details

    • NOT_DEFINED

      static final String NOT_DEFINED
      Placeholder value indicating that the prompt name is not defined.
      See Also:
  • Element Details

    • name

      String name
      Optional prompt name. If not specified, NOT_DEFINED is used.
      Returns:
      the name of the prompt, or NOT_DEFINED if not set
      Default:
      "___NOT_DEFINED___"
    • description

      String description
      Description of the prompt's purpose and content.
      Returns:
      the prompt description
    • role

      Role role
      The participant role associated with the prompt. Defaults to Role.ASSISTANT.
      Returns:
      the role for the prompt
      Default:
      ASSISTANT