# -*- coding: utf-8 -*-"""Solution class for evaluation tasks."""fromdataclassesimportdataclass,fieldfromtypingimportAnyfrom..messageimport(ToolResultBlock,ToolUseBlock,TextBlock,)from..types._jsonimportJSONSerializableObjectfrom.._utils._mixinimportDictMixin
[文档]@dataclassclassSolutionOutput(DictMixin):"""The output of a solution in evaluation task"""success:bool"""Indicates whether the solution is executed successfully. When the solution raise exception, this should be set to False."""output:JSONSerializableObject"""The final output of the solution."""trajectory:list[ToolUseBlock|ToolResultBlock|TextBlock]"""The tool calls and results trajectory"""meta:dict[str,Any]|None=field(default_factory=lambda:None)"""Additional metadata for the solution"""def__getstate__(self)->dict[str,Any]:"""Custom pickling to handle dataclass + DictMixin inheritance."""returnself.__dict__.copy()def__setstate__(self,state:dict[str,Any])->None:"""Custom unpickling to handle dataclass + DictMixin inheritance."""self.__dict__.update(state)