circuit-breaker-labs 1.0.4__tar.gz → 1.0.6__tar.gz
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.
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/PKG-INFO +33 -21
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/README.md +32 -20
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/api_keys/monthly_quota_get.py +12 -12
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/api/evaluations/evaluate_system_prompt_post.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/api/evaluations/multi_turn_evaluate_system_prompt_post.py +96 -39
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/api/evaluations/evaluate_openai_fine_tune_post.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/api/evaluations/multiturn_evaluate_openai_fine_tune_post.py +96 -39
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/api/evaluations/single_turn_evaluate_openai_fine_tune_post.py +300 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/api/evaluations/singleturn_evaluate_system_prompt_post.py +257 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/__init__.py +57 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/internal_server_error.py +73 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/internal_server_error_response.py +69 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/message.py +71 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/multi_turn_evaluate_open_ai_finetune_request.py +119 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/multi_turn_evaluate_system_prompt_request.py +128 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/multi_turn_failed_test_result.py +85 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/multi_turn_run_tests_response.py +92 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/multi_turn_test_type.py +9 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/not_found_error.py +73 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/not_found_response.py +69 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/quota_exceeded_response.py +69 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/role.py +10 -0
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/models/evaluate_open_ai_finetune_request.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/single_turn_evaluate_open_ai_finetune_request.py +30 -5
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/models/evaluate_system_prompt_request.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/single_turn_evaluate_system_prompt_request.py +30 -5
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/models/failed_test_result.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/single_turn_failed_test_result.py +5 -5
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/models/run_tests_response.py → circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/single_turn_run_tests_response.py +10 -10
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/test_case_pack.py +8 -0
- circuit_breaker_labs-1.0.6/circuit_breaker_labs/models/unauthorized_response.py +69 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/pyproject.toml +1 -1
- circuit_breaker_labs-1.0.4/circuit_breaker_labs/models/__init__.py +0 -29
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/__init__.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/__init__.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/api_keys/__init__.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/api_keys/validate_api_key_get.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/evaluations/__init__.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/health_checks/__init__.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/health_checks/ping_get.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/api/health_checks/version_get.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/client.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/errors.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/http_validation_error.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/monthly_quota_response.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/ping_response.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/quota_exceeded_error.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/unauthorized_error.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/validate_api_key_response.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/validation_error.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/models/version_response.py +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/py.typed +0 -0
- {circuit_breaker_labs-1.0.4 → circuit_breaker_labs-1.0.6}/circuit_breaker_labs/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: circuit-breaker-labs
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
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,14 +13,26 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
|
|
14
14
|

|
|
15
15
|

|
|
16
|
-

