-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinternalservererror.py
More file actions
32 lines (25 loc) · 1.01 KB
/
internalservererror.py
File metadata and controls
32 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from agentset.errors import AgentsetError
from agentset.models import internalservererror as models_internalservererror
from agentset.types import BaseModel
from dataclasses import dataclass, field
import httpx
from typing import Optional
class InternalServerErrorData(BaseModel):
success: bool
error: models_internalservererror.InternalServerErrorError
@dataclass(unsafe_hash=True)
class InternalServerError(AgentsetError):
r"""The server has encountered a situation it does not know how to handle."""
data: InternalServerErrorData = field(hash=False)
def __init__(
self,
data: InternalServerErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.error.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)