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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for TrinityModelAdapter -
Method Summary
Modifier and TypeMethodDescriptionstatic TrinityModelAdapter.Builderbuilder()Create Builderprotected 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) Get task execution contextMethods inherited from class io.agentscope.core.model.ChatModelBase
getContextWindowSize, setContextWindowSize, setNativeStructuredOutput, setNativeStructuredOutputWithTools, stream, supportsNativeStructuredOutput, supportsNativeStructuredOutputWithTools
-
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:
doStreamin classio.agentscope.core.model.ChatModelBase
-
getModelName
-
getExecutionContext
Get task execution context- Returns:
- Execution context (may be null)
-
builder
Create Builder
-