vellum-ai 1.0.11__py3-none-any.whl → 1.1.1__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.
- vellum/__init__.py +2 -2
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -877
- vellum/client/core/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/http_response.py +47 -0
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +22 -696
- vellum/client/resources/__init__.py +0 -2
- vellum/client/resources/ad_hoc/client.py +55 -161
- vellum/client/resources/ad_hoc/raw_client.py +278 -0
- vellum/client/resources/container_images/client.py +62 -172
- vellum/client/resources/container_images/raw_client.py +400 -0
- vellum/client/resources/deployments/client.py +112 -437
- vellum/client/resources/deployments/raw_client.py +995 -0
- vellum/client/resources/document_indexes/client.py +108 -317
- vellum/client/resources/document_indexes/raw_client.py +847 -0
- vellum/client/resources/documents/client.py +88 -285
- vellum/client/resources/documents/raw_client.py +655 -0
- vellum/client/resources/folder_entities/client.py +54 -92
- vellum/client/resources/folder_entities/raw_client.py +277 -0
- vellum/client/resources/metric_definitions/client.py +48 -95
- vellum/client/resources/metric_definitions/raw_client.py +225 -0
- vellum/client/resources/ml_models/client.py +36 -40
- vellum/client/resources/ml_models/raw_client.py +103 -0
- vellum/client/resources/organizations/client.py +34 -39
- vellum/client/resources/organizations/raw_client.py +96 -0
- vellum/client/resources/prompts/client.py +50 -193
- vellum/client/resources/prompts/raw_client.py +346 -0
- vellum/client/resources/sandboxes/client.py +68 -141
- vellum/client/resources/sandboxes/raw_client.py +393 -0
- vellum/client/resources/test_suite_runs/client.py +58 -141
- vellum/client/resources/test_suite_runs/raw_client.py +355 -0
- vellum/client/resources/test_suites/client.py +73 -141
- vellum/client/resources/test_suites/raw_client.py +379 -0
- vellum/client/resources/workflow_deployments/client.py +203 -328
- vellum/client/resources/workflow_deployments/raw_client.py +931 -0
- vellum/client/resources/workflow_executions/client.py +36 -40
- vellum/client/resources/workflow_executions/raw_client.py +97 -0
- vellum/client/resources/workflow_sandboxes/client.py +60 -108
- vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
- vellum/client/resources/workflows/client.py +68 -133
- vellum/client/resources/workflows/raw_client.py +307 -0
- vellum/client/resources/workspace_secrets/client.py +46 -90
- vellum/client/resources/workspace_secrets/raw_client.py +220 -0
- vellum/client/resources/workspaces/client.py +34 -39
- vellum/client/resources/workspaces/raw_client.py +96 -0
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/api_request_parent_context.py +1 -0
- vellum/client/types/external_parent_context.py +36 -0
- vellum/client/types/node_execution_fulfilled_event.py +1 -0
- vellum/client/types/node_execution_initiated_event.py +1 -0
- vellum/client/types/node_execution_paused_event.py +1 -0
- vellum/client/types/node_execution_rejected_event.py +1 -0
- vellum/client/types/node_execution_resumed_event.py +1 -0
- vellum/client/types/node_execution_span.py +1 -0
- vellum/client/types/node_execution_span_attributes.py +1 -0
- vellum/client/types/node_execution_streaming_event.py +1 -0
- vellum/client/types/node_parent_context.py +1 -0
- vellum/client/types/parent_context.py +2 -0
- vellum/client/types/prompt_deployment_parent_context.py +1 -0
- vellum/client/types/slim_workflow_execution_read.py +1 -0
- vellum/client/types/span_link.py +1 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +1 -0
- vellum/client/types/workflow_deployment_parent_context.py +1 -0
- vellum/client/types/workflow_event_execution_read.py +1 -0
- vellum/client/types/workflow_execution_detail.py +1 -0
- vellum/client/types/workflow_execution_fulfilled_event.py +1 -0
- vellum/client/types/workflow_execution_initiated_event.py +1 -0
- vellum/client/types/workflow_execution_paused_event.py +1 -0
- vellum/client/types/workflow_execution_rejected_event.py +1 -0
- vellum/client/types/workflow_execution_resumed_event.py +1 -0
- vellum/client/types/workflow_execution_snapshotted_event.py +1 -0
- vellum/client/types/workflow_execution_span.py +1 -0
- vellum/client/types/workflow_execution_span_attributes.py +1 -0
- vellum/client/types/workflow_execution_streaming_event.py +1 -0
- vellum/client/types/workflow_parent_context.py +1 -0
- vellum/client/types/workflow_sandbox_parent_context.py +1 -0
- vellum/{resources/release_reviews/__init__.py → core/http_response.py} +1 -1
- vellum/{resources/release_reviews/client.py → raw_client.py} +1 -1
- vellum/resources/ad_hoc/raw_client.py +3 -0
- vellum/resources/container_images/raw_client.py +3 -0
- vellum/resources/deployments/raw_client.py +3 -0
- vellum/resources/document_indexes/raw_client.py +3 -0
- vellum/resources/documents/raw_client.py +3 -0
- vellum/resources/folder_entities/raw_client.py +3 -0
- vellum/resources/metric_definitions/raw_client.py +3 -0
- vellum/resources/ml_models/raw_client.py +3 -0
- vellum/resources/organizations/raw_client.py +3 -0
- vellum/resources/prompts/raw_client.py +3 -0
- vellum/resources/sandboxes/raw_client.py +3 -0
- vellum/resources/test_suite_runs/raw_client.py +3 -0
- vellum/resources/test_suites/raw_client.py +3 -0
- vellum/resources/workflow_deployments/raw_client.py +3 -0
- vellum/resources/workflow_executions/raw_client.py +3 -0
- vellum/resources/workflow_sandboxes/raw_client.py +3 -0
- vellum/resources/workflows/raw_client.py +3 -0
- vellum/resources/workspace_secrets/raw_client.py +3 -0
- vellum/resources/workspaces/raw_client.py +3 -0
- vellum/types/external_parent_context.py +3 -0
- vellum/workflows/emitters/vellum_emitter.py +3 -2
- vellum/workflows/events/types.py +6 -0
- vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +5 -15
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +6 -0
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +75 -0
- vellum/workflows/state/context.py +13 -2
- vellum/workflows/types/definition.py +2 -2
- vellum/workflows/types/tests/test_definition.py +2 -3
- vellum/workflows/utils/functions.py +1 -1
- vellum/workflows/utils/tests/test_functions.py +3 -3
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/RECORD +123 -81
- vellum_ee/workflows/display/exceptions.py +7 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +93 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +98 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py +1 -1
- vellum_ee/workflows/display/utils/expressions.py +1 -1
- vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
- vellum/client/resources/release_reviews/__init__.py +0 -2
- vellum/client/resources/release_reviews/client.py +0 -139
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/entry_points.txt +0 -0
@@ -2,16 +2,13 @@
|
|
2
2
|
|
3
3
|
import typing
|
4
4
|
from ...core.client_wrapper import SyncClientWrapper
|
5
|
+
from .raw_client import RawTestSuiteRunsClient
|
5
6
|
from ...types.test_suite_run_exec_config_request import TestSuiteRunExecConfigRequest
|
6
7
|
from ...core.request_options import RequestOptions
|
7
8
|
from ...types.test_suite_run_read import TestSuiteRunRead
|
8
|
-
from ...core.serialization import convert_and_respect_annotation_metadata
|
9
|
-
from ...core.pydantic_utilities import parse_obj_as
|
10
|
-
from json.decoder import JSONDecodeError
|
11
|
-
from ...core.api_error import ApiError
|
12
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
13
9
|
from ...types.paginated_test_suite_run_execution_list import PaginatedTestSuiteRunExecutionList
|
14
10
|
from ...core.client_wrapper import AsyncClientWrapper
|
11
|
+
from .raw_client import AsyncRawTestSuiteRunsClient
|
15
12
|
|
16
13
|
# this is used as the default value for optional parameters
|
17
14
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -19,7 +16,22 @@ OMIT = typing.cast(typing.Any, ...)
|
|
19
16
|
|
20
17
|
class TestSuiteRunsClient:
|
21
18
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
22
|
-
self.
|
19
|
+
self._raw_client = RawTestSuiteRunsClient(client_wrapper=client_wrapper)
|
20
|
+
|
21
|
+
@property
|
22
|
+
def _client_wrapper(self) -> SyncClientWrapper:
|
23
|
+
return self._raw_client._client_wrapper
|
24
|
+
|
25
|
+
@property
|
26
|
+
def with_raw_response(self) -> RawTestSuiteRunsClient:
|
27
|
+
"""
|
28
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
29
|
+
|
30
|
+
Returns
|
31
|
+
-------
|
32
|
+
RawTestSuiteRunsClient
|
33
|
+
"""
|
34
|
+
return self._raw_client
|
23
35
|
|
24
36
|
def create(
|
25
37
|
self,
|
@@ -71,36 +83,13 @@ class TestSuiteRunsClient:
|
|
71
83
|
),
|
72
84
|
)
|
73
85
|
"""
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
json={
|
79
|
-
"test_suite_id": test_suite_id,
|
80
|
-
"test_suite_name": test_suite_name,
|
81
|
-
"exec_config": convert_and_respect_annotation_metadata(
|
82
|
-
object_=exec_config, annotation=TestSuiteRunExecConfigRequest, direction="write"
|
83
|
-
),
|
84
|
-
},
|
85
|
-
headers={
|
86
|
-
"content-type": "application/json",
|
87
|
-
},
|
86
|
+
response = self._raw_client.create(
|
87
|
+
exec_config=exec_config,
|
88
|
+
test_suite_id=test_suite_id,
|
89
|
+
test_suite_name=test_suite_name,
|
88
90
|
request_options=request_options,
|
89
|
-
omit=OMIT,
|
90
91
|
)
|
91
|
-
|
92
|
-
if 200 <= _response.status_code < 300:
|
93
|
-
return typing.cast(
|
94
|
-
TestSuiteRunRead,
|
95
|
-
parse_obj_as(
|
96
|
-
type_=TestSuiteRunRead, # type: ignore
|
97
|
-
object_=_response.json(),
|
98
|
-
),
|
99
|
-
)
|
100
|
-
_response_json = _response.json()
|
101
|
-
except JSONDecodeError:
|
102
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
103
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
92
|
+
return response.data
|
104
93
|
|
105
94
|
def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TestSuiteRunRead:
|
106
95
|
"""
|
@@ -131,25 +120,11 @@ class TestSuiteRunsClient:
|
|
131
120
|
id="id",
|
132
121
|
)
|
133
122
|
"""
|
134
|
-
|
135
|
-
|
136
|
-
base_url=self._client_wrapper.get_environment().default,
|
137
|
-
method="GET",
|
123
|
+
response = self._raw_client.retrieve(
|
124
|
+
id,
|
138
125
|
request_options=request_options,
|
139
126
|
)
|
140
|
-
|
141
|
-
if 200 <= _response.status_code < 300:
|
142
|
-
return typing.cast(
|
143
|
-
TestSuiteRunRead,
|
144
|
-
parse_obj_as(
|
145
|
-
type_=TestSuiteRunRead, # type: ignore
|
146
|
-
object_=_response.json(),
|
147
|
-
),
|
148
|
-
)
|
149
|
-
_response_json = _response.json()
|
150
|
-
except JSONDecodeError:
|
151
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
152
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
127
|
+
return response.data
|
153
128
|
|
154
129
|
def list_executions(
|
155
130
|
self,
|
@@ -198,35 +173,30 @@ class TestSuiteRunsClient:
|
|
198
173
|
id="id",
|
199
174
|
)
|
200
175
|
"""
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
"expand": expand,
|
207
|
-
"limit": limit,
|
208
|
-
"offset": offset,
|
209
|
-
},
|
176
|
+
response = self._raw_client.list_executions(
|
177
|
+
id,
|
178
|
+
expand=expand,
|
179
|
+
limit=limit,
|
180
|
+
offset=offset,
|
210
181
|
request_options=request_options,
|
211
182
|
)
|
212
|
-
|
213
|
-
if 200 <= _response.status_code < 300:
|
214
|
-
return typing.cast(
|
215
|
-
PaginatedTestSuiteRunExecutionList,
|
216
|
-
parse_obj_as(
|
217
|
-
type_=PaginatedTestSuiteRunExecutionList, # type: ignore
|
218
|
-
object_=_response.json(),
|
219
|
-
),
|
220
|
-
)
|
221
|
-
_response_json = _response.json()
|
222
|
-
except JSONDecodeError:
|
223
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
224
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
183
|
+
return response.data
|
225
184
|
|
226
185
|
|
227
186
|
class AsyncTestSuiteRunsClient:
|
228
187
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
229
|
-
self.
|
188
|
+
self._raw_client = AsyncRawTestSuiteRunsClient(client_wrapper=client_wrapper)
|
189
|
+
|
190
|
+
@property
|
191
|
+
def with_raw_response(self) -> AsyncRawTestSuiteRunsClient:
|
192
|
+
"""
|
193
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
194
|
+
|
195
|
+
Returns
|
196
|
+
-------
|
197
|
+
AsyncRawTestSuiteRunsClient
|
198
|
+
"""
|
199
|
+
return self._raw_client
|
230
200
|
|
231
201
|
async def create(
|
232
202
|
self,
|
@@ -286,36 +256,13 @@ class AsyncTestSuiteRunsClient:
|
|
286
256
|
|
287
257
|
asyncio.run(main())
|
288
258
|
"""
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
json={
|
294
|
-
"test_suite_id": test_suite_id,
|
295
|
-
"test_suite_name": test_suite_name,
|
296
|
-
"exec_config": convert_and_respect_annotation_metadata(
|
297
|
-
object_=exec_config, annotation=TestSuiteRunExecConfigRequest, direction="write"
|
298
|
-
),
|
299
|
-
},
|
300
|
-
headers={
|
301
|
-
"content-type": "application/json",
|
302
|
-
},
|
259
|
+
response = await self._raw_client.create(
|
260
|
+
exec_config=exec_config,
|
261
|
+
test_suite_id=test_suite_id,
|
262
|
+
test_suite_name=test_suite_name,
|
303
263
|
request_options=request_options,
|
304
|
-
omit=OMIT,
|
305
264
|
)
|
306
|
-
|
307
|
-
if 200 <= _response.status_code < 300:
|
308
|
-
return typing.cast(
|
309
|
-
TestSuiteRunRead,
|
310
|
-
parse_obj_as(
|
311
|
-
type_=TestSuiteRunRead, # type: ignore
|
312
|
-
object_=_response.json(),
|
313
|
-
),
|
314
|
-
)
|
315
|
-
_response_json = _response.json()
|
316
|
-
except JSONDecodeError:
|
317
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
318
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
265
|
+
return response.data
|
319
266
|
|
320
267
|
async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TestSuiteRunRead:
|
321
268
|
"""
|
@@ -354,25 +301,11 @@ class AsyncTestSuiteRunsClient:
|
|
354
301
|
|
355
302
|
asyncio.run(main())
|
356
303
|
"""
|
357
|
-
|
358
|
-
|
359
|
-
base_url=self._client_wrapper.get_environment().default,
|
360
|
-
method="GET",
|
304
|
+
response = await self._raw_client.retrieve(
|
305
|
+
id,
|
361
306
|
request_options=request_options,
|
362
307
|
)
|
363
|
-
|
364
|
-
if 200 <= _response.status_code < 300:
|
365
|
-
return typing.cast(
|
366
|
-
TestSuiteRunRead,
|
367
|
-
parse_obj_as(
|
368
|
-
type_=TestSuiteRunRead, # type: ignore
|
369
|
-
object_=_response.json(),
|
370
|
-
),
|
371
|
-
)
|
372
|
-
_response_json = _response.json()
|
373
|
-
except JSONDecodeError:
|
374
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
375
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
308
|
+
return response.data
|
376
309
|
|
377
310
|
async def list_executions(
|
378
311
|
self,
|
@@ -429,27 +362,11 @@ class AsyncTestSuiteRunsClient:
|
|
429
362
|
|
430
363
|
asyncio.run(main())
|
431
364
|
"""
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
"expand": expand,
|
438
|
-
"limit": limit,
|
439
|
-
"offset": offset,
|
440
|
-
},
|
365
|
+
response = await self._raw_client.list_executions(
|
366
|
+
id,
|
367
|
+
expand=expand,
|
368
|
+
limit=limit,
|
369
|
+
offset=offset,
|
441
370
|
request_options=request_options,
|
442
371
|
)
|
443
|
-
|
444
|
-
if 200 <= _response.status_code < 300:
|
445
|
-
return typing.cast(
|
446
|
-
PaginatedTestSuiteRunExecutionList,
|
447
|
-
parse_obj_as(
|
448
|
-
type_=PaginatedTestSuiteRunExecutionList, # type: ignore
|
449
|
-
object_=_response.json(),
|
450
|
-
),
|
451
|
-
)
|
452
|
-
_response_json = _response.json()
|
453
|
-
except JSONDecodeError:
|
454
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
455
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
372
|
+
return response.data
|
@@ -0,0 +1,355 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from ...core.client_wrapper import SyncClientWrapper
|
5
|
+
from ...types.test_suite_run_exec_config_request import TestSuiteRunExecConfigRequest
|
6
|
+
from ...core.request_options import RequestOptions
|
7
|
+
from ...core.http_response import HttpResponse
|
8
|
+
from ...types.test_suite_run_read import TestSuiteRunRead
|
9
|
+
from ...core.serialization import convert_and_respect_annotation_metadata
|
10
|
+
from ...core.pydantic_utilities import parse_obj_as
|
11
|
+
from json.decoder import JSONDecodeError
|
12
|
+
from ...core.api_error import ApiError
|
13
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
14
|
+
from ...types.paginated_test_suite_run_execution_list import PaginatedTestSuiteRunExecutionList
|
15
|
+
from ...core.client_wrapper import AsyncClientWrapper
|
16
|
+
from ...core.http_response import AsyncHttpResponse
|
17
|
+
|
18
|
+
# this is used as the default value for optional parameters
|
19
|
+
OMIT = typing.cast(typing.Any, ...)
|
20
|
+
|
21
|
+
|
22
|
+
class RawTestSuiteRunsClient:
|
23
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
24
|
+
self._client_wrapper = client_wrapper
|
25
|
+
|
26
|
+
def create(
|
27
|
+
self,
|
28
|
+
*,
|
29
|
+
exec_config: TestSuiteRunExecConfigRequest,
|
30
|
+
test_suite_id: typing.Optional[str] = OMIT,
|
31
|
+
test_suite_name: typing.Optional[str] = OMIT,
|
32
|
+
request_options: typing.Optional[RequestOptions] = None,
|
33
|
+
) -> HttpResponse[TestSuiteRunRead]:
|
34
|
+
"""
|
35
|
+
Trigger a Test Suite and create a new Test Suite Run
|
36
|
+
|
37
|
+
Parameters
|
38
|
+
----------
|
39
|
+
exec_config : TestSuiteRunExecConfigRequest
|
40
|
+
Configuration that defines how the Test Suite should be run
|
41
|
+
|
42
|
+
test_suite_id : typing.Optional[str]
|
43
|
+
The ID of the Test Suite to run. Must provide either this or test_suite_id.
|
44
|
+
|
45
|
+
test_suite_name : typing.Optional[str]
|
46
|
+
The name of the Test Suite to run. Must provide either this or test_suite_id.
|
47
|
+
|
48
|
+
request_options : typing.Optional[RequestOptions]
|
49
|
+
Request-specific configuration.
|
50
|
+
|
51
|
+
Returns
|
52
|
+
-------
|
53
|
+
HttpResponse[TestSuiteRunRead]
|
54
|
+
|
55
|
+
"""
|
56
|
+
_response = self._client_wrapper.httpx_client.request(
|
57
|
+
"v1/test-suite-runs",
|
58
|
+
base_url=self._client_wrapper.get_environment().default,
|
59
|
+
method="POST",
|
60
|
+
json={
|
61
|
+
"test_suite_id": test_suite_id,
|
62
|
+
"test_suite_name": test_suite_name,
|
63
|
+
"exec_config": convert_and_respect_annotation_metadata(
|
64
|
+
object_=exec_config, annotation=TestSuiteRunExecConfigRequest, direction="write"
|
65
|
+
),
|
66
|
+
},
|
67
|
+
headers={
|
68
|
+
"content-type": "application/json",
|
69
|
+
},
|
70
|
+
request_options=request_options,
|
71
|
+
omit=OMIT,
|
72
|
+
)
|
73
|
+
try:
|
74
|
+
if 200 <= _response.status_code < 300:
|
75
|
+
_data = typing.cast(
|
76
|
+
TestSuiteRunRead,
|
77
|
+
parse_obj_as(
|
78
|
+
type_=TestSuiteRunRead, # type: ignore
|
79
|
+
object_=_response.json(),
|
80
|
+
),
|
81
|
+
)
|
82
|
+
return HttpResponse(response=_response, data=_data)
|
83
|
+
_response_json = _response.json()
|
84
|
+
except JSONDecodeError:
|
85
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
86
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
87
|
+
|
88
|
+
def retrieve(
|
89
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
90
|
+
) -> HttpResponse[TestSuiteRunRead]:
|
91
|
+
"""
|
92
|
+
Retrieve a specific Test Suite Run by ID
|
93
|
+
|
94
|
+
Parameters
|
95
|
+
----------
|
96
|
+
id : str
|
97
|
+
A UUID string identifying this test suite run.
|
98
|
+
|
99
|
+
request_options : typing.Optional[RequestOptions]
|
100
|
+
Request-specific configuration.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
HttpResponse[TestSuiteRunRead]
|
105
|
+
|
106
|
+
"""
|
107
|
+
_response = self._client_wrapper.httpx_client.request(
|
108
|
+
f"v1/test-suite-runs/{jsonable_encoder(id)}",
|
109
|
+
base_url=self._client_wrapper.get_environment().default,
|
110
|
+
method="GET",
|
111
|
+
request_options=request_options,
|
112
|
+
)
|
113
|
+
try:
|
114
|
+
if 200 <= _response.status_code < 300:
|
115
|
+
_data = typing.cast(
|
116
|
+
TestSuiteRunRead,
|
117
|
+
parse_obj_as(
|
118
|
+
type_=TestSuiteRunRead, # type: ignore
|
119
|
+
object_=_response.json(),
|
120
|
+
),
|
121
|
+
)
|
122
|
+
return HttpResponse(response=_response, data=_data)
|
123
|
+
_response_json = _response.json()
|
124
|
+
except JSONDecodeError:
|
125
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
126
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
127
|
+
|
128
|
+
def list_executions(
|
129
|
+
self,
|
130
|
+
id: str,
|
131
|
+
*,
|
132
|
+
expand: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
133
|
+
limit: typing.Optional[int] = None,
|
134
|
+
offset: typing.Optional[int] = None,
|
135
|
+
request_options: typing.Optional[RequestOptions] = None,
|
136
|
+
) -> HttpResponse[PaginatedTestSuiteRunExecutionList]:
|
137
|
+
"""
|
138
|
+
Parameters
|
139
|
+
----------
|
140
|
+
id : str
|
141
|
+
A UUID string identifying this test suite run.
|
142
|
+
|
143
|
+
expand : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
144
|
+
The response fields to expand for more information.
|
145
|
+
- 'results.metric_results.metric_label' expands the metric label for each metric result.
|
146
|
+
- 'results.metric_results.metric_definition' expands the metric definition for each metric result.
|
147
|
+
- 'results.metric_results.metric_definition.name' expands the metric definition name for each metric result.
|
148
|
+
|
149
|
+
limit : typing.Optional[int]
|
150
|
+
Number of results to return per page.
|
151
|
+
|
152
|
+
offset : typing.Optional[int]
|
153
|
+
The initial index from which to return the results.
|
154
|
+
|
155
|
+
request_options : typing.Optional[RequestOptions]
|
156
|
+
Request-specific configuration.
|
157
|
+
|
158
|
+
Returns
|
159
|
+
-------
|
160
|
+
HttpResponse[PaginatedTestSuiteRunExecutionList]
|
161
|
+
|
162
|
+
"""
|
163
|
+
_response = self._client_wrapper.httpx_client.request(
|
164
|
+
f"v1/test-suite-runs/{jsonable_encoder(id)}/executions",
|
165
|
+
base_url=self._client_wrapper.get_environment().default,
|
166
|
+
method="GET",
|
167
|
+
params={
|
168
|
+
"expand": expand,
|
169
|
+
"limit": limit,
|
170
|
+
"offset": offset,
|
171
|
+
},
|
172
|
+
request_options=request_options,
|
173
|
+
)
|
174
|
+
try:
|
175
|
+
if 200 <= _response.status_code < 300:
|
176
|
+
_data = typing.cast(
|
177
|
+
PaginatedTestSuiteRunExecutionList,
|
178
|
+
parse_obj_as(
|
179
|
+
type_=PaginatedTestSuiteRunExecutionList, # type: ignore
|
180
|
+
object_=_response.json(),
|
181
|
+
),
|
182
|
+
)
|
183
|
+
return HttpResponse(response=_response, data=_data)
|
184
|
+
_response_json = _response.json()
|
185
|
+
except JSONDecodeError:
|
186
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
187
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
188
|
+
|
189
|
+
|
190
|
+
class AsyncRawTestSuiteRunsClient:
|
191
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
192
|
+
self._client_wrapper = client_wrapper
|
193
|
+
|
194
|
+
async def create(
|
195
|
+
self,
|
196
|
+
*,
|
197
|
+
exec_config: TestSuiteRunExecConfigRequest,
|
198
|
+
test_suite_id: typing.Optional[str] = OMIT,
|
199
|
+
test_suite_name: typing.Optional[str] = OMIT,
|
200
|
+
request_options: typing.Optional[RequestOptions] = None,
|
201
|
+
) -> AsyncHttpResponse[TestSuiteRunRead]:
|
202
|
+
"""
|
203
|
+
Trigger a Test Suite and create a new Test Suite Run
|
204
|
+
|
205
|
+
Parameters
|
206
|
+
----------
|
207
|
+
exec_config : TestSuiteRunExecConfigRequest
|
208
|
+
Configuration that defines how the Test Suite should be run
|
209
|
+
|
210
|
+
test_suite_id : typing.Optional[str]
|
211
|
+
The ID of the Test Suite to run. Must provide either this or test_suite_id.
|
212
|
+
|
213
|
+
test_suite_name : typing.Optional[str]
|
214
|
+
The name of the Test Suite to run. Must provide either this or test_suite_id.
|
215
|
+
|
216
|
+
request_options : typing.Optional[RequestOptions]
|
217
|
+
Request-specific configuration.
|
218
|
+
|
219
|
+
Returns
|
220
|
+
-------
|
221
|
+
AsyncHttpResponse[TestSuiteRunRead]
|
222
|
+
|
223
|
+
"""
|
224
|
+
_response = await self._client_wrapper.httpx_client.request(
|
225
|
+
"v1/test-suite-runs",
|
226
|
+
base_url=self._client_wrapper.get_environment().default,
|
227
|
+
method="POST",
|
228
|
+
json={
|
229
|
+
"test_suite_id": test_suite_id,
|
230
|
+
"test_suite_name": test_suite_name,
|
231
|
+
"exec_config": convert_and_respect_annotation_metadata(
|
232
|
+
object_=exec_config, annotation=TestSuiteRunExecConfigRequest, direction="write"
|
233
|
+
),
|
234
|
+
},
|
235
|
+
headers={
|
236
|
+
"content-type": "application/json",
|
237
|
+
},
|
238
|
+
request_options=request_options,
|
239
|
+
omit=OMIT,
|
240
|
+
)
|
241
|
+
try:
|
242
|
+
if 200 <= _response.status_code < 300:
|
243
|
+
_data = typing.cast(
|
244
|
+
TestSuiteRunRead,
|
245
|
+
parse_obj_as(
|
246
|
+
type_=TestSuiteRunRead, # type: ignore
|
247
|
+
object_=_response.json(),
|
248
|
+
),
|
249
|
+
)
|
250
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
251
|
+
_response_json = _response.json()
|
252
|
+
except JSONDecodeError:
|
253
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
254
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
255
|
+
|
256
|
+
async def retrieve(
|
257
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
258
|
+
) -> AsyncHttpResponse[TestSuiteRunRead]:
|
259
|
+
"""
|
260
|
+
Retrieve a specific Test Suite Run by ID
|
261
|
+
|
262
|
+
Parameters
|
263
|
+
----------
|
264
|
+
id : str
|
265
|
+
A UUID string identifying this test suite run.
|
266
|
+
|
267
|
+
request_options : typing.Optional[RequestOptions]
|
268
|
+
Request-specific configuration.
|
269
|
+
|
270
|
+
Returns
|
271
|
+
-------
|
272
|
+
AsyncHttpResponse[TestSuiteRunRead]
|
273
|
+
|
274
|
+
"""
|
275
|
+
_response = await self._client_wrapper.httpx_client.request(
|
276
|
+
f"v1/test-suite-runs/{jsonable_encoder(id)}",
|
277
|
+
base_url=self._client_wrapper.get_environment().default,
|
278
|
+
method="GET",
|
279
|
+
request_options=request_options,
|
280
|
+
)
|
281
|
+
try:
|
282
|
+
if 200 <= _response.status_code < 300:
|
283
|
+
_data = typing.cast(
|
284
|
+
TestSuiteRunRead,
|
285
|
+
parse_obj_as(
|
286
|
+
type_=TestSuiteRunRead, # type: ignore
|
287
|
+
object_=_response.json(),
|
288
|
+
),
|
289
|
+
)
|
290
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
291
|
+
_response_json = _response.json()
|
292
|
+
except JSONDecodeError:
|
293
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
294
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
295
|
+
|
296
|
+
async def list_executions(
|
297
|
+
self,
|
298
|
+
id: str,
|
299
|
+
*,
|
300
|
+
expand: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
301
|
+
limit: typing.Optional[int] = None,
|
302
|
+
offset: typing.Optional[int] = None,
|
303
|
+
request_options: typing.Optional[RequestOptions] = None,
|
304
|
+
) -> AsyncHttpResponse[PaginatedTestSuiteRunExecutionList]:
|
305
|
+
"""
|
306
|
+
Parameters
|
307
|
+
----------
|
308
|
+
id : str
|
309
|
+
A UUID string identifying this test suite run.
|
310
|
+
|
311
|
+
expand : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
312
|
+
The response fields to expand for more information.
|
313
|
+
- 'results.metric_results.metric_label' expands the metric label for each metric result.
|
314
|
+
- 'results.metric_results.metric_definition' expands the metric definition for each metric result.
|
315
|
+
- 'results.metric_results.metric_definition.name' expands the metric definition name for each metric result.
|
316
|
+
|
317
|
+
limit : typing.Optional[int]
|
318
|
+
Number of results to return per page.
|
319
|
+
|
320
|
+
offset : typing.Optional[int]
|
321
|
+
The initial index from which to return the results.
|
322
|
+
|
323
|
+
request_options : typing.Optional[RequestOptions]
|
324
|
+
Request-specific configuration.
|
325
|
+
|
326
|
+
Returns
|
327
|
+
-------
|
328
|
+
AsyncHttpResponse[PaginatedTestSuiteRunExecutionList]
|
329
|
+
|
330
|
+
"""
|
331
|
+
_response = await self._client_wrapper.httpx_client.request(
|
332
|
+
f"v1/test-suite-runs/{jsonable_encoder(id)}/executions",
|
333
|
+
base_url=self._client_wrapper.get_environment().default,
|
334
|
+
method="GET",
|
335
|
+
params={
|
336
|
+
"expand": expand,
|
337
|
+
"limit": limit,
|
338
|
+
"offset": offset,
|
339
|
+
},
|
340
|
+
request_options=request_options,
|
341
|
+
)
|
342
|
+
try:
|
343
|
+
if 200 <= _response.status_code < 300:
|
344
|
+
_data = typing.cast(
|
345
|
+
PaginatedTestSuiteRunExecutionList,
|
346
|
+
parse_obj_as(
|
347
|
+
type_=PaginatedTestSuiteRunExecutionList, # type: ignore
|
348
|
+
object_=_response.json(),
|
349
|
+
),
|
350
|
+
)
|
351
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
352
|
+
_response_json = _response.json()
|
353
|
+
except JSONDecodeError:
|
354
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
355
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|