vellum-ai 1.1.0__py3-none-any.whl → 1.1.2__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.
Files changed (76) hide show
  1. vellum/client/README.md +0 -55
  2. vellum/client/__init__.py +159 -873
  3. vellum/client/core/__init__.py +3 -0
  4. vellum/client/core/client_wrapper.py +2 -2
  5. vellum/client/core/http_response.py +47 -0
  6. vellum/client/core/pydantic_utilities.py +10 -3
  7. vellum/client/raw_client.py +1561 -0
  8. vellum/client/reference.md +20 -693
  9. vellum/client/resources/ad_hoc/client.py +55 -161
  10. vellum/client/resources/ad_hoc/raw_client.py +278 -0
  11. vellum/client/resources/container_images/client.py +62 -172
  12. vellum/client/resources/container_images/raw_client.py +400 -0
  13. vellum/client/resources/deployments/client.py +112 -437
  14. vellum/client/resources/deployments/raw_client.py +995 -0
  15. vellum/client/resources/document_indexes/client.py +108 -317
  16. vellum/client/resources/document_indexes/raw_client.py +847 -0
  17. vellum/client/resources/documents/client.py +88 -285
  18. vellum/client/resources/documents/raw_client.py +655 -0
  19. vellum/client/resources/folder_entities/client.py +54 -92
  20. vellum/client/resources/folder_entities/raw_client.py +277 -0
  21. vellum/client/resources/metric_definitions/client.py +48 -95
  22. vellum/client/resources/metric_definitions/raw_client.py +225 -0
  23. vellum/client/resources/ml_models/client.py +36 -40
  24. vellum/client/resources/ml_models/raw_client.py +103 -0
  25. vellum/client/resources/organizations/client.py +34 -39
  26. vellum/client/resources/organizations/raw_client.py +96 -0
  27. vellum/client/resources/prompts/client.py +50 -193
  28. vellum/client/resources/prompts/raw_client.py +346 -0
  29. vellum/client/resources/sandboxes/client.py +68 -141
  30. vellum/client/resources/sandboxes/raw_client.py +393 -0
  31. vellum/client/resources/test_suite_runs/client.py +58 -141
  32. vellum/client/resources/test_suite_runs/raw_client.py +355 -0
  33. vellum/client/resources/test_suites/client.py +73 -141
  34. vellum/client/resources/test_suites/raw_client.py +379 -0
  35. vellum/client/resources/workflow_deployments/client.py +118 -362
  36. vellum/client/resources/workflow_deployments/raw_client.py +931 -0
  37. vellum/client/resources/workflow_executions/client.py +36 -40
  38. vellum/client/resources/workflow_executions/raw_client.py +97 -0
  39. vellum/client/resources/workflow_sandboxes/client.py +60 -108
  40. vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
  41. vellum/client/resources/workflows/client.py +68 -133
  42. vellum/client/resources/workflows/raw_client.py +307 -0
  43. vellum/client/resources/workspace_secrets/client.py +46 -90
  44. vellum/client/resources/workspace_secrets/raw_client.py +220 -0
  45. vellum/client/resources/workspaces/client.py +34 -39
  46. vellum/client/resources/workspaces/raw_client.py +96 -0
  47. vellum/core/http_response.py +3 -0
  48. vellum/raw_client.py +3 -0
  49. vellum/resources/ad_hoc/raw_client.py +3 -0
  50. vellum/resources/container_images/raw_client.py +3 -0
  51. vellum/resources/deployments/raw_client.py +3 -0
  52. vellum/resources/document_indexes/raw_client.py +3 -0
  53. vellum/resources/documents/raw_client.py +3 -0
  54. vellum/resources/folder_entities/raw_client.py +3 -0
  55. vellum/resources/metric_definitions/raw_client.py +3 -0
  56. vellum/resources/ml_models/raw_client.py +3 -0
  57. vellum/resources/organizations/raw_client.py +3 -0
  58. vellum/resources/prompts/raw_client.py +3 -0
  59. vellum/resources/sandboxes/raw_client.py +3 -0
  60. vellum/resources/test_suite_runs/raw_client.py +3 -0
  61. vellum/resources/test_suites/raw_client.py +3 -0
  62. vellum/resources/workflow_deployments/raw_client.py +3 -0
  63. vellum/resources/workflow_executions/raw_client.py +3 -0
  64. vellum/resources/workflow_sandboxes/raw_client.py +3 -0
  65. vellum/resources/workflows/raw_client.py +3 -0
  66. vellum/resources/workspace_secrets/raw_client.py +3 -0
  67. vellum/resources/workspaces/raw_client.py +3 -0
  68. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/METADATA +1 -1
  69. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/RECORD +76 -33
  70. vellum_ee/workflows/display/exceptions.py +7 -0
  71. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
  72. vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
  73. vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
  74. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/LICENSE +0 -0
  75. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/WHEEL +0 -0
  76. {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.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._client_wrapper = client_wrapper
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
- _response = self._client_wrapper.httpx_client.request(
75
- "v1/test-suite-runs",
76
- base_url=self._client_wrapper.get_environment().default,
77
- method="POST",
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
- try:
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
- _response = self._client_wrapper.httpx_client.request(
135
- f"v1/test-suite-runs/{jsonable_encoder(id)}",
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
- try:
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
- _response = self._client_wrapper.httpx_client.request(
202
- f"v1/test-suite-runs/{jsonable_encoder(id)}/executions",
203
- base_url=self._client_wrapper.get_environment().default,
204
- method="GET",
205
- params={
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
- try:
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._client_wrapper = client_wrapper
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
- _response = await self._client_wrapper.httpx_client.request(
290
- "v1/test-suite-runs",
291
- base_url=self._client_wrapper.get_environment().default,
292
- method="POST",
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
- try:
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
- _response = await self._client_wrapper.httpx_client.request(
358
- f"v1/test-suite-runs/{jsonable_encoder(id)}",
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
- try:
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
- _response = await self._client_wrapper.httpx_client.request(
433
- f"v1/test-suite-runs/{jsonable_encoder(id)}/executions",
434
- base_url=self._client_wrapper.get_environment().default,
435
- method="GET",
436
- params={
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
- try:
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)