trinity.common.workflows.agentscope_workflow module#
- class trinity.common.workflows.agentscope_workflow.AgentScopeWorkflowAdapter(*, task: Task, model: ModelWrapper, auxiliary_models: List[ModelWrapper] | None = None)[源代码]#
基类:
WorkflowAdapter to wrap a agentscope trainable workflow function into a Trinity Workflow.
- is_async: bool = True#
- __init__(*, task: Task, model: ModelWrapper, auxiliary_models: List[ModelWrapper] | None = None)[源代码]#
Initialize the adapter with the task and model.
- construct_experiences(reward: float) List[Experience][源代码]#
Construct experiences from the agent's interaction history.
- 参数:
reward (float) -- The reward value to assign to each experience.
- 返回:
A list of Experience objects.
- 返回类型:
List
- async run_async() List[Experience][源代码]#
Run the workflow asynchronously and return experiences.
- class trinity.common.workflows.agentscope_workflow.AgentScopeWorkflowAdapterV1(*, task: Task, model: ModelWrapper, auxiliary_models: List[ModelWrapper] | None = None)[源代码]#
基类:
WorkflowA more general adapter to wrap agentscope trainable workflow and judge functions into a Trinity Workflow.
- is_async: bool = True#
- __init__(*, task: Task, model: ModelWrapper, auxiliary_models: List[ModelWrapper] | None = None)[源代码]#
Initialize the adapter with the task and model.
- construct_experiences(reward: float, metrics: Dict) List[Experience][源代码]#
Construct experiences from the agent's interaction history.
- 参数:
reward (float) -- The reward value to assign to each experience.
metrics (Dict) -- A dictionary of metrics to be attached to the last experience.
- 返回:
A list of Experience objects.
- 返回类型:
List
- async run_async() List[Experience][源代码]#
Run the workflow asynchronously and return experiences.