Class TrainingRouter
java.lang.Object
io.agentscope.core.training.runner.TrainingRouter
- All Implemented Interfaces:
io.agentscope.core.hook.Hook
Training Router Hook
Core training router Hook implementing shadow traffic training architecture with fully automated Task/Run ID management
Automation Flow:
- PreCallEvent: No modifications, let request execute normally
- PostCallEvent: Filter and judge, run shadow Agent asynchronously
- Auto-generate Task ID: Independent task identifier for each request
- Auto-allocate Run ID: Execution count for the same Task
- Shadow Agent: Replace model with TrinityModelAdapter
- Auto-collect msg_ids: Extract from Trinity API responses
- Calculate Reward: Based on shadow Agent execution results
- Submit Feedback: Batch submit all training data
Key Design:
- 100% requests use production model, ensuring service quality
- Sample portion of requests run shadow Agent asynchronously, no user impact
- Shadow Agent uses training model, collects training data
- Completely transparent to users: All IDs managed automatically
- See Also:
-
TaskIdGeneratorRunRegistryRunExecutionContext
-
Constructor Summary
ConstructorsConstructorDescriptionTrainingRouter(TrainingConfig config, TrinityClient trinityClient, RewardCalculator rewardCalculator, TrainingSelectionStrategy selectionStrategy) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.agentscope.core.hook.Hook
tools
-
Constructor Details
-
TrainingRouter
public TrainingRouter(TrainingConfig config, TrinityClient trinityClient, RewardCalculator rewardCalculator, TrainingSelectionStrategy selectionStrategy)
-
-
Method Details
-
onEvent
public <T extends io.agentscope.core.hook.HookEvent> reactor.core.publisher.Mono<T> onEvent(T event) - Specified by:
onEventin interfaceio.agentscope.core.hook.Hook
-
priority
public int priority()- Specified by:
priorityin interfaceio.agentscope.core.hook.Hook
-