Interface TrainingSelectionStrategy

All Known Implementing Classes:
ExplicitMarkingStrategy, SamplingRateStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TrainingSelectionStrategy
Training Selection Strategy - Training request filtering strategy

Unified interface for deciding which Agent requests should be used for training.

Supports multiple filtering methods:

  • Explicit marking - Users manually mark important requests
  • Random sampling - Randomly sample by probability
  • Combined strategy - Combination of multiple strategies (AND/OR)
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Name of the strategy (for logging and debugging)
    default int
    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 training
  • Method Details

    • shouldSelect

      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)
      Decide whether the current Agent call should be used for training
      Parameters:
      agent - The Agent being called
      inputMessages - Input message list
      outputMessage - Output message
      reactorContext - Reactor context (for async scenarios)
      Returns:
      Selection decision result, including whether to train and related metadata
    • priority

      default int priority()
      Priority of the strategy (lower number means higher priority)

      When multiple strategies are combined, higher priority strategies execute first

      Returns:
      Priority value, defaults to 100
    • name

      default String name()
      Name of the strategy (for logging and debugging)
      Returns:
      Strategy name