Class TrainingAnnotation

java.lang.Object
io.agentscope.core.training.strategy.TrainingAnnotation

public class TrainingAnnotation extends Object
TrainingAnnotation represents a training annotation for an agent call.

It contains:

  • enabled: whether this call should be used for training
  • taskId: (optional) user-specified task ID for this request
  • labels: user-defined labels for categorizing training data
  • metadata: additional context information
  • timestamp: when this annotation was created
  • Method Details

    • isEnabled

      public boolean isEnabled()
    • getTaskId

      public String getTaskId()
    • getLabels

      public List<String> getLabels()
    • getMetadata

      public Map<String,Object> getMetadata()
    • getTimestamp

      public long getTimestamp()
    • isExpired

      public boolean isExpired(long ttlMillis)
      Check if this annotation has expired based on the given TTL.
      Parameters:
      ttlMillis - Time-to-live in milliseconds
      Returns:
      true if expired, false otherwise
    • enabled

      public static TrainingAnnotation enabled()
      Create a simple enabled annotation without labels or metadata.
    • withLabels

      public static TrainingAnnotation withLabels(String... labels)
      Create an enabled annotation with labels.
    • withLabelsAndMetadata

      public static TrainingAnnotation withLabelsAndMetadata(List<String> labels, Map<String,Object> metadata)
      Create an enabled annotation with labels and metadata.
    • builder

      public static TrainingAnnotation.Builder builder()
      Create a builder for TrainingAnnotation.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object