Class TrinityModelAdapter

java.lang.Object
io.agentscope.core.model.ChatModelBase
io.agentscope.core.training.backend.TrinityModelAdapter
All Implemented Interfaces:
io.agentscope.core.model.Model

public class TrinityModelAdapter extends io.agentscope.core.model.ChatModelBase
Trinity Model Adapter

Lightweight adapter using composition pattern to wrap OpenAIChatModel for:

  • Routing model calls to Trinity Chat API
  • Automatically collecting msg_ids and associating them with RunExecutionContext

Trinity's Chat API is fully compatible with OpenAI format, so OpenAIChatModel can be used directly. This adapter simply intercepts responses and collects msg_id (response.id) for subsequent feedback.

Automated design:

  • Internal component, created and managed by TrainingRouter
  • Automatically collects msg_ids to RunExecutionContext
  • Completely transparent to users
See Also:
  • Method Details

    • doStream

      protected reactor.core.publisher.Flux<io.agentscope.core.model.ChatResponse> doStream(List<io.agentscope.core.message.Msg> messages, List<io.agentscope.core.model.ToolSchema> tools, io.agentscope.core.model.GenerateOptions options)
      Specified by:
      doStream in class io.agentscope.core.model.ChatModelBase
    • getModelName

      public String getModelName()
    • getExecutionContext

      public RunExecutionContext getExecutionContext()
      Get task execution context
      Returns:
      Execution context (may be null)
    • builder

      public static TrinityModelAdapter.Builder builder()
      Create Builder