Interface Annotations


@Immutable public interface Annotations
Optional metadata that clients can use to tailor how content is presented.

audience hints at the intended role (user/assistant), priority controls ordering, and lastModified carries an RFC-3339 timestamp of the last modification. All fields are null when absent — omit the annotation block entirely rather than sending empty values.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for Annotations.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable List<Role>
    Intended audience roles, or null when unrestricted.
    Creates a new builder.
    default void
    Validates that the priority is within the range from 0.0 to 1.0.
    @Nullable String
    RFC-3339 timestamp of the last modification, or null when unknown.
    of(@Nullable List<Role> audience, @Nullable Double priority, @Nullable String lastModified)
    Creates annotations with the given values.
    @Nullable Double
    Ordering hint in [0.0, 1.0], or null for default.
  • Method Details

    • audience

      @Nullable List<Role> audience()
      Intended audience roles, or null when unrestricted.
      Returns:
      the audience list, or null
    • priority

      @Nullable Double priority()
      Ordering hint in [0.0, 1.0], or null for default.
      Returns:
      the priority, or null
    • lastModified

      @Nullable String lastModified()
      RFC-3339 timestamp of the last modification, or null when unknown.
      Returns:
      the last-modified timestamp, or null
    • checkPriority

      @Check default void checkPriority()
      Validates that the priority is within the range from 0.0 to 1.0.
      Throws:
      IllegalArgumentException - if the priority is NaN or outside the range from 0.0 to 1.0
    • builder

      static Annotations.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
    • of

      static Annotations of(@Nullable List<Role> audience, @Nullable Double priority, @Nullable String lastModified)
      Creates annotations with the given values.
      Parameters:
      audience - intended audience roles, or null
      priority - ordering hint, or null
      lastModified - RFC-3339 timestamp, or null
      Returns:
      the new annotations