vellum-ai 0.3.11__py3-none-any.whl → 0.3.13__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 +90 -0
- vellum/client.py +3 -0
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/__init__.py +2 -0
- vellum/resources/document_indexes/client.py +282 -0
- vellum/resources/test_suite_runs/__init__.py +2 -0
- vellum/resources/test_suite_runs/client.py +223 -0
- vellum/types/__init__.py +102 -0
- vellum/types/array_variable_value_item.py +11 -0
- vellum/types/fulfilled_workflow_node_result_event.py +2 -0
- vellum/types/generate_request.py +1 -1
- vellum/types/image_variable_value.py +33 -0
- vellum/types/initiated_workflow_node_result_event.py +1 -0
- vellum/types/paginated_test_suite_run_execution_list.py +32 -0
- vellum/types/rejected_workflow_node_result_event.py +1 -0
- vellum/types/streaming_workflow_node_result_event.py +1 -0
- vellum/types/test_suite_run_deployment_release_tag_exec_config.py +36 -0
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +31 -0
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +31 -0
- vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +38 -0
- vellum/types/test_suite_run_deployment_release_tag_exec_config_type_enum.py +5 -0
- vellum/types/test_suite_run_exec_config.py +33 -0
- vellum/types/test_suite_run_exec_config_request.py +33 -0
- vellum/types/test_suite_run_execution.py +33 -0
- vellum/types/test_suite_run_execution_chat_history_output.py +30 -0
- vellum/types/test_suite_run_execution_error_output.py +30 -0
- vellum/types/test_suite_run_execution_json_output.py +29 -0
- vellum/types/test_suite_run_execution_metric_result.py +30 -0
- vellum/types/test_suite_run_execution_number_output.py +29 -0
- vellum/types/test_suite_run_execution_output.py +78 -0
- vellum/types/test_suite_run_execution_search_results_output.py +30 -0
- vellum/types/test_suite_run_execution_string_output.py +29 -0
- vellum/types/test_suite_run_metric_error_output.py +34 -0
- vellum/types/test_suite_run_metric_error_output_type_enum.py +5 -0
- vellum/types/test_suite_run_metric_number_output.py +33 -0
- vellum/types/test_suite_run_metric_number_output_type_enum.py +5 -0
- vellum/types/test_suite_run_metric_output.py +31 -0
- vellum/types/test_suite_run_read.py +47 -0
- vellum/types/test_suite_run_state.py +41 -0
- vellum/types/test_suite_run_test_suite.py +30 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config.py +36 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +33 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +33 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +38 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config_type_enum.py +5 -0
- vellum/types/workflow_execution_event_error_code.py +5 -0
- vellum/types/workflow_output_array.py +1 -1
- vellum/types/workflow_output_chat_history.py +1 -1
- vellum/types/workflow_output_error.py +1 -1
- vellum/types/workflow_output_function_call.py +1 -1
- vellum/types/workflow_output_image.py +1 -1
- vellum/types/workflow_output_json.py +1 -1
- vellum/types/workflow_output_number.py +1 -1
- vellum/types/workflow_output_search_results.py +1 -1
- vellum/types/workflow_output_string.py +1 -1
- {vellum_ai-0.3.11.dist-info → vellum_ai-0.3.13.dist-info}/METADATA +1 -1
- {vellum_ai-0.3.11.dist-info → vellum_ai-0.3.13.dist-info}/RECORD +59 -26
- {vellum_ai-0.3.11.dist-info → vellum_ai-0.3.13.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.11.dist-info → vellum_ai-0.3.13.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -18,6 +18,7 @@ from .types import (
|
|
18
18
|
ArrayVariableValueItem_ChatHistory,
|
19
19
|
ArrayVariableValueItem_Error,
|
20
20
|
ArrayVariableValueItem_FunctionCall,
|
21
|
+
ArrayVariableValueItem_Image,
|
21
22
|
ArrayVariableValueItem_Json,
|
22
23
|
ArrayVariableValueItem_Number,
|
23
24
|
ArrayVariableValueItem_SearchResults,
|
@@ -129,6 +130,7 @@ from .types import (
|
|
129
130
|
ImageChatMessageContent,
|
130
131
|
ImageChatMessageContentRequest,
|
131
132
|
ImageEnum,
|
133
|
+
ImageVariableValue,
|
132
134
|
IndexingStateEnum,
|
133
135
|
InitiatedEnum,
|
134
136
|
InitiatedExecutePromptEvent,
|
@@ -201,6 +203,7 @@ from .types import (
|
|
201
203
|
PaginatedSlimDeploymentReadList,
|
202
204
|
PaginatedSlimDocumentList,
|
203
205
|
PaginatedSlimWorkflowDeploymentList,
|
206
|
+
PaginatedTestSuiteRunExecutionList,
|
204
207
|
ProcessingFailureReasonEnum,
|
205
208
|
ProcessingStateEnum,
|
206
209
|
PromptDeploymentExpandMetaRequestRequest,
|
@@ -326,6 +329,47 @@ from .types import (
|
|
326
329
|
TestCaseVariableValue_Number,
|
327
330
|
TestCaseVariableValue_SearchResults,
|
328
331
|
TestCaseVariableValue_String,
|
332
|
+
TestSuiteRunDeploymentReleaseTagExecConfig,
|
333
|
+
TestSuiteRunDeploymentReleaseTagExecConfigData,
|
334
|
+
TestSuiteRunDeploymentReleaseTagExecConfigDataRequest,
|
335
|
+
TestSuiteRunDeploymentReleaseTagExecConfigRequest,
|
336
|
+
TestSuiteRunDeploymentReleaseTagExecConfigTypeEnum,
|
337
|
+
TestSuiteRunExecConfig,
|
338
|
+
TestSuiteRunExecConfigRequest,
|
339
|
+
TestSuiteRunExecConfigRequest_DeploymentReleaseTag,
|
340
|
+
TestSuiteRunExecConfigRequest_WorkflowReleaseTag,
|
341
|
+
TestSuiteRunExecConfig_DeploymentReleaseTag,
|
342
|
+
TestSuiteRunExecConfig_WorkflowReleaseTag,
|
343
|
+
TestSuiteRunExecution,
|
344
|
+
TestSuiteRunExecutionChatHistoryOutput,
|
345
|
+
TestSuiteRunExecutionErrorOutput,
|
346
|
+
TestSuiteRunExecutionJsonOutput,
|
347
|
+
TestSuiteRunExecutionMetricResult,
|
348
|
+
TestSuiteRunExecutionNumberOutput,
|
349
|
+
TestSuiteRunExecutionOutput,
|
350
|
+
TestSuiteRunExecutionOutput_ChatHistory,
|
351
|
+
TestSuiteRunExecutionOutput_Error,
|
352
|
+
TestSuiteRunExecutionOutput_Json,
|
353
|
+
TestSuiteRunExecutionOutput_Number,
|
354
|
+
TestSuiteRunExecutionOutput_SearchResults,
|
355
|
+
TestSuiteRunExecutionOutput_String,
|
356
|
+
TestSuiteRunExecutionSearchResultsOutput,
|
357
|
+
TestSuiteRunExecutionStringOutput,
|
358
|
+
TestSuiteRunMetricErrorOutput,
|
359
|
+
TestSuiteRunMetricErrorOutputTypeEnum,
|
360
|
+
TestSuiteRunMetricNumberOutput,
|
361
|
+
TestSuiteRunMetricNumberOutputTypeEnum,
|
362
|
+
TestSuiteRunMetricOutput,
|
363
|
+
TestSuiteRunMetricOutput_Error,
|
364
|
+
TestSuiteRunMetricOutput_Number,
|
365
|
+
TestSuiteRunRead,
|
366
|
+
TestSuiteRunState,
|
367
|
+
TestSuiteRunTestSuite,
|
368
|
+
TestSuiteRunWorkflowReleaseTagExecConfig,
|
369
|
+
TestSuiteRunWorkflowReleaseTagExecConfigData,
|
370
|
+
TestSuiteRunWorkflowReleaseTagExecConfigDataRequest,
|
371
|
+
TestSuiteRunWorkflowReleaseTagExecConfigRequest,
|
372
|
+
TestSuiteRunWorkflowReleaseTagExecConfigTypeEnum,
|
329
373
|
TestSuiteTestCase,
|
330
374
|
UploadDocumentErrorResponse,
|
331
375
|
UploadDocumentResponse,
|
@@ -422,6 +466,7 @@ from .resources import (
|
|
422
466
|
model_versions,
|
423
467
|
registered_prompts,
|
424
468
|
sandboxes,
|
469
|
+
test_suite_runs,
|
425
470
|
test_suites,
|
426
471
|
workflow_deployments,
|
427
472
|
)
|
@@ -445,6 +490,7 @@ __all__ = [
|
|
445
490
|
"ArrayVariableValueItem_ChatHistory",
|
446
491
|
"ArrayVariableValueItem_Error",
|
447
492
|
"ArrayVariableValueItem_FunctionCall",
|
493
|
+
"ArrayVariableValueItem_Image",
|
448
494
|
"ArrayVariableValueItem_Json",
|
449
495
|
"ArrayVariableValueItem_Number",
|
450
496
|
"ArrayVariableValueItem_SearchResults",
|
@@ -561,6 +607,7 @@ __all__ = [
|
|
561
607
|
"ImageChatMessageContent",
|
562
608
|
"ImageChatMessageContentRequest",
|
563
609
|
"ImageEnum",
|
610
|
+
"ImageVariableValue",
|
564
611
|
"IndexingStateEnum",
|
565
612
|
"InitiatedEnum",
|
566
613
|
"InitiatedExecutePromptEvent",
|
@@ -635,6 +682,7 @@ __all__ = [
|
|
635
682
|
"PaginatedSlimDeploymentReadList",
|
636
683
|
"PaginatedSlimDocumentList",
|
637
684
|
"PaginatedSlimWorkflowDeploymentList",
|
685
|
+
"PaginatedTestSuiteRunExecutionList",
|
638
686
|
"ProcessingFailureReasonEnum",
|
639
687
|
"ProcessingStateEnum",
|
640
688
|
"PromptDeploymentExpandMetaRequestRequest",
|
@@ -760,6 +808,47 @@ __all__ = [
|
|
760
808
|
"TestCaseVariableValue_Number",
|
761
809
|
"TestCaseVariableValue_SearchResults",
|
762
810
|
"TestCaseVariableValue_String",
|
811
|
+
"TestSuiteRunDeploymentReleaseTagExecConfig",
|
812
|
+
"TestSuiteRunDeploymentReleaseTagExecConfigData",
|
813
|
+
"TestSuiteRunDeploymentReleaseTagExecConfigDataRequest",
|
814
|
+
"TestSuiteRunDeploymentReleaseTagExecConfigRequest",
|
815
|
+
"TestSuiteRunDeploymentReleaseTagExecConfigTypeEnum",
|
816
|
+
"TestSuiteRunExecConfig",
|
817
|
+
"TestSuiteRunExecConfigRequest",
|
818
|
+
"TestSuiteRunExecConfigRequest_DeploymentReleaseTag",
|
819
|
+
"TestSuiteRunExecConfigRequest_WorkflowReleaseTag",
|
820
|
+
"TestSuiteRunExecConfig_DeploymentReleaseTag",
|
821
|
+
"TestSuiteRunExecConfig_WorkflowReleaseTag",
|
822
|
+
"TestSuiteRunExecution",
|
823
|
+
"TestSuiteRunExecutionChatHistoryOutput",
|
824
|
+
"TestSuiteRunExecutionErrorOutput",
|
825
|
+
"TestSuiteRunExecutionJsonOutput",
|
826
|
+
"TestSuiteRunExecutionMetricResult",
|
827
|
+
"TestSuiteRunExecutionNumberOutput",
|
828
|
+
"TestSuiteRunExecutionOutput",
|
829
|
+
"TestSuiteRunExecutionOutput_ChatHistory",
|
830
|
+
"TestSuiteRunExecutionOutput_Error",
|
831
|
+
"TestSuiteRunExecutionOutput_Json",
|
832
|
+
"TestSuiteRunExecutionOutput_Number",
|
833
|
+
"TestSuiteRunExecutionOutput_SearchResults",
|
834
|
+
"TestSuiteRunExecutionOutput_String",
|
835
|
+
"TestSuiteRunExecutionSearchResultsOutput",
|
836
|
+
"TestSuiteRunExecutionStringOutput",
|
837
|
+
"TestSuiteRunMetricErrorOutput",
|
838
|
+
"TestSuiteRunMetricErrorOutputTypeEnum",
|
839
|
+
"TestSuiteRunMetricNumberOutput",
|
840
|
+
"TestSuiteRunMetricNumberOutputTypeEnum",
|
841
|
+
"TestSuiteRunMetricOutput",
|
842
|
+
"TestSuiteRunMetricOutput_Error",
|
843
|
+
"TestSuiteRunMetricOutput_Number",
|
844
|
+
"TestSuiteRunRead",
|
845
|
+
"TestSuiteRunState",
|
846
|
+
"TestSuiteRunTestSuite",
|
847
|
+
"TestSuiteRunWorkflowReleaseTagExecConfig",
|
848
|
+
"TestSuiteRunWorkflowReleaseTagExecConfigData",
|
849
|
+
"TestSuiteRunWorkflowReleaseTagExecConfigDataRequest",
|
850
|
+
"TestSuiteRunWorkflowReleaseTagExecConfigRequest",
|
851
|
+
"TestSuiteRunWorkflowReleaseTagExecConfigTypeEnum",
|
763
852
|
"TestSuiteTestCase",
|
764
853
|
"UploadDocumentErrorResponse",
|
765
854
|
"UploadDocumentResponse",
|
@@ -852,6 +941,7 @@ __all__ = [
|
|
852
941
|
"model_versions",
|
853
942
|
"registered_prompts",
|
854
943
|
"sandboxes",
|
944
|
+
"test_suite_runs",
|
855
945
|
"test_suites",
|
856
946
|
"workflow_deployments",
|
857
947
|
]
|
vellum/client.py
CHANGED
@@ -22,6 +22,7 @@ from .resources.folder_entities.client import AsyncFolderEntitiesClient, FolderE
|
|
22
22
|
from .resources.model_versions.client import AsyncModelVersionsClient, ModelVersionsClient
|
23
23
|
from .resources.registered_prompts.client import AsyncRegisteredPromptsClient, RegisteredPromptsClient
|
24
24
|
from .resources.sandboxes.client import AsyncSandboxesClient, SandboxesClient
|
25
|
+
from .resources.test_suite_runs.client import AsyncTestSuiteRunsClient, TestSuiteRunsClient
|
25
26
|
from .resources.test_suites.client import AsyncTestSuitesClient, TestSuitesClient
|
26
27
|
from .resources.workflow_deployments.client import AsyncWorkflowDeploymentsClient, WorkflowDeploymentsClient
|
27
28
|
from .types.execute_prompt_event import ExecutePromptEvent
|
@@ -72,6 +73,7 @@ class Vellum:
|
|
72
73
|
self.model_versions = ModelVersionsClient(client_wrapper=self._client_wrapper)
|
73
74
|
self.registered_prompts = RegisteredPromptsClient(client_wrapper=self._client_wrapper)
|
74
75
|
self.sandboxes = SandboxesClient(client_wrapper=self._client_wrapper)
|
76
|
+
self.test_suite_runs = TestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
75
77
|
self.test_suites = TestSuitesClient(client_wrapper=self._client_wrapper)
|
76
78
|
self.workflow_deployments = WorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
77
79
|
|
@@ -655,6 +657,7 @@ class AsyncVellum:
|
|
655
657
|
self.model_versions = AsyncModelVersionsClient(client_wrapper=self._client_wrapper)
|
656
658
|
self.registered_prompts = AsyncRegisteredPromptsClient(client_wrapper=self._client_wrapper)
|
657
659
|
self.sandboxes = AsyncSandboxesClient(client_wrapper=self._client_wrapper)
|
660
|
+
self.test_suite_runs = AsyncTestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
658
661
|
self.test_suites = AsyncTestSuitesClient(client_wrapper=self._client_wrapper)
|
659
662
|
self.workflow_deployments = AsyncWorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
660
663
|
|
vellum/core/client_wrapper.py
CHANGED
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
17
17
|
"X-Fern-Language": "Python",
|
18
18
|
"X-Fern-SDK-Name": "vellum-ai",
|
19
|
-
"X-Fern-SDK-Version": "0.3.
|
19
|
+
"X-Fern-SDK-Version": "0.3.13",
|
20
20
|
}
|
21
21
|
headers["X_API_KEY"] = self.api_key
|
22
22
|
return headers
|
vellum/resources/__init__.py
CHANGED
@@ -8,6 +8,7 @@ from . import (
|
|
8
8
|
model_versions,
|
9
9
|
registered_prompts,
|
10
10
|
sandboxes,
|
11
|
+
test_suite_runs,
|
11
12
|
test_suites,
|
12
13
|
workflow_deployments,
|
13
14
|
)
|
@@ -26,6 +27,7 @@ __all__ = [
|
|
26
27
|
"model_versions",
|
27
28
|
"registered_prompts",
|
28
29
|
"sandboxes",
|
30
|
+
"test_suite_runs",
|
29
31
|
"test_suites",
|
30
32
|
"workflow_deployments",
|
31
33
|
]
|
@@ -187,6 +187,147 @@ class DocumentIndexesClient:
|
|
187
187
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
188
188
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
189
189
|
|
190
|
+
def update(
|
191
|
+
self,
|
192
|
+
id: str,
|
193
|
+
*,
|
194
|
+
label: str,
|
195
|
+
status: typing.Optional[EntityStatus] = OMIT,
|
196
|
+
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
197
|
+
) -> DocumentIndexRead:
|
198
|
+
"""
|
199
|
+
Used to fully update a Document Index given its ID.
|
200
|
+
|
201
|
+
Parameters:
|
202
|
+
- id: str. A UUID string identifying this document index.
|
203
|
+
|
204
|
+
- label: str. A human-readable label for the document index
|
205
|
+
|
206
|
+
- status: typing.Optional[EntityStatus]. The current status of the document index
|
207
|
+
|
208
|
+
* `ACTIVE` - Active
|
209
|
+
* `ARCHIVED` - Archived
|
210
|
+
- environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
|
211
|
+
|
212
|
+
* `DEVELOPMENT` - Development
|
213
|
+
* `STAGING` - Staging
|
214
|
+
* `PRODUCTION` - Production---
|
215
|
+
from vellum.client import Vellum
|
216
|
+
|
217
|
+
client = Vellum(
|
218
|
+
api_key="YOUR_API_KEY",
|
219
|
+
)
|
220
|
+
client.document_indexes.update(
|
221
|
+
id="id",
|
222
|
+
label="label",
|
223
|
+
)
|
224
|
+
"""
|
225
|
+
_request: typing.Dict[str, typing.Any] = {"label": label}
|
226
|
+
if status is not OMIT:
|
227
|
+
_request["status"] = status
|
228
|
+
if environment is not OMIT:
|
229
|
+
_request["environment"] = environment
|
230
|
+
_response = self._client_wrapper.httpx_client.request(
|
231
|
+
"PUT",
|
232
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
233
|
+
json=jsonable_encoder(_request),
|
234
|
+
headers=self._client_wrapper.get_headers(),
|
235
|
+
timeout=None,
|
236
|
+
)
|
237
|
+
if 200 <= _response.status_code < 300:
|
238
|
+
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
239
|
+
try:
|
240
|
+
_response_json = _response.json()
|
241
|
+
except JSONDecodeError:
|
242
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
243
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
244
|
+
|
245
|
+
def destroy(self, id: str) -> None:
|
246
|
+
"""
|
247
|
+
Used to delete a Document Index given its ID.
|
248
|
+
|
249
|
+
Parameters:
|
250
|
+
- id: str. A UUID string identifying this document index.
|
251
|
+
---
|
252
|
+
from vellum.client import Vellum
|
253
|
+
|
254
|
+
client = Vellum(
|
255
|
+
api_key="YOUR_API_KEY",
|
256
|
+
)
|
257
|
+
client.document_indexes.destroy(
|
258
|
+
id="id",
|
259
|
+
)
|
260
|
+
"""
|
261
|
+
_response = self._client_wrapper.httpx_client.request(
|
262
|
+
"DELETE",
|
263
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
264
|
+
headers=self._client_wrapper.get_headers(),
|
265
|
+
timeout=None,
|
266
|
+
)
|
267
|
+
if 200 <= _response.status_code < 300:
|
268
|
+
return
|
269
|
+
try:
|
270
|
+
_response_json = _response.json()
|
271
|
+
except JSONDecodeError:
|
272
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
273
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
274
|
+
|
275
|
+
def partial_update(
|
276
|
+
self,
|
277
|
+
id: str,
|
278
|
+
*,
|
279
|
+
label: typing.Optional[str] = OMIT,
|
280
|
+
status: typing.Optional[EntityStatus] = OMIT,
|
281
|
+
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
282
|
+
) -> DocumentIndexRead:
|
283
|
+
"""
|
284
|
+
Used to partial update a Document Index given its ID.
|
285
|
+
|
286
|
+
Parameters:
|
287
|
+
- id: str. A UUID string identifying this document index.
|
288
|
+
|
289
|
+
- label: typing.Optional[str]. A human-readable label for the document index
|
290
|
+
|
291
|
+
- status: typing.Optional[EntityStatus]. The current status of the document index
|
292
|
+
|
293
|
+
* `ACTIVE` - Active
|
294
|
+
* `ARCHIVED` - Archived
|
295
|
+
- environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
|
296
|
+
|
297
|
+
* `DEVELOPMENT` - Development
|
298
|
+
* `STAGING` - Staging
|
299
|
+
* `PRODUCTION` - Production---
|
300
|
+
from vellum.client import Vellum
|
301
|
+
|
302
|
+
client = Vellum(
|
303
|
+
api_key="YOUR_API_KEY",
|
304
|
+
)
|
305
|
+
client.document_indexes.partial_update(
|
306
|
+
id="id",
|
307
|
+
)
|
308
|
+
"""
|
309
|
+
_request: typing.Dict[str, typing.Any] = {}
|
310
|
+
if label is not OMIT:
|
311
|
+
_request["label"] = label
|
312
|
+
if status is not OMIT:
|
313
|
+
_request["status"] = status
|
314
|
+
if environment is not OMIT:
|
315
|
+
_request["environment"] = environment
|
316
|
+
_response = self._client_wrapper.httpx_client.request(
|
317
|
+
"PATCH",
|
318
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
319
|
+
json=jsonable_encoder(_request),
|
320
|
+
headers=self._client_wrapper.get_headers(),
|
321
|
+
timeout=None,
|
322
|
+
)
|
323
|
+
if 200 <= _response.status_code < 300:
|
324
|
+
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
325
|
+
try:
|
326
|
+
_response_json = _response.json()
|
327
|
+
except JSONDecodeError:
|
328
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
329
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
330
|
+
|
190
331
|
|
191
332
|
class AsyncDocumentIndexesClient:
|
192
333
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -351,3 +492,144 @@ class AsyncDocumentIndexesClient:
|
|
351
492
|
except JSONDecodeError:
|
352
493
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
353
494
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
495
|
+
|
496
|
+
async def update(
|
497
|
+
self,
|
498
|
+
id: str,
|
499
|
+
*,
|
500
|
+
label: str,
|
501
|
+
status: typing.Optional[EntityStatus] = OMIT,
|
502
|
+
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
503
|
+
) -> DocumentIndexRead:
|
504
|
+
"""
|
505
|
+
Used to fully update a Document Index given its ID.
|
506
|
+
|
507
|
+
Parameters:
|
508
|
+
- id: str. A UUID string identifying this document index.
|
509
|
+
|
510
|
+
- label: str. A human-readable label for the document index
|
511
|
+
|
512
|
+
- status: typing.Optional[EntityStatus]. The current status of the document index
|
513
|
+
|
514
|
+
* `ACTIVE` - Active
|
515
|
+
* `ARCHIVED` - Archived
|
516
|
+
- environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
|
517
|
+
|
518
|
+
* `DEVELOPMENT` - Development
|
519
|
+
* `STAGING` - Staging
|
520
|
+
* `PRODUCTION` - Production---
|
521
|
+
from vellum.client import AsyncVellum
|
522
|
+
|
523
|
+
client = AsyncVellum(
|
524
|
+
api_key="YOUR_API_KEY",
|
525
|
+
)
|
526
|
+
await client.document_indexes.update(
|
527
|
+
id="id",
|
528
|
+
label="label",
|
529
|
+
)
|
530
|
+
"""
|
531
|
+
_request: typing.Dict[str, typing.Any] = {"label": label}
|
532
|
+
if status is not OMIT:
|
533
|
+
_request["status"] = status
|
534
|
+
if environment is not OMIT:
|
535
|
+
_request["environment"] = environment
|
536
|
+
_response = await self._client_wrapper.httpx_client.request(
|
537
|
+
"PUT",
|
538
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
539
|
+
json=jsonable_encoder(_request),
|
540
|
+
headers=self._client_wrapper.get_headers(),
|
541
|
+
timeout=None,
|
542
|
+
)
|
543
|
+
if 200 <= _response.status_code < 300:
|
544
|
+
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
545
|
+
try:
|
546
|
+
_response_json = _response.json()
|
547
|
+
except JSONDecodeError:
|
548
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
549
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
550
|
+
|
551
|
+
async def destroy(self, id: str) -> None:
|
552
|
+
"""
|
553
|
+
Used to delete a Document Index given its ID.
|
554
|
+
|
555
|
+
Parameters:
|
556
|
+
- id: str. A UUID string identifying this document index.
|
557
|
+
---
|
558
|
+
from vellum.client import AsyncVellum
|
559
|
+
|
560
|
+
client = AsyncVellum(
|
561
|
+
api_key="YOUR_API_KEY",
|
562
|
+
)
|
563
|
+
await client.document_indexes.destroy(
|
564
|
+
id="id",
|
565
|
+
)
|
566
|
+
"""
|
567
|
+
_response = await self._client_wrapper.httpx_client.request(
|
568
|
+
"DELETE",
|
569
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
570
|
+
headers=self._client_wrapper.get_headers(),
|
571
|
+
timeout=None,
|
572
|
+
)
|
573
|
+
if 200 <= _response.status_code < 300:
|
574
|
+
return
|
575
|
+
try:
|
576
|
+
_response_json = _response.json()
|
577
|
+
except JSONDecodeError:
|
578
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
579
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
580
|
+
|
581
|
+
async def partial_update(
|
582
|
+
self,
|
583
|
+
id: str,
|
584
|
+
*,
|
585
|
+
label: typing.Optional[str] = OMIT,
|
586
|
+
status: typing.Optional[EntityStatus] = OMIT,
|
587
|
+
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
588
|
+
) -> DocumentIndexRead:
|
589
|
+
"""
|
590
|
+
Used to partial update a Document Index given its ID.
|
591
|
+
|
592
|
+
Parameters:
|
593
|
+
- id: str. A UUID string identifying this document index.
|
594
|
+
|
595
|
+
- label: typing.Optional[str]. A human-readable label for the document index
|
596
|
+
|
597
|
+
- status: typing.Optional[EntityStatus]. The current status of the document index
|
598
|
+
|
599
|
+
* `ACTIVE` - Active
|
600
|
+
* `ARCHIVED` - Archived
|
601
|
+
- environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
|
602
|
+
|
603
|
+
* `DEVELOPMENT` - Development
|
604
|
+
* `STAGING` - Staging
|
605
|
+
* `PRODUCTION` - Production---
|
606
|
+
from vellum.client import AsyncVellum
|
607
|
+
|
608
|
+
client = AsyncVellum(
|
609
|
+
api_key="YOUR_API_KEY",
|
610
|
+
)
|
611
|
+
await client.document_indexes.partial_update(
|
612
|
+
id="id",
|
613
|
+
)
|
614
|
+
"""
|
615
|
+
_request: typing.Dict[str, typing.Any] = {}
|
616
|
+
if label is not OMIT:
|
617
|
+
_request["label"] = label
|
618
|
+
if status is not OMIT:
|
619
|
+
_request["status"] = status
|
620
|
+
if environment is not OMIT:
|
621
|
+
_request["environment"] = environment
|
622
|
+
_response = await self._client_wrapper.httpx_client.request(
|
623
|
+
"PATCH",
|
624
|
+
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{id}"),
|
625
|
+
json=jsonable_encoder(_request),
|
626
|
+
headers=self._client_wrapper.get_headers(),
|
627
|
+
timeout=None,
|
628
|
+
)
|
629
|
+
if 200 <= _response.status_code < 300:
|
630
|
+
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
631
|
+
try:
|
632
|
+
_response_json = _response.json()
|
633
|
+
except JSONDecodeError:
|
634
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
635
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|