forked from mistralai/client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobservabilityerror.py
More file actions
32 lines (26 loc) · 1008 Bytes
/
observabilityerror.py
File metadata and controls
32 lines (26 loc) · 1008 Bytes
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."""
# @generated-id: 4946ae06717e
from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from mistralai.client.errors import MistralError
from mistralai.client.models import (
observabilityerrordetail as models_observabilityerrordetail,
)
from mistralai.client.types import BaseModel
from typing import Optional
class ObservabilityErrorData(BaseModel):
detail: models_observabilityerrordetail.ObservabilityErrorDetail
@dataclass(unsafe_hash=True)
class ObservabilityError(MistralError):
data: ObservabilityErrorData = field(hash=False)
def __init__(
self,
data: ObservabilityErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.detail.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)