Result of aborting the current turn
| 98 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 99 | @dataclass |
| 100 | class AbortResult: |
| 101 | """Result of aborting the current turn""" |
| 102 | |
| 103 | success: bool |
| 104 | """Whether the abort completed successfully""" |
| 105 | |
| 106 | error: str | None = None |
| 107 | """Error message if the abort failed""" |
| 108 | |
| 109 | @staticmethod |
| 110 | def from_dict(obj: Any) -> 'AbortResult': |
| 111 | assert isinstance(obj, dict) |
| 112 | success = from_bool(obj.get("success")) |
| 113 | error = from_union([from_str, from_none], obj.get("error")) |
| 114 | return AbortResult(success, error) |
| 115 | |
| 116 | def to_dict(self) -> dict: |
| 117 | result: dict = {} |
| 118 | result["success"] = from_bool(self.success) |
| 119 | if self.error is not None: |
| 120 | result["error"] = from_union([from_str, from_none], self.error) |
| 121 | return result |
| 122 | |
| 123 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 124 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…