Class ExplicitMarkingStrategy
java.lang.Object
io.agentscope.core.training.strategy.ExplicitMarkingStrategy
- All Implemented Interfaces:
TrainingSelectionStrategy
Explicit Marking Strategy - Selection strategy based on user explicit marking
Training only occurs when user explicitly marks via TrainingContext
Usage example:
// Create strategy
TrainingSelectionStrategy strategy = ExplicitMarkingStrategy.create();
// Mark in user code
TrainingContext.markForTraining("high-quality");
agent.call(msg).block(); // This call will be trained
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExplicitMarkingStrategycreate()Create explicit marking strategyname()Name of the strategy (for logging and debugging)intpriority()Priority of the strategy (lower number means higher priority)shouldSelect(io.agentscope.core.agent.Agent agent, List<io.agentscope.core.message.Msg> inputMessages, io.agentscope.core.message.Msg outputMessage, reactor.util.context.ContextView reactorContext) Decide whether the current Agent call should be used for trainingstatic ExplicitMarkingStrategyCreate explicit marking strategy with specified TTL
-
Method Details
-
create
Create explicit marking strategy- Returns:
- Strategy instance
-
withTTL
Create explicit marking strategy with specified TTL- Parameters:
ttl- Validity period of marking- Returns:
- Strategy instance
-
shouldSelect
public SelectionDecision shouldSelect(io.agentscope.core.agent.Agent agent, List<io.agentscope.core.message.Msg> inputMessages, io.agentscope.core.message.Msg outputMessage, reactor.util.context.ContextView reactorContext) Description copied from interface:TrainingSelectionStrategyDecide whether the current Agent call should be used for training- Specified by:
shouldSelectin interfaceTrainingSelectionStrategy- Parameters:
agent- The Agent being calledinputMessages- Input message listoutputMessage- Output messagereactorContext- Reactor context (for async scenarios)- Returns:
- Selection decision result, including whether to train and related metadata
-
priority
public int priority()Description copied from interface:TrainingSelectionStrategyPriority of the strategy (lower number means higher priority)When multiple strategies are combined, higher priority strategies execute first
- Specified by:
priorityin interfaceTrainingSelectionStrategy- Returns:
- Priority value, defaults to 100
-
name
Description copied from interface:TrainingSelectionStrategyName of the strategy (for logging and debugging)- Specified by:
namein interfaceTrainingSelectionStrategy- Returns:
- Strategy name
-