Class TrainingAnnotation
java.lang.Object
io.agentscope.core.training.strategy.TrainingAnnotation
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for TrainingAnnotation. -
Method Summary
Modifier and TypeMethodDescriptionstatic TrainingAnnotation.Builderbuilder()Create a builder for TrainingAnnotation.static TrainingAnnotationenabled()Create a simple enabled annotation without labels or metadata.booleanlonginthashCode()booleanbooleanisExpired(long ttlMillis) Check if this annotation has expired based on the given TTL.toString()static TrainingAnnotationwithLabels(String... labels) Create an enabled annotation with labels.static TrainingAnnotationCreate an enabled annotation with labels and metadata.
-
Method Details
-
isEnabled
public boolean isEnabled() -
getTaskId
-
getLabels
-
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
Create a simple enabled annotation without labels or metadata. -
withLabels
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
Create a builder for TrainingAnnotation. -
equals
-
hashCode
public int hashCode() -
toString
-