circuit-breaker-labs 1.0.4__py3-none-any.whl → 1.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.http_validation_error import HTTPValidationError
9
9
  from ...models.monthly_quota_response import MonthlyQuotaResponse
10
- from ...models.unauthorized_error import UnauthorizedError
10
+ from ...models.unauthorized_response import UnauthorizedResponse
11
11
  from ...types import Response
12
12
 
13
13
 
@@ -29,14 +29,14 @@ def _get_kwargs(
29
29
 
30
30
  def _parse_response(
31
31
  *, client: AuthenticatedClient | Client, response: httpx.Response
32
- ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError | None:
32
+ ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse | None:
33
33
  if response.status_code == 200:
34
34
  response_200 = MonthlyQuotaResponse.from_dict(response.json())
35
35
 
36
36
  return response_200
37
37
 
38
38
  if response.status_code == 401:
39
- response_401 = UnauthorizedError.from_dict(response.json())
39
+ response_401 = UnauthorizedResponse.from_dict(response.json())
40
40
 
41
41
  return response_401
42
42
 
@@ -53,7 +53,7 @@ def _parse_response(
53
53
 
54
54
  def _build_response(
55
55
  *, client: AuthenticatedClient | Client, response: httpx.Response
56
- ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError]:
56
+ ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse]:
57
57
  return Response(
58
58
  status_code=HTTPStatus(response.status_code),
59
59
  content=response.content,
@@ -66,7 +66,7 @@ def sync_detailed(
66
66
  *,
67
67
  client: AuthenticatedClient | Client,
68
68
  cbl_api_key: str,
69
- ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError]:
69
+ ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse]:
70
70
  """Monthly Quota
71
71
 
72
72
  Get the monthly usage statistics for the provided API key.
@@ -79,7 +79,7 @@ def sync_detailed(
79
79
  httpx.TimeoutException: If the request takes longer than Client.timeout.
80
80
 
81
81
  Returns:
82
- Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError]
82
+ Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse]
83
83
  """
84
84
 
85
85
  kwargs = _get_kwargs(
@@ -97,7 +97,7 @@ def sync(
97
97
  *,
98
98
  client: AuthenticatedClient | Client,
99
99
  cbl_api_key: str,
100
- ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError | None:
100
+ ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse | None:
101
101
  """Monthly Quota
102
102
 
103
103
  Get the monthly usage statistics for the provided API key.
@@ -110,7 +110,7 @@ def sync(
110
110
  httpx.TimeoutException: If the request takes longer than Client.timeout.
111
111
 
112
112
  Returns:
113
- HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError
113
+ HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse
114
114
  """
115
115
 
116
116
  return sync_detailed(
@@ -123,7 +123,7 @@ async def asyncio_detailed(
123
123
  *,
124
124
  client: AuthenticatedClient | Client,
125
125
  cbl_api_key: str,
126
- ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError]:
126
+ ) -> Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse]:
127
127
  """Monthly Quota
128
128
 
129
129
  Get the monthly usage statistics for the provided API key.
@@ -136,7 +136,7 @@ async def asyncio_detailed(
136
136
  httpx.TimeoutException: If the request takes longer than Client.timeout.
137
137
 
138
138
  Returns:
139
- Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError]
139
+ Response[HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse]
140
140
  """
141
141
 
142
142
  kwargs = _get_kwargs(
@@ -152,7 +152,7 @@ async def asyncio(
152
152
  *,
153
153
  client: AuthenticatedClient | Client,
154
154
  cbl_api_key: str,
155
- ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError | None:
155
+ ) -> HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse | None:
156
156
  """Monthly Quota
157
157
 
158
158
  Get the monthly usage statistics for the provided API key.
@@ -165,7 +165,7 @@ async def asyncio(
165
165
  httpx.TimeoutException: If the request takes longer than Client.timeout.
166
166
 
167
167
  Returns:
168
- HTTPValidationError | MonthlyQuotaResponse | UnauthorizedError
168
+ HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse
169
169
  """
170
170
 
171
171
  return (
@@ -7,9 +7,11 @@ from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.evaluate_open_ai_finetune_request import EvaluateOpenAiFinetuneRequest
9
9
  from ...models.http_validation_error import HTTPValidationError
10
- from ...models.quota_exceeded_error import QuotaExceededError
10
+ from ...models.internal_server_error_response import InternalServerErrorResponse
11
+ from ...models.not_found_response import NotFoundResponse
12
+ from ...models.quota_exceeded_response import QuotaExceededResponse
11
13
  from ...models.run_tests_response import RunTestsResponse
12
- from ...models.unauthorized_error import UnauthorizedError
14
+ from ...models.unauthorized_response import UnauthorizedResponse
13
15
  from ...types import Response
14
16
 
15
17
 
@@ -39,27 +41,45 @@ def _get_kwargs(
39
41
 
40
42
  def _parse_response(
41
43
  *, client: AuthenticatedClient | Client, response: httpx.Response
42
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
44
+ ) -> (
45
+ HTTPValidationError
46
+ | InternalServerErrorResponse
47
+ | NotFoundResponse
48
+ | QuotaExceededResponse
49
+ | RunTestsResponse
50
+ | UnauthorizedResponse
51
+ | None
52
+ ):
43
53
  if response.status_code == 200:
44
54
  response_200 = RunTestsResponse.from_dict(response.json())
45
55
 
46
56
  return response_200
47
57
 
48
58
  if response.status_code == 401:
49
- response_401 = UnauthorizedError.from_dict(response.json())
59
+ response_401 = UnauthorizedResponse.from_dict(response.json())
50
60
 
51
61
  return response_401
52
62
 
53
63
  if response.status_code == 403:
54
- response_403 = QuotaExceededError.from_dict(response.json())
64
+ response_403 = QuotaExceededResponse.from_dict(response.json())
55
65
 
56
66
  return response_403
57
67
 
68
+ if response.status_code == 404:
69
+ response_404 = NotFoundResponse.from_dict(response.json())
70
+
71
+ return response_404
72
+
58
73
  if response.status_code == 422:
59
74
  response_422 = HTTPValidationError.from_dict(response.json())
60
75
 
61
76
  return response_422
62
77
 
78
+ if response.status_code == 500:
79
+ response_500 = InternalServerErrorResponse.from_dict(response.json())
80
+
81
+ return response_500
82
+
63
83
  if client.raise_on_unexpected_status:
64
84
  raise errors.UnexpectedStatus(response.status_code, response.content)
65
85
  else:
@@ -68,7 +88,14 @@ def _parse_response(
68
88
 
69
89
  def _build_response(
70
90
  *, client: AuthenticatedClient | Client, response: httpx.Response
71
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
91
+ ) -> Response[
92
+ HTTPValidationError
93
+ | InternalServerErrorResponse
94
+ | NotFoundResponse
95
+ | QuotaExceededResponse
96
+ | RunTestsResponse
97
+ | UnauthorizedResponse
98
+ ]:
72
99
  return Response(
73
100
  status_code=HTTPStatus(response.status_code),
74
101
  content=response.content,
@@ -83,7 +110,14 @@ def sync_detailed(
83
110
  body: EvaluateOpenAiFinetuneRequest,
84
111
  cbl_api_key: str,
85
112
  openai_api_key: str,
86
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
113
+ ) -> Response[
114
+ HTTPValidationError
115
+ | InternalServerErrorResponse
116
+ | NotFoundResponse
117
+ | QuotaExceededResponse
118
+ | RunTestsResponse
119
+ | UnauthorizedResponse
120
+ ]:
87
121
  """Evaluate OpenAI Fine Tune
88
122
 
89
123
  Run agentic safety tests against an OpenAI fine-tuned model.
@@ -105,7 +139,7 @@ def sync_detailed(
105
139
  httpx.TimeoutException: If the request takes longer than Client.timeout.
106
140
 
107
141
  Returns:
108
- Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]
142
+ Response[HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse]
109
143
  """
110
144
 
111
145
  kwargs = _get_kwargs(
@@ -127,7 +161,15 @@ def sync(
127
161
  body: EvaluateOpenAiFinetuneRequest,
128
162
  cbl_api_key: str,
129
163
  openai_api_key: str,
130
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
164
+ ) -> (
165
+ HTTPValidationError
166
+ | InternalServerErrorResponse
167
+ | NotFoundResponse
168
+ | QuotaExceededResponse
169
+ | RunTestsResponse
170
+ | UnauthorizedResponse
171
+ | None
172
+ ):
131
173
  """Evaluate OpenAI Fine Tune
132
174
 
133
175
  Run agentic safety tests against an OpenAI fine-tuned model.
@@ -149,7 +191,7 @@ def sync(
149
191
  httpx.TimeoutException: If the request takes longer than Client.timeout.
150
192
 
151
193
  Returns:
152
- HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError
194
+ HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse
153
195
  """
154
196
 
155
197
  return sync_detailed(
@@ -166,7 +208,14 @@ async def asyncio_detailed(
166
208
  body: EvaluateOpenAiFinetuneRequest,
167
209
  cbl_api_key: str,
168
210
  openai_api_key: str,
169
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
211
+ ) -> Response[
212
+ HTTPValidationError
213
+ | InternalServerErrorResponse
214
+ | NotFoundResponse
215
+ | QuotaExceededResponse
216
+ | RunTestsResponse
217
+ | UnauthorizedResponse
218
+ ]:
170
219
  """Evaluate OpenAI Fine Tune
171
220
 
172
221
  Run agentic safety tests against an OpenAI fine-tuned model.
@@ -188,7 +237,7 @@ async def asyncio_detailed(
188
237
  httpx.TimeoutException: If the request takes longer than Client.timeout.
189
238
 
190
239
  Returns:
191
- Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]
240
+ Response[HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse]
192
241
  """
193
242
 
194
243
  kwargs = _get_kwargs(
@@ -208,7 +257,15 @@ async def asyncio(
208
257
  body: EvaluateOpenAiFinetuneRequest,
209
258
  cbl_api_key: str,
210
259
  openai_api_key: str,
211
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
260
+ ) -> (
261
+ HTTPValidationError
262
+ | InternalServerErrorResponse
263
+ | NotFoundResponse
264
+ | QuotaExceededResponse
265
+ | RunTestsResponse
266
+ | UnauthorizedResponse
267
+ | None
268
+ ):
212
269
  """Evaluate OpenAI Fine Tune
213
270
 
214
271
  Run agentic safety tests against an OpenAI fine-tuned model.
@@ -230,7 +287,7 @@ async def asyncio(
230
287
  httpx.TimeoutException: If the request takes longer than Client.timeout.
231
288
 
232
289
  Returns:
233
- HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError
290
+ HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse
234
291
  """
235
292
 
236
293
  return (
@@ -7,9 +7,11 @@ from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.evaluate_system_prompt_request import EvaluateSystemPromptRequest
9
9
  from ...models.http_validation_error import HTTPValidationError
10
- from ...models.quota_exceeded_error import QuotaExceededError
10
+ from ...models.internal_server_error_response import InternalServerErrorResponse
11
+ from ...models.not_found_response import NotFoundResponse
12
+ from ...models.quota_exceeded_response import QuotaExceededResponse
11
13
  from ...models.run_tests_response import RunTestsResponse
12
- from ...models.unauthorized_error import UnauthorizedError
14
+ from ...models.unauthorized_response import UnauthorizedResponse
13
15
  from ...types import Response
14
16
 
15
17
 
@@ -36,27 +38,45 @@ def _get_kwargs(
36
38
 
37
39
  def _parse_response(
38
40
  *, client: AuthenticatedClient | Client, response: httpx.Response
39
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
41
+ ) -> (
42
+ HTTPValidationError
43
+ | InternalServerErrorResponse
44
+ | NotFoundResponse
45
+ | QuotaExceededResponse
46
+ | RunTestsResponse
47
+ | UnauthorizedResponse
48
+ | None
49
+ ):
40
50
  if response.status_code == 200:
41
51
  response_200 = RunTestsResponse.from_dict(response.json())
42
52
 
43
53
  return response_200
44
54
 
45
55
  if response.status_code == 401:
46
- response_401 = UnauthorizedError.from_dict(response.json())
56
+ response_401 = UnauthorizedResponse.from_dict(response.json())
47
57
 
48
58
  return response_401
49
59
 
50
60
  if response.status_code == 403:
51
- response_403 = QuotaExceededError.from_dict(response.json())
61
+ response_403 = QuotaExceededResponse.from_dict(response.json())
52
62
 
53
63
  return response_403
54
64
 
65
+ if response.status_code == 404:
66
+ response_404 = NotFoundResponse.from_dict(response.json())
67
+
68
+ return response_404
69
+
55
70
  if response.status_code == 422:
56
71
  response_422 = HTTPValidationError.from_dict(response.json())
57
72
 
58
73
  return response_422
59
74
 
75
+ if response.status_code == 500:
76
+ response_500 = InternalServerErrorResponse.from_dict(response.json())
77
+
78
+ return response_500
79
+
60
80
  if client.raise_on_unexpected_status:
61
81
  raise errors.UnexpectedStatus(response.status_code, response.content)
62
82
  else:
@@ -65,7 +85,14 @@ def _parse_response(
65
85
 
66
86
  def _build_response(
67
87
  *, client: AuthenticatedClient | Client, response: httpx.Response
68
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
88
+ ) -> Response[
89
+ HTTPValidationError
90
+ | InternalServerErrorResponse
91
+ | NotFoundResponse
92
+ | QuotaExceededResponse
93
+ | RunTestsResponse
94
+ | UnauthorizedResponse
95
+ ]:
69
96
  return Response(
70
97
  status_code=HTTPStatus(response.status_code),
71
98
  content=response.content,
@@ -79,7 +106,14 @@ def sync_detailed(
79
106
  client: AuthenticatedClient | Client,
80
107
  body: EvaluateSystemPromptRequest,
81
108
  cbl_api_key: str,
82
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
109
+ ) -> Response[
110
+ HTTPValidationError
111
+ | InternalServerErrorResponse
112
+ | NotFoundResponse
113
+ | QuotaExceededResponse
114
+ | RunTestsResponse
115
+ | UnauthorizedResponse
116
+ ]:
83
117
  """Evaluate System Prompt
84
118
 
85
119
  Run agentic safety tests aginst a system prompt.
@@ -93,7 +127,7 @@ def sync_detailed(
93
127
  httpx.TimeoutException: If the request takes longer than Client.timeout.
94
128
 
95
129
  Returns:
96
- Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]
130
+ Response[HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse]
97
131
  """
98
132
 
99
133
  kwargs = _get_kwargs(
@@ -113,7 +147,15 @@ def sync(
113
147
  client: AuthenticatedClient | Client,
114
148
  body: EvaluateSystemPromptRequest,
115
149
  cbl_api_key: str,
116
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
150
+ ) -> (
151
+ HTTPValidationError
152
+ | InternalServerErrorResponse
153
+ | NotFoundResponse
154
+ | QuotaExceededResponse
155
+ | RunTestsResponse
156
+ | UnauthorizedResponse
157
+ | None
158
+ ):
117
159
  """Evaluate System Prompt
118
160
 
119
161
  Run agentic safety tests aginst a system prompt.
@@ -127,7 +169,7 @@ def sync(
127
169
  httpx.TimeoutException: If the request takes longer than Client.timeout.
128
170
 
129
171
  Returns:
130
- HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError
172
+ HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse
131
173
  """
132
174
 
133
175
  return sync_detailed(
@@ -142,7 +184,14 @@ async def asyncio_detailed(
142
184
  client: AuthenticatedClient | Client,
143
185
  body: EvaluateSystemPromptRequest,
144
186
  cbl_api_key: str,
145
- ) -> Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]:
187
+ ) -> Response[
188
+ HTTPValidationError
189
+ | InternalServerErrorResponse
190
+ | NotFoundResponse
191
+ | QuotaExceededResponse
192
+ | RunTestsResponse
193
+ | UnauthorizedResponse
194
+ ]:
146
195
  """Evaluate System Prompt
147
196
 
148
197
  Run agentic safety tests aginst a system prompt.
@@ -156,7 +205,7 @@ async def asyncio_detailed(
156
205
  httpx.TimeoutException: If the request takes longer than Client.timeout.
157
206
 
158
207
  Returns:
159
- Response[HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError]
208
+ Response[HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse]
160
209
  """
161
210
 
162
211
  kwargs = _get_kwargs(
@@ -174,7 +223,15 @@ async def asyncio(
174
223
  client: AuthenticatedClient | Client,
175
224
  body: EvaluateSystemPromptRequest,
176
225
  cbl_api_key: str,
177
- ) -> HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError | None:
226
+ ) -> (
227
+ HTTPValidationError
228
+ | InternalServerErrorResponse
229
+ | NotFoundResponse
230
+ | QuotaExceededResponse
231
+ | RunTestsResponse
232
+ | UnauthorizedResponse
233
+ | None
234
+ ):
178
235
  """Evaluate System Prompt
179
236
 
180
237
  Run agentic safety tests aginst a system prompt.
@@ -188,7 +245,7 @@ async def asyncio(
188
245
  httpx.TimeoutException: If the request takes longer than Client.timeout.
189
246
 
190
247
  Returns:
191
- HTTPValidationError | QuotaExceededError | RunTestsResponse | UnauthorizedError
248
+ HTTPValidationError | InternalServerErrorResponse | NotFoundResponse | QuotaExceededResponse | RunTestsResponse | UnauthorizedResponse
192
249
  """
193
250
 
194
251
  return (
@@ -4,11 +4,17 @@ from .evaluate_open_ai_finetune_request import EvaluateOpenAiFinetuneRequest
4
4
  from .evaluate_system_prompt_request import EvaluateSystemPromptRequest
5
5
  from .failed_test_result import FailedTestResult
6
6
  from .http_validation_error import HTTPValidationError
7
+ from .internal_server_error import InternalServerError
8
+ from .internal_server_error_response import InternalServerErrorResponse
7
9
  from .monthly_quota_response import MonthlyQuotaResponse
10
+ from .not_found_error import NotFoundError
11
+ from .not_found_response import NotFoundResponse
8
12
  from .ping_response import PingResponse
9
13
  from .quota_exceeded_error import QuotaExceededError
14
+ from .quota_exceeded_response import QuotaExceededResponse
10
15
  from .run_tests_response import RunTestsResponse
11
16
  from .unauthorized_error import UnauthorizedError
17
+ from .unauthorized_response import UnauthorizedResponse
12
18
  from .validate_api_key_response import ValidateApiKeyResponse
13
19
  from .validation_error import ValidationError
14
20
  from .version_response import VersionResponse
@@ -18,11 +24,17 @@ __all__ = (
18
24
  "EvaluateSystemPromptRequest",
19
25
  "FailedTestResult",
20
26
  "HTTPValidationError",
27
+ "InternalServerError",
28
+ "InternalServerErrorResponse",
21
29
  "MonthlyQuotaResponse",
30
+ "NotFoundError",
31
+ "NotFoundResponse",
22
32
  "PingResponse",
23
33
  "QuotaExceededError",
34
+ "QuotaExceededResponse",
24
35
  "RunTestsResponse",
25
36
  "UnauthorizedError",
37
+ "UnauthorizedResponse",
26
38
  "ValidateApiKeyResponse",
27
39
  "ValidationError",
28
40
  "VersionResponse",
@@ -0,0 +1,73 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..types import UNSET, Unset
10
+
11
+ T = TypeVar("T", bound="InternalServerError")
12
+
13
+
14
+ @_attrs_define
15
+ class InternalServerError:
16
+ """500 Internal Server Error response.
17
+
18
+ Attributes:
19
+ message (str):
20
+ error (str | Unset): Default: 'internal_server_error'.
21
+ """
22
+
23
+ message: str
24
+ error: str | Unset = "internal_server_error"
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ message = self.message
29
+
30
+ error = self.error
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "message": message,
37
+ }
38
+ )
39
+ if error is not UNSET:
40
+ field_dict["error"] = error
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
46
+ d = dict(src_dict)
47
+ message = d.pop("message")
48
+
49
+ error = d.pop("error", UNSET)
50
+
51
+ internal_server_error = cls(
52
+ message=message,
53
+ error=error,
54
+ )
55
+
56
+ internal_server_error.additional_properties = d
57
+ return internal_server_error
58
+
59
+ @property
60
+ def additional_keys(self) -> list[str]:
61
+ return list(self.additional_properties.keys())
62
+
63
+ def __getitem__(self, key: str) -> Any:
64
+ return self.additional_properties[key]
65
+
66
+ def __setitem__(self, key: str, value: Any) -> None:
67
+ self.additional_properties[key] = value
68
+
69
+ def __delitem__(self, key: str) -> None:
70
+ del self.additional_properties[key]
71
+
72
+ def __contains__(self, key: str) -> bool:
73
+ return key in self.additional_properties
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.internal_server_error import InternalServerError
11
+
12
+
13
+ T = TypeVar("T", bound="InternalServerErrorResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class InternalServerErrorResponse:
18
+ """500 Internal Server Error response wrapper.
19
+
20
+ Attributes:
21
+ detail (InternalServerError): 500 Internal Server Error response.
22
+ """
23
+
24
+ detail: InternalServerError
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+
29
+ detail = self.detail.to_dict()
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "detail": detail,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ @classmethod
42
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43
+ from ..models.internal_server_error import InternalServerError
44
+
45
+ d = dict(src_dict)
46
+ detail = InternalServerError.from_dict(d.pop("detail"))
47
+
48
+ internal_server_error_response = cls(
49
+ detail=detail,
50
+ )
51
+
52
+ internal_server_error_response.additional_properties = d
53
+ return internal_server_error_response
54
+
55
+ @property
56
+ def additional_keys(self) -> list[str]:
57
+ return list(self.additional_properties.keys())
58
+
59
+ def __getitem__(self, key: str) -> Any:
60
+ return self.additional_properties[key]
61
+
62
+ def __setitem__(self, key: str, value: Any) -> None:
63
+ self.additional_properties[key] = value
64
+
65
+ def __delitem__(self, key: str) -> None:
66
+ del self.additional_properties[key]
67
+
68
+ def __contains__(self, key: str) -> bool:
69
+ return key in self.additional_properties
@@ -0,0 +1,73 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ from ..types import UNSET, Unset
10
+
11
+ T = TypeVar("T", bound="NotFoundError")
12
+
13
+
14
+ @_attrs_define
15
+ class NotFoundError:
16
+ """404 Not Found error response.
17
+
18
+ Attributes:
19
+ message (str):
20
+ error (str | Unset): Default: 'not_found'.
21
+ """
22
+
23
+ message: str
24
+ error: str | Unset = "not_found"
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ message = self.message
29
+
30
+ error = self.error
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update(
35
+ {
36
+ "message": message,
37
+ }
38
+ )
39
+ if error is not UNSET:
40
+ field_dict["error"] = error
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
46
+ d = dict(src_dict)
47
+ message = d.pop("message")
48
+
49
+ error = d.pop("error", UNSET)
50
+
51
+ not_found_error = cls(
52
+ message=message,
53
+ error=error,
54
+ )
55
+
56
+ not_found_error.additional_properties = d
57
+ return not_found_error
58
+
59
+ @property
60
+ def additional_keys(self) -> list[str]:
61
+ return list(self.additional_properties.keys())
62
+
63
+ def __getitem__(self, key: str) -> Any:
64
+ return self.additional_properties[key]
65
+
66
+ def __setitem__(self, key: str, value: Any) -> None:
67
+ self.additional_properties[key] = value
68
+
69
+ def __delitem__(self, key: str) -> None:
70
+ del self.additional_properties[key]
71
+
72
+ def __contains__(self, key: str) -> bool:
73
+ return key in self.additional_properties
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.not_found_error import NotFoundError
11
+
12
+
13
+ T = TypeVar("T", bound="NotFoundResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class NotFoundResponse:
18
+ """404 Not Found response wrapper.
19
+
20
+ Attributes:
21
+ detail (NotFoundError): 404 Not Found error response.
22
+ """
23
+
24
+ detail: NotFoundError
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+
29
+ detail = self.detail.to_dict()
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "detail": detail,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ @classmethod
42
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43
+ from ..models.not_found_error import NotFoundError
44
+
45
+ d = dict(src_dict)
46
+ detail = NotFoundError.from_dict(d.pop("detail"))
47
+
48
+ not_found_response = cls(
49
+ detail=detail,
50
+ )
51
+
52
+ not_found_response.additional_properties = d
53
+ return not_found_response
54
+
55
+ @property
56
+ def additional_keys(self) -> list[str]:
57
+ return list(self.additional_properties.keys())
58
+
59
+ def __getitem__(self, key: str) -> Any:
60
+ return self.additional_properties[key]
61
+
62
+ def __setitem__(self, key: str, value: Any) -> None:
63
+ self.additional_properties[key] = value
64
+
65
+ def __delitem__(self, key: str) -> None:
66
+ del self.additional_properties[key]
67
+
68
+ def __contains__(self, key: str) -> bool:
69
+ return key in self.additional_properties
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.quota_exceeded_error import QuotaExceededError
11
+
12
+
13
+ T = TypeVar("T", bound="QuotaExceededResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class QuotaExceededResponse:
18
+ """403 Quota exceeded response wrapper.
19
+
20
+ Attributes:
21
+ detail (QuotaExceededError): 403 Forbidden error response for quota limits.
22
+ """
23
+
24
+ detail: QuotaExceededError
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+
29
+ detail = self.detail.to_dict()
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "detail": detail,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ @classmethod
42
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43
+ from ..models.quota_exceeded_error import QuotaExceededError
44
+
45
+ d = dict(src_dict)
46
+ detail = QuotaExceededError.from_dict(d.pop("detail"))
47
+
48
+ quota_exceeded_response = cls(
49
+ detail=detail,
50
+ )
51
+
52
+ quota_exceeded_response.additional_properties = d
53
+ return quota_exceeded_response
54
+
55
+ @property
56
+ def additional_keys(self) -> list[str]:
57
+ return list(self.additional_properties.keys())
58
+
59
+ def __getitem__(self, key: str) -> Any:
60
+ return self.additional_properties[key]
61
+
62
+ def __setitem__(self, key: str, value: Any) -> None:
63
+ self.additional_properties[key] = value
64
+
65
+ def __delitem__(self, key: str) -> None:
66
+ del self.additional_properties[key]
67
+
68
+ def __contains__(self, key: str) -> bool:
69
+ return key in self.additional_properties
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import TYPE_CHECKING, Any, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.unauthorized_error import UnauthorizedError
11
+
12
+
13
+ T = TypeVar("T", bound="UnauthorizedResponse")
14
+
15
+
16
+ @_attrs_define
17
+ class UnauthorizedResponse:
18
+ """401 Unauthorized response wrapper.
19
+
20
+ Attributes:
21
+ detail (UnauthorizedError): 401 Unauthorized error response.
22
+ """
23
+
24
+ detail: UnauthorizedError
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+
29
+ detail = self.detail.to_dict()
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "detail": detail,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ @classmethod
42
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
43
+ from ..models.unauthorized_error import UnauthorizedError
44
+
45
+ d = dict(src_dict)
46
+ detail = UnauthorizedError.from_dict(d.pop("detail"))
47
+
48
+ unauthorized_response = cls(
49
+ detail=detail,
50
+ )
51
+
52
+ unauthorized_response.additional_properties = d
53
+ return unauthorized_response
54
+
55
+ @property
56
+ def additional_keys(self) -> list[str]:
57
+ return list(self.additional_properties.keys())
58
+
59
+ def __getitem__(self, key: str) -> Any:
60
+ return self.additional_properties[key]
61
+
62
+ def __setitem__(self, key: str, value: Any) -> None:
63
+ self.additional_properties[key] = value
64
+
65
+ def __delitem__(self, key: str) -> None:
66
+ del self.additional_properties[key]
67
+
68
+ def __contains__(self, key: str) -> bool:
69
+ return key in self.additional_properties
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: circuit-breaker-labs
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: A client library for accessing Circuit Breaker Labs API
5
5
  Requires-Dist: httpx>=0.23.0,<0.29.0
6
6
  Requires-Dist: attrs>=22.2.0
@@ -13,7 +13,9 @@ Description-Content-Type: text/markdown
13
13
 
14
14
  ![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fcircuitbreakerlabs%2Fcircuitbreakerlabs-python%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&logo=python&logoColor=yellow&label=Python&color=blue)
15
15
  ![Ruff](https://img.shields.io/badge/Ruff-Check-34223D?logo=ruff)
16
- ![MyPy](https://img.shields.io/badge/Mypy-Check-blue?logo=python)
16
+ [![MyPy](https://img.shields.io/badge/Mypy-Check-blue?logo=python)](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/actions/workflows/type-checking.yml)
17
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
18
+ [![PyPI - Version](https://img.shields.io/pypi/v/circuit-breaker-labs?logo=pypi&label=PyPi)](https://pypi.org/project/circuit-breaker-labs/)
17
19
 
18
20
  <!-- prettier-ignore-start -->
19
21
  > [!Note]
@@ -21,6 +23,16 @@ Description-Content-Type: text/markdown
21
23
  > from [this OpenAPI spec](https://api.circuitbreakerlabs.ai/v1/openapi.json).
22
24
  <!-- prettier-ignore-end -->
23
25
 
26
+ ## Installation
27
+
28
+ Install from PyPi directly:
29
+
30
+ ```sh
31
+ uv pip install circuit-breaker-labs
32
+ ```
33
+
34
+ Or install using a wheel/sdist distributed with [each release](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/releases).
35
+
24
36
  ## Usage
25
37
 
26
38
  First, create a client:
@@ -1,31 +1,37 @@
1
1
  circuit_breaker_labs/__init__.py,sha256=i6esGzMquFSJYw6vIYraD2Eb80yxhIMV2Fl_CrqDsTA,167
2
2
  circuit_breaker_labs/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
3
3
  circuit_breaker_labs/api/api_keys/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
4
- circuit_breaker_labs/api/api_keys/monthly_quota_get.py,sha256=AK_8uuyFmPG7uH7_bpSVpBHvy-PWfoA3Rb_0Br4LZa0,4974
4
+ circuit_breaker_labs/api/api_keys/monthly_quota_get.py,sha256=5qtHjEomorCPzrUDQwpocnt_g1lfSS7wHFFdAANxgrg,5013
5
5
  circuit_breaker_labs/api/api_keys/validate_api_key_get.py,sha256=9ingxHucOQS3dPQxaNnxuv74t60EehY2xRZnrmuDNbk,4511
6
6
  circuit_breaker_labs/api/evaluations/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
7
- circuit_breaker_labs/api/evaluations/evaluate_openai_fine_tune_post.py,sha256=bfE8DDGUG9Q04Yi_zHxDvtx3Rmbe3qc8HpkQJwTCzeM,8233
8
- circuit_breaker_labs/api/evaluations/evaluate_system_prompt_post.py,sha256=uV6H12NMQs_09MYfnIcaikXG-UPhC4YoZNh19_e5mAs,5955
7
+ circuit_breaker_labs/api/evaluations/evaluate_openai_fine_tune_post.py,sha256=tnqdxToG6B_VhLnw5xYQLdP084q1rI49-x9pVfA29qE,9391
8
+ circuit_breaker_labs/api/evaluations/evaluate_system_prompt_post.py,sha256=xjKTnNUhd5i31QlV5Yj6nnU_mPcig-nMHiKOiT8Cx7M,7113
9
9
  circuit_breaker_labs/api/health_checks/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
10
10
  circuit_breaker_labs/api/health_checks/ping_get.py,sha256=zOacpnV1c_g_v3OKqXr2GqtNUzVpgQaVZPr2D9jB-s8,3343
11
11
  circuit_breaker_labs/api/health_checks/version_get.py,sha256=ykAbGhlVlOHajrsSQcd4bp0P34K7z16mKE_O3MstI3c,3293
12
12
  circuit_breaker_labs/client.py,sha256=-rT3epMc77Y7QMTy5o1oH5hkGLufY9qFrD1rb7qItFU,12384
13
13
  circuit_breaker_labs/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
14
- circuit_breaker_labs/models/__init__.py,sha256=IV4xmFlfJO9ajEHl__RsE7UJv_e7nKzHbCXWBIrd-nQ,1052
14
+ circuit_breaker_labs/models/__init__.py,sha256=nyC9e6i8Fy2-Exx_UJromrKnsLKzHw2leLzLNc69D3E,1550
15
15
  circuit_breaker_labs/models/evaluate_open_ai_finetune_request.py,sha256=0NaNytwUkjOCjWwOc8HT85FvAHueIgeJYnj-VHW6-4A,2549
16
16
  circuit_breaker_labs/models/evaluate_system_prompt_request.py,sha256=JiectdQ6h8aPShYjU8ZHfYZ4bo74rtTzIszXjqEQ1-M,2992
17
17
  circuit_breaker_labs/models/failed_test_result.py,sha256=QMrGPhG1c_yJai1pDsHYllMBDW5zgbmdZevHuI3O9H0,2257
18
18
  circuit_breaker_labs/models/http_validation_error.py,sha256=S2z4QBSSZFeQ23Xnlk-8u7H_I_EwewePiFJbSEKdSp0,2318
19
+ circuit_breaker_labs/models/internal_server_error.py,sha256=XjwdxWWYhIEn2aKrPuCXQivQOJ4QLqA-lRaDi2z4sBU,1892
20
+ circuit_breaker_labs/models/internal_server_error_response.py,sha256=EmHyRvXjagCVuUIdWr9DMDaCcVUyOiERU3BGrPa1TY4,1907
19
21
  circuit_breaker_labs/models/monthly_quota_response.py,sha256=QOCKISN1sSWXz4jlVGKme9CkJSqXw6VtukCYLc-gSpU,2069
22
+ circuit_breaker_labs/models/not_found_error.py,sha256=Anno3h5wOoRp0vYx7FSF4qaTtBXpAUm0INj9MbWvLrI,1832
23
+ circuit_breaker_labs/models/not_found_response.py,sha256=UyGZTcyabjJIRK2Mx3NRy_HkcL7Tgo40PY9fEcJ5Q44,1789
20
24
  circuit_breaker_labs/models/ping_response.py,sha256=DgbkCdzHn1HDQ53aG9VCVBr1kDTcfS6TdbO6PuIkIew,1916
21
25
  circuit_breaker_labs/models/quota_exceeded_error.py,sha256=M_JGaKG1pUFCEl-ZSrw8TeDjmNVA_5-ZchicLMFs2Sc,1884
26
+ circuit_breaker_labs/models/quota_exceeded_response.py,sha256=cGM-2vgb0XByFl01cviQMMSJRan8ndDgCMdVS_VQw50,1871
22
27
  circuit_breaker_labs/models/run_tests_response.py,sha256=wep2cG1GlnVCVH9U5fvm_NAz3mDDgLElMrxNyP4rMb0,3286
23
28
  circuit_breaker_labs/models/unauthorized_error.py,sha256=vIiMl68kdwOKIwCp6t0eLLmToHar5xKroVI8Z_KVfGQ,1858
29
+ circuit_breaker_labs/models/unauthorized_response.py,sha256=c1xQ9mtazPAW_LoTfZYNl7FmGSTSetiL7iw4B0JxuCo,1838
24
30
  circuit_breaker_labs/models/validate_api_key_response.py,sha256=dFWXa0Mc9sRJvI3CXHZ8A0samQQLc68MRPuJsW6AO2A,1580
25
31
  circuit_breaker_labs/models/validation_error.py,sha256=n8d_ZobQV26pm0KyDAKvIo93uOBhz2BH59jpJAKwoPY,2180
26
32
  circuit_breaker_labs/models/version_response.py,sha256=Ptaax1q1oTfbXfcC2ta6GtSNcUY38HCn7_oN1op1EYU,1535
27
33
  circuit_breaker_labs/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
28
34
  circuit_breaker_labs/types.py,sha256=0We4NPvhIYASRpQ3le41nmJeEAVm42-2VKdzlJ4Ogok,1343
29
- circuit_breaker_labs-1.0.4.dist-info/WHEEL,sha256=ePp19eyRASTHUPCpRsqjeFjsybXoCLYnd2O6QHdRRAY,79
30
- circuit_breaker_labs-1.0.4.dist-info/METADATA,sha256=j4U42IHxr40lvbhrw1hVDsMB8wopDSUqCpvToLLQ3E0,4436
31
- circuit_breaker_labs-1.0.4.dist-info/RECORD,,
35
+ circuit_breaker_labs-1.0.5.dist-info/WHEEL,sha256=z-mOpxbJHqy3cq6SvUThBZdaLGFZzdZPtgWLcP2NKjQ,79
36
+ circuit_breaker_labs-1.0.5.dist-info/METADATA,sha256=ngwXZgikqoI68DcDszcXwVyXcXm48AggSkn3wUt58X4,5063
37
+ circuit_breaker_labs-1.0.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.14
2
+ Generator: uv 0.9.15
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any