MCPcopy
hub / github.com/openai/openai-python / __init__

Method __init__

src/openai/_exceptions.py:67–80  ·  view source on GitHub ↗
(self, message: str, request: httpx.Request, *, body: object | None)

Source from the content-addressed store, hash-verified

65 type: Optional[str]
66
67 def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None:
68 super().__init__(message)
69 self.request = request
70 self.message = message
71 self.body = body
72
73 if is_dict(body):
74 self.code = cast(Any, construct_type(type_=Optional[str], value=body.get("code")))
75 self.param = cast(Any, construct_type(type_=Optional[str], value=body.get("param")))
76 self.type = cast(Any, construct_type(type_=str, value=body.get("type")))
77 else:
78 self.code = None
79 self.param = None
80 self.type = None
81
82
83class APIResponseValidationError(APIError):

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

construct_typeFunction · 0.85
is_dictFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected