Class TrainingRouter

java.lang.Object
io.agentscope.core.training.runner.TrainingRouter
All Implemented Interfaces:
io.agentscope.core.hook.Hook

public class TrainingRouter extends Object implements 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:

  1. PreCallEvent: No modifications, let request execute normally
  2. PostCallEvent: Filter and judge, run shadow Agent asynchronously
  3. Auto-generate Task ID: Independent task identifier for each request
  4. Auto-allocate Run ID: Execution count for the same Task
  5. Shadow Agent: Replace model with TrinityModelAdapter
  6. Auto-collect msg_ids: Extract from Trinity API responses
  7. Calculate Reward: Based on shadow Agent execution results
  8. 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:
  • Constructor Details

  • Method Details

    • onEvent

      public <T extends io.agentscope.core.hook.HookEvent> reactor.core.publisher.Mono<T> onEvent(T event)
      Specified by:
      onEvent in interface io.agentscope.core.hook.Hook
    • priority

      public int priority()
      Specified by:
      priority in interface io.agentscope.core.hook.Hook