|
|
16
|
+
[](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/actions/workflows/type-checking.yml)
|
|
17
|
+
[](https://github.com/astral-sh/uv)
|
|
18
|
+
[](https://pypi.org/project/circuit-breaker-labs/)
|
|
17
19
|
|
|
18
20
|
<!-- prettier-ignore-start -->
|
|
19
21
|
> [!Note]
|
|
20
22
|
> This project was automatically generated by [OpenAPI Python Client](https://github.com/openapi-generators/openapi-python-client)
|
|
21
|
-
> from [this OpenAPI spec](https://
|
|
23
|
+
> from [this OpenAPI spec](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/blob/main/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:
|
|
@@ -36,19 +48,19 @@ Now build a request and use it when calling an endpoint
|
|
|
36
48
|
```python
|
|
37
49
|
import os
|
|
38
50
|
|
|
39
|
-
from circuit_breaker_labs.api.evaluations import
|
|
40
|
-
from circuit_breaker_labs.models import
|
|
51
|
+
from circuit_breaker_labs.api.evaluations import singleturn_evaluate_system_prompt_post
|
|
52
|
+
from circuit_breaker_labs.models import SingleTurnEvaluateSystemPromptRequest
|
|
41
53
|
|
|
42
54
|
with client as client:
|
|
43
|
-
request =
|
|
44
|
-
0.5,
|
|
45
|
-
3,
|
|
46
|
-
2,
|
|
47
|
-
os.getenv("SYSTEM_PROMPT"),
|
|
48
|
-
"anthropic/claude-3.7-sonnet",
|
|
55
|
+
request = SingleTurnEvaluateSystemPromptRequest(
|
|
56
|
+
threshold=0.5,
|
|
57
|
+
variations=3,
|
|
58
|
+
maximum_iteration_layers=2,
|
|
59
|
+
system_prompt=os.getenv("SYSTEM_PROMPT"),
|
|
60
|
+
openrouter_model_name="anthropic/claude-3.7-sonnet",
|
|
49
61
|
)
|
|
50
62
|
|
|
51
|
-
run_tests_response =
|
|
63
|
+
run_tests_response = singleturn_evaluate_system_prompt_post.sync(
|
|
52
64
|
client=client,
|
|
53
65
|
cbl_api_key=os.getenv("CBL_API_KEY"),
|
|
54
66
|
body=request,
|
|
@@ -60,19 +72,19 @@ Or do the same thing with an async version:
|
|
|
60
72
|
```python
|
|
61
73
|
import os
|
|
62
74
|
|
|
63
|
-
from circuit_breaker_labs.api.evaluations import
|
|
64
|
-
from circuit_breaker_labs.models import
|
|
75
|
+
from circuit_breaker_labs.api.evaluations import singleturn_evaluate_system_prompt_post
|
|
76
|
+
from circuit_breaker_labs.models import SingleTurnEvaluateSystemPromptRequest
|
|
65
77
|
|
|
66
78
|
async with client as client:
|
|
67
|
-
request =
|
|
68
|
-
0.5,
|
|
69
|
-
3,
|
|
70
|
-
2,
|
|
71
|
-
os.getenv("SYSTEM_PROMPT"),
|
|
72
|
-
"anthropic/claude-3.7-sonnet",
|
|
79
|
+
request = SingleTurnEvaluateSystemPromptRequest(
|
|
80
|
+
threshold=0.5,
|
|
81
|
+
variations=3,
|
|
82
|
+
maximum_iteration_layers=2,
|
|
83
|
+
system_prompt=os.getenv("SYSTEM_PROMPT"),
|
|
84
|
+
openrouter_model_name="anthropic/claude-3.7-sonnet",
|
|
73
85
|
)
|
|
74
86
|
|
|
75
|
-
run_tests_response =
|
|
87
|
+
run_tests_response = await singleturn_evaluate_system_prompt_post.asyncio(
|
|
76
88
|
client=client,
|
|
77
89
|
cbl_api_key=os.getenv("CBL_API_KEY"),
|
|
78
90
|
body=request,
|
|
@@ -2,14 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
5
|
+
[](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/actions/workflows/type-checking.yml)
|
|
6
|
+
[](https://github.com/astral-sh/uv)
|
|
7
|
+
[](https://pypi.org/project/circuit-breaker-labs/)
|
|
6
8
|
|
|
7
9
|
<!-- prettier-ignore-start -->
|
|
8
10
|
> [!Note]
|
|
9
11
|
> This project was automatically generated by [OpenAPI Python Client](https://github.com/openapi-generators/openapi-python-client)
|
|
10
|
-
> from [this OpenAPI spec](https://
|
|
12
|
+
> from [this OpenAPI spec](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/blob/main/openapi.json).
|
|
11
13
|
<!-- prettier-ignore-end -->
|
|
12
14
|
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Install from PyPi directly:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
uv pip install circuit-breaker-labs
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or install using a wheel/sdist distributed with [each release](https://github.com/circuitbreakerlabs/circuitbreakerlabs-python/releases).
|
|
24
|
+
|
|
13
25
|
## Usage
|
|
14
26
|
|
|
15
27
|
First, create a client:
|
|
@@ -25,19 +37,19 @@ Now build a request and use it when calling an endpoint
|
|
|
25
37
|
```python
|
|
26
38
|
import os
|
|
27
39
|
|
|
28
|
-
from circuit_breaker_labs.api.evaluations import
|
|
29
|
-
from circuit_breaker_labs.models import
|
|
40
|
+
from circuit_breaker_labs.api.evaluations import singleturn_evaluate_system_prompt_post
|
|
41
|
+
from circuit_breaker_labs.models import SingleTurnEvaluateSystemPromptRequest
|
|
30
42
|
|
|
31
43
|
with client as client:
|
|
32
|
-
request =
|
|
33
|
-
0.5,
|
|
34
|
-
3,
|
|
35
|
-
2,
|
|
36
|
-
os.getenv("SYSTEM_PROMPT"),
|
|
37
|
-
"anthropic/claude-3.7-sonnet",
|
|
44
|
+
request = SingleTurnEvaluateSystemPromptRequest(
|
|
45
|
+
threshold=0.5,
|
|
46
|
+
variations=3,
|
|
47
|
+
maximum_iteration_layers=2,
|
|
48
|
+
system_prompt=os.getenv("SYSTEM_PROMPT"),
|
|
49
|
+
openrouter_model_name="anthropic/claude-3.7-sonnet",
|
|
38
50
|
)
|
|
39
51
|
|
|
40
|
-
run_tests_response =
|
|
52
|
+
run_tests_response = singleturn_evaluate_system_prompt_post.sync(
|
|
41
53
|
client=client,
|
|
42
54
|
cbl_api_key=os.getenv("CBL_API_KEY"),
|
|
43
55
|
body=request,
|
|
@@ -49,19 +61,19 @@ Or do the same thing with an async version:
|
|
|
49
61
|
```python
|
|
50
62
|
import os
|
|
51
63
|
|
|
52
|
-
from circuit_breaker_labs.api.evaluations import
|
|
53
|
-
from circuit_breaker_labs.models import
|
|
64
|
+
from circuit_breaker_labs.api.evaluations import singleturn_evaluate_system_prompt_post
|
|
65
|
+
from circuit_breaker_labs.models import SingleTurnEvaluateSystemPromptRequest
|
|
54
66
|
|
|
55
67
|
async with client as client:
|
|
56
|
-
request =
|
|
57
|
-
0.5,
|
|
58
|
-
3,
|
|
59
|
-
2,
|
|
60
|
-
os.getenv("SYSTEM_PROMPT"),
|
|
61
|
-
"anthropic/claude-3.7-sonnet",
|
|
68
|
+
request = SingleTurnEvaluateSystemPromptRequest(
|
|
69
|
+
threshold=0.5,
|
|
70
|
+
variations=3,
|
|
71
|
+
maximum_iteration_layers=2,
|
|
72
|
+
system_prompt=os.getenv("SYSTEM_PROMPT"),
|
|
73
|
+
openrouter_model_name="anthropic/claude-3.7-sonnet",
|
|
62
74
|
)
|
|
63
75
|
|
|
64
|
-
run_tests_response =
|
|
76
|
+
run_tests_response = await singleturn_evaluate_system_prompt_post.asyncio(
|
|
65
77
|
client=client,
|
|
66
78
|
cbl_api_key=os.getenv("CBL_API_KEY"),
|
|
67
79
|
body=request,
|
|
@@ -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.
|
|
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 |
|
|
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 =
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
168
|
+
HTTPValidationError | MonthlyQuotaResponse | UnauthorizedResponse
|
|
169
169
|
"""
|
|
170
170
|
|
|
171
171
|
return (
|
|
@@ -5,17 +5,19 @@ import httpx
|
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
|
-
from ...models.evaluate_system_prompt_request import EvaluateSystemPromptRequest
|
|
9
8
|
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
-
from ...models.
|
|
11
|
-
from ...models.
|
|
12
|
-
from ...models.
|
|
9
|
+
from ...models.internal_server_error_response import InternalServerErrorResponse
|
|
10
|
+
from ...models.multi_turn_evaluate_system_prompt_request import MultiTurnEvaluateSystemPromptRequest
|
|
11
|
+
from ...models.multi_turn_run_tests_response import MultiTurnRunTestsResponse
|
|
12
|
+
from ...models.not_found_response import NotFoundResponse
|
|
13
|
+
from ...models.quota_exceeded_response import QuotaExceededResponse
|
|
14
|
+
from ...models.unauthorized_response import UnauthorizedResponse
|
|
13
15
|
from ...types import Response
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
def _get_kwargs(
|
|
17
19
|
*,
|
|
18
|
-
body:
|
|
20
|
+
body: MultiTurnEvaluateSystemPromptRequest,
|
|
19
21
|
cbl_api_key: str,
|
|
20
22
|
) -> dict[str, Any]:
|
|
21
23
|
headers: dict[str, Any] = {}
|
|
@@ -23,7 +25,7 @@ def _get_kwargs(
|
|
|
23
25
|
|
|
24
26
|
_kwargs: dict[str, Any] = {
|
|
25
27
|
"method": "post",
|
|
26
|
-
"url": "/
|
|
28
|
+
"url": "/multiturn_evaluate_system_prompt",
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
_kwargs["json"] = body.to_dict()
|
|
@@ -36,27 +38,45 @@ def _get_kwargs(
|
|
|
36
38
|
|
|
37
39
|
def _parse_response(
|
|
38
40
|
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
39
|
-
) ->
|
|
41
|
+
) -> (
|
|
42
|
+
HTTPValidationError
|
|
43
|
+
| InternalServerErrorResponse
|
|
44
|
+
| MultiTurnRunTestsResponse
|
|
45
|
+
| NotFoundResponse
|
|
46
|
+
| QuotaExceededResponse
|
|
47
|
+
| UnauthorizedResponse
|
|
48
|
+
| None
|
|
49
|
+
):
|
|
40
50
|
if response.status_code == 200:
|
|
41
|
-
response_200 =
|
|
51
|
+
response_200 = MultiTurnRunTestsResponse.from_dict(response.json())
|
|
42
52
|
|
|
43
53
|
return response_200
|
|
44
54
|
|
|
45
55
|
if response.status_code == 401:
|
|
46
|
-
response_401 =
|
|
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 =
|
|
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[
|
|
88
|
+
) -> Response[
|
|
89
|
+
HTTPValidationError
|
|
90
|
+
| InternalServerErrorResponse
|
|
91
|
+
| MultiTurnRunTestsResponse
|
|
92
|
+
| NotFoundResponse
|
|
93
|
+
| QuotaExceededResponse
|
|
94
|
+
| UnauthorizedResponse
|
|
95
|
+
]:
|
|
69
96
|
return Response(
|
|
70
97
|
status_code=HTTPStatus(response.status_code),
|
|
71
98
|
content=response.content,
|
|
@@ -77,23 +104,30 @@ def _build_response(
|
|
|
77
104
|
def sync_detailed(
|
|
78
105
|
*,
|
|
79
106
|
client: AuthenticatedClient | Client,
|
|
80
|
-
body:
|
|
107
|
+
body: MultiTurnEvaluateSystemPromptRequest,
|
|
81
108
|
cbl_api_key: str,
|
|
82
|
-
) -> Response[
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
109
|
+
) -> Response[
|
|
110
|
+
HTTPValidationError
|
|
111
|
+
| InternalServerErrorResponse
|
|
112
|
+
| MultiTurnRunTestsResponse
|
|
113
|
+
| NotFoundResponse
|
|
114
|
+
| QuotaExceededResponse
|
|
115
|
+
| UnauthorizedResponse
|
|
116
|
+
]:
|
|
117
|
+
"""Multi-turn Evaluate System Prompt
|
|
118
|
+
|
|
119
|
+
Run multi-turn safety tests against a system prompt.
|
|
86
120
|
|
|
87
121
|
Args:
|
|
88
122
|
cbl_api_key (str): Circuit Breaker Labs API Key
|
|
89
|
-
body (
|
|
123
|
+
body (MultiTurnEvaluateSystemPromptRequest):
|
|
90
124
|
|
|
91
125
|
Raises:
|
|
92
126
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
93
127
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
94
128
|
|
|
95
129
|
Returns:
|
|
96
|
-
Response[HTTPValidationError |
|
|
130
|
+
Response[HTTPValidationError | InternalServerErrorResponse | MultiTurnRunTestsResponse | NotFoundResponse | QuotaExceededResponse | UnauthorizedResponse]
|
|
97
131
|
"""
|
|
98
132
|
|
|
99
133
|
kwargs = _get_kwargs(
|
|
@@ -111,23 +145,31 @@ def sync_detailed(
|
|
|
111
145
|
def sync(
|
|
112
146
|
*,
|
|
113
147
|
client: AuthenticatedClient | Client,
|
|
114
|
-
body:
|
|
148
|
+
body: MultiTurnEvaluateSystemPromptRequest,
|
|
115
149
|
cbl_api_key: str,
|
|
116
|
-
) ->
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
) -> (
|
|
151
|
+
HTTPValidationError
|
|
152
|
+
| InternalServerErrorResponse
|
|
153
|
+
| MultiTurnRunTestsResponse
|
|
154
|
+
| NotFoundResponse
|
|
155
|
+
| QuotaExceededResponse
|
|
156
|
+
| UnauthorizedResponse
|
|
157
|
+
| None
|
|
158
|
+
):
|
|
159
|
+
"""Multi-turn Evaluate System Prompt
|
|
160
|
+
|
|
161
|
+
Run multi-turn safety tests against a system prompt.
|
|
120
162
|
|
|
121
163
|
Args:
|
|
122
164
|
cbl_api_key (str): Circuit Breaker Labs API Key
|
|
123
|
-
body (
|
|
165
|
+
body (MultiTurnEvaluateSystemPromptRequest):
|
|
124
166
|
|
|
125
167
|
Raises:
|
|
126
168
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
169
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
170
|
|
|
129
171
|
Returns:
|
|
130
|
-
HTTPValidationError |
|
|
172
|
+
HTTPValidationError | InternalServerErrorResponse | MultiTurnRunTestsResponse | NotFoundResponse | QuotaExceededResponse | UnauthorizedResponse
|
|
131
173
|
"""
|
|
132
174
|
|
|
133
175
|
return sync_detailed(
|
|
@@ -140,23 +182,30 @@ def sync(
|
|
|
140
182
|
async def asyncio_detailed(
|
|
141
183
|
*,
|
|
142
184
|
client: AuthenticatedClient | Client,
|
|
143
|
-
body:
|
|
185
|
+
body: MultiTurnEvaluateSystemPromptRequest,
|
|
144
186
|
cbl_api_key: str,
|
|
145
|
-
) -> Response[
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
187
|
+
) -> Response[
|
|
188
|
+
HTTPValidationError
|
|
189
|
+
| InternalServerErrorResponse
|
|
190
|
+
| MultiTurnRunTestsResponse
|
|
191
|
+
| NotFoundResponse
|
|
192
|
+
| QuotaExceededResponse
|
|
193
|
+
| UnauthorizedResponse
|
|
194
|
+
]:
|
|
195
|
+
"""Multi-turn Evaluate System Prompt
|
|
196
|
+
|
|
197
|
+
Run multi-turn safety tests against a system prompt.
|
|
149
198
|
|
|
150
199
|
Args:
|
|
151
200
|
cbl_api_key (str): Circuit Breaker Labs API Key
|
|
152
|
-
body (
|
|
201
|
+
body (MultiTurnEvaluateSystemPromptRequest):
|
|
153
202
|
|
|
154
203
|
Raises:
|
|
155
204
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
156
205
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
157
206
|
|
|
158
207
|
Returns:
|
|
159
|
-
Response[HTTPValidationError |
|
|
208
|
+
Response[HTTPValidationError | InternalServerErrorResponse | MultiTurnRunTestsResponse | NotFoundResponse | QuotaExceededResponse | UnauthorizedResponse]
|
|
160
209
|
"""
|
|
161
210
|
|
|
162
211
|
kwargs = _get_kwargs(
|
|
@@ -172,23 +221,31 @@ async def asyncio_detailed(
|
|
|
172
221
|
async def asyncio(
|
|
173
222
|
*,
|
|
174
223
|
client: AuthenticatedClient | Client,
|
|
175
|
-
body:
|
|
224
|
+
body: MultiTurnEvaluateSystemPromptRequest,
|
|
176
225
|
cbl_api_key: str,
|
|
177
|
-
) ->
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
226
|
+
) -> (
|
|
227
|
+
HTTPValidationError
|
|
228
|
+
| InternalServerErrorResponse
|
|
229
|
+
| MultiTurnRunTestsResponse
|
|
230
|
+
| NotFoundResponse
|
|
231
|
+
| QuotaExceededResponse
|
|
232
|
+
| UnauthorizedResponse
|
|
233
|
+
| None
|
|
234
|
+
):
|
|
235
|
+
"""Multi-turn Evaluate System Prompt
|
|
236
|
+
|
|
237
|
+
Run multi-turn safety tests against a system prompt.
|
|
181
238
|
|
|
182
239
|
Args:
|
|
183
240
|
cbl_api_key (str): Circuit Breaker Labs API Key
|
|
184
|
-
body (
|
|
241
|
+
body (MultiTurnEvaluateSystemPromptRequest):
|
|
185
242
|
|
|
186
243
|
Raises:
|
|
187
244
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
188
245
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
189
246
|
|
|
190
247
|
Returns:
|
|
191
|
-
HTTPValidationError |
|
|
248
|
+
HTTPValidationError | InternalServerErrorResponse | MultiTurnRunTestsResponse | NotFoundResponse | QuotaExceededResponse | UnauthorizedResponse
|
|
192
249
|
"""
|
|
193
250
|
|
|
194
251
|
return (
|