Parameters for aborting the current turn
| 78 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 79 | @dataclass |
| 80 | class AbortRequest: |
| 81 | """Parameters for aborting the current turn""" |
| 82 | |
| 83 | reason: AbortReason | None = None |
| 84 | """Finite reason code describing why the current turn was aborted""" |
| 85 | |
| 86 | @staticmethod |
| 87 | def from_dict(obj: Any) -> 'AbortRequest': |
| 88 | assert isinstance(obj, dict) |
| 89 | reason = from_union([AbortReason, from_none], obj.get("reason")) |
| 90 | return AbortRequest(reason) |
| 91 | |
| 92 | def to_dict(self) -> dict: |
| 93 | result: dict = {} |
| 94 | if self.reason is not None: |
| 95 | result["reason"] = from_union([lambda x: to_enum(AbortReason, x), from_none], self.reason) |
| 96 | return result |
| 97 | |
| 98 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 99 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…