AS AgentScopeAPI 手册 / API Reference

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
agentAgent智能体(类型 `Agent`)。The Agent being called
inputMessagesList<Msg>输入消息(类型 `List`)。Input message list
outputMessageMsg输出消息(类型 `Msg`)。Output message
reactorContextContextViewreactor 上下文(类型 `ContextView`)。Reactor context (for async scenarios)
返回Returns SelectionDecision
返回SelectionDecision。Selection decision result, including whether to train and related metadata
源码Source io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:52–53

priority

default public int priority()
default

返回优先级。

Priority of the strategy (lower number means higher priority) When multiple strategies are combined, higher priority strategies execute first

返回Returns int
返回数值结果。Priority value, defaults to 100
源码Source io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:62–64

name

default public String name()
default

返回名称。

Name of the strategy (for logging and debugging)

返回Returns String
返回字符串结果。Strategy name
源码Source io/agentscope/core/training/strategy/TrainingSelectionStrategy.java:71–73
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.