TrainingSelectionStrategy
@FunctionalInterface public interface TrainingSelectionStrategy
源码Source
io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:40–74定义 Training Selection Strategy契约的接口。位于 io.agentscope.core.training.strategy 包。核心成员包括 shouldSelect、priority、name。
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)
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public SelectionDecision shouldSelect(Agent agent, List<Msg> inputMessages, Msg outputMessage, ContextView reactorContext) | 执行应当选择相关操作。 Decide whether the current Agent call should be used for training |
default public int priority()default | 返回优先级。 Priority of the strategy (lower number means higher priority) |
default public String name()default | 返回名称。 Name of the strategy (for logging and debugging) |
方法详情Method Detail
shouldSelect
public SelectionDecision shouldSelect(Agent agent, List<Msg> inputMessages, Msg outputMessage, ContextView reactorContext)
执行应当选择相关操作。
Decide whether the current Agent call should be used for training
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。The Agent being called |
inputMessages | List<Msg> | 输入消息(类型 `List`)。Input message list |
outputMessage | Msg | 输出消息(类型 `Msg`)。Output message |
reactorContext | ContextView | reactor 上下文(类型 `ContextView`)。Reactor context (for async scenarios) |
SelectionDecision返回SelectionDecision。Selection decision result, including whether to train and related metadata
源码Source
io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:52–53priority
default public int priority()
default
返回优先级。
Priority of the strategy (lower number means higher priority) When multiple strategies are combined, higher priority strategies execute first
int返回数值结果。Priority value, defaults to 100
源码Source
io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:62–64name
default public String name()
default
返回名称。
Name of the strategy (for logging and debugging)
String返回字符串结果。Strategy name
源码Source
io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:71–73