@dataclass
class Result:
name: str
docstring: ResultDocstring
function_id: Optional[str] = None
@staticmethod
def from_json(json: Any, function_id: Optional[str] = None) -> Result:
return Result(
json["name"],
ResultDocstring.from_json(json.get("docstring", {})),
function_id,
)
def to_json(self) -> Any:
return {"name": self.name, "docstring": self.docstring.to_json()}
def __repr__(self) -> str:
return (
"Result(function_id=" + str(self.function_id) + ", name=" + self.name + ")"
)