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.
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -873
- 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/core/pydantic_utilities.py +10 -3
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +20 -693
- 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 +118 -362
- 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/core/http_response.py +3 -0
- vellum/raw_client.py +3 -0
- 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_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/METADATA +1 -1
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/RECORD +76 -33
- 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/workflows/base_workflow_display.py +2 -1
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/LICENSE +0 -0
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/WHEEL +0 -0
- {vellum_ai-1.1.0.dist-info → vellum_ai-1.1.2.dist-info}/entry_points.txt +0 -0
vellum/client/__init__.py
CHANGED
@@ -6,6 +6,7 @@ from .types.api_version_enum import ApiVersionEnum
|
|
6
6
|
import os
|
7
7
|
import httpx
|
8
8
|
from .core.client_wrapper import SyncClientWrapper
|
9
|
+
from .raw_client import RawVellum
|
9
10
|
from .resources.ad_hoc.client import AdHocClient
|
10
11
|
from .resources.container_images.client import ContainerImagesClient
|
11
12
|
from .resources.deployments.client import DeploymentsClient
|
@@ -31,25 +32,25 @@ from .types.execute_api_request_headers_value import ExecuteApiRequestHeadersVal
|
|
31
32
|
from .types.execute_api_request_bearer_token import ExecuteApiRequestBearerToken
|
32
33
|
from .core.request_options import RequestOptions
|
33
34
|
from .types.execute_api_response import ExecuteApiResponse
|
34
|
-
from .core.serialization import convert_and_respect_annotation_metadata
|
35
|
-
from .core.pydantic_utilities import parse_obj_as
|
36
|
-
from json.decoder import JSONDecodeError
|
37
|
-
from .core.api_error import ApiError
|
38
35
|
from .types.code_execution_runtime import CodeExecutionRuntime
|
39
36
|
from .types.code_executor_input import CodeExecutorInput
|
40
37
|
from .types.code_execution_package import CodeExecutionPackage
|
41
38
|
from .types.vellum_variable_type import VellumVariableType
|
42
39
|
from .types.code_executor_response import CodeExecutorResponse
|
43
|
-
from .errors.bad_request_error import BadRequestError
|
44
40
|
from .types.prompt_deployment_input_request import PromptDeploymentInputRequest
|
45
41
|
from .types.prompt_deployment_expand_meta_request import PromptDeploymentExpandMetaRequest
|
46
42
|
from .types.raw_prompt_execution_overrides_request import RawPromptExecutionOverridesRequest
|
47
43
|
from .types.execute_prompt_response import ExecutePromptResponse
|
44
|
+
from .types.execute_prompt_event import ExecutePromptEvent
|
45
|
+
from .core.serialization import convert_and_respect_annotation_metadata
|
46
|
+
from .core.pydantic_utilities import parse_obj_as
|
47
|
+
import json
|
48
|
+
from .errors.bad_request_error import BadRequestError
|
48
49
|
from .errors.forbidden_error import ForbiddenError
|
49
50
|
from .errors.not_found_error import NotFoundError
|
50
51
|
from .errors.internal_server_error import InternalServerError
|
51
|
-
from .
|
52
|
-
import
|
52
|
+
from json.decoder import JSONDecodeError
|
53
|
+
from .core.api_error import ApiError
|
53
54
|
from .types.workflow_request_input_request import WorkflowRequestInputRequest
|
54
55
|
from .types.workflow_expand_meta_request import WorkflowExpandMetaRequest
|
55
56
|
from .types.execute_workflow_response import ExecuteWorkflowResponse
|
@@ -64,6 +65,7 @@ from .types.search_response import SearchResponse
|
|
64
65
|
from .types.submit_completion_actual_request import SubmitCompletionActualRequest
|
65
66
|
from .types.submit_workflow_execution_actual_request import SubmitWorkflowExecutionActualRequest
|
66
67
|
from .core.client_wrapper import AsyncClientWrapper
|
68
|
+
from .raw_client import AsyncRawVellum
|
67
69
|
from .resources.ad_hoc.client import AsyncAdHocClient
|
68
70
|
from .resources.container_images.client import AsyncContainerImagesClient
|
69
71
|
from .resources.deployments.client import AsyncDeploymentsClient
|
@@ -148,6 +150,7 @@ class Vellum:
|
|
148
150
|
else httpx.Client(timeout=_defaulted_timeout),
|
149
151
|
timeout=_defaulted_timeout,
|
150
152
|
)
|
153
|
+
self._raw_client = RawVellum(client_wrapper=self._client_wrapper)
|
151
154
|
self.ad_hoc = AdHocClient(client_wrapper=self._client_wrapper)
|
152
155
|
self.container_images = ContainerImagesClient(client_wrapper=self._client_wrapper)
|
153
156
|
self.deployments = DeploymentsClient(client_wrapper=self._client_wrapper)
|
@@ -168,6 +171,17 @@ class Vellum:
|
|
168
171
|
self.workspace_secrets = WorkspaceSecretsClient(client_wrapper=self._client_wrapper)
|
169
172
|
self.workspaces = WorkspacesClient(client_wrapper=self._client_wrapper)
|
170
173
|
|
174
|
+
@property
|
175
|
+
def with_raw_response(self) -> RawVellum:
|
176
|
+
"""
|
177
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
178
|
+
|
179
|
+
Returns
|
180
|
+
-------
|
181
|
+
RawVellum
|
182
|
+
"""
|
183
|
+
return self._raw_client
|
184
|
+
|
171
185
|
def execute_api(
|
172
186
|
self,
|
173
187
|
*,
|
@@ -211,42 +225,15 @@ class Vellum:
|
|
211
225
|
url="x",
|
212
226
|
)
|
213
227
|
"""
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
"method": method,
|
221
|
-
"body": convert_and_respect_annotation_metadata(
|
222
|
-
object_=body, annotation=typing.Optional[ExecuteApiRequestBody], direction="write"
|
223
|
-
),
|
224
|
-
"headers": convert_and_respect_annotation_metadata(
|
225
|
-
object_=headers, annotation=typing.Dict[str, ExecuteApiRequestHeadersValue], direction="write"
|
226
|
-
),
|
227
|
-
"bearer_token": convert_and_respect_annotation_metadata(
|
228
|
-
object_=bearer_token, annotation=typing.Optional[ExecuteApiRequestBearerToken], direction="write"
|
229
|
-
),
|
230
|
-
},
|
231
|
-
headers={
|
232
|
-
"content-type": "application/json",
|
233
|
-
},
|
228
|
+
response = self._raw_client.execute_api(
|
229
|
+
url=url,
|
230
|
+
method=method,
|
231
|
+
body=body,
|
232
|
+
headers=headers,
|
233
|
+
bearer_token=bearer_token,
|
234
234
|
request_options=request_options,
|
235
|
-
omit=OMIT,
|
236
235
|
)
|
237
|
-
|
238
|
-
if 200 <= _response.status_code < 300:
|
239
|
-
return typing.cast(
|
240
|
-
ExecuteApiResponse,
|
241
|
-
parse_obj_as(
|
242
|
-
type_=ExecuteApiResponse, # type: ignore
|
243
|
-
object_=_response.json(),
|
244
|
-
),
|
245
|
-
)
|
246
|
-
_response_json = _response.json()
|
247
|
-
except JSONDecodeError:
|
248
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
249
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
236
|
+
return response.data
|
250
237
|
|
251
238
|
def execute_code(
|
252
239
|
self,
|
@@ -313,50 +300,15 @@ class Vellum:
|
|
313
300
|
output_type="STRING",
|
314
301
|
)
|
315
302
|
"""
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
"runtime": runtime,
|
323
|
-
"input_values": convert_and_respect_annotation_metadata(
|
324
|
-
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
325
|
-
),
|
326
|
-
"packages": convert_and_respect_annotation_metadata(
|
327
|
-
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
328
|
-
),
|
329
|
-
"output_type": output_type,
|
330
|
-
},
|
331
|
-
headers={
|
332
|
-
"content-type": "application/json",
|
333
|
-
},
|
303
|
+
response = self._raw_client.execute_code(
|
304
|
+
code=code,
|
305
|
+
runtime=runtime,
|
306
|
+
input_values=input_values,
|
307
|
+
packages=packages,
|
308
|
+
output_type=output_type,
|
334
309
|
request_options=request_options,
|
335
|
-
omit=OMIT,
|
336
310
|
)
|
337
|
-
|
338
|
-
if 200 <= _response.status_code < 300:
|
339
|
-
return typing.cast(
|
340
|
-
CodeExecutorResponse,
|
341
|
-
parse_obj_as(
|
342
|
-
type_=CodeExecutorResponse, # type: ignore
|
343
|
-
object_=_response.json(),
|
344
|
-
),
|
345
|
-
)
|
346
|
-
if _response.status_code == 400:
|
347
|
-
raise BadRequestError(
|
348
|
-
typing.cast(
|
349
|
-
typing.Optional[typing.Any],
|
350
|
-
parse_obj_as(
|
351
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
352
|
-
object_=_response.json(),
|
353
|
-
),
|
354
|
-
)
|
355
|
-
)
|
356
|
-
_response_json = _response.json()
|
357
|
-
except JSONDecodeError:
|
358
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
359
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
311
|
+
return response.data
|
360
312
|
|
361
313
|
def execute_prompt(
|
362
314
|
self,
|
@@ -433,90 +385,19 @@ class Vellum:
|
|
433
385
|
],
|
434
386
|
)
|
435
387
|
"""
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
"release_tag": release_tag,
|
447
|
-
"external_id": external_id,
|
448
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
449
|
-
object_=expand_meta,
|
450
|
-
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
451
|
-
direction="write",
|
452
|
-
),
|
453
|
-
"raw_overrides": convert_and_respect_annotation_metadata(
|
454
|
-
object_=raw_overrides,
|
455
|
-
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
456
|
-
direction="write",
|
457
|
-
),
|
458
|
-
"expand_raw": expand_raw,
|
459
|
-
"metadata": metadata,
|
460
|
-
},
|
461
|
-
headers={
|
462
|
-
"content-type": "application/json",
|
463
|
-
},
|
388
|
+
response = self._raw_client.execute_prompt(
|
389
|
+
inputs=inputs,
|
390
|
+
prompt_deployment_id=prompt_deployment_id,
|
391
|
+
prompt_deployment_name=prompt_deployment_name,
|
392
|
+
release_tag=release_tag,
|
393
|
+
external_id=external_id,
|
394
|
+
expand_meta=expand_meta,
|
395
|
+
raw_overrides=raw_overrides,
|
396
|
+
expand_raw=expand_raw,
|
397
|
+
metadata=metadata,
|
464
398
|
request_options=request_options,
|
465
|
-
omit=OMIT,
|
466
399
|
)
|
467
|
-
|
468
|
-
if 200 <= _response.status_code < 300:
|
469
|
-
return typing.cast(
|
470
|
-
ExecutePromptResponse,
|
471
|
-
parse_obj_as(
|
472
|
-
type_=ExecutePromptResponse, # type: ignore
|
473
|
-
object_=_response.json(),
|
474
|
-
),
|
475
|
-
)
|
476
|
-
if _response.status_code == 400:
|
477
|
-
raise BadRequestError(
|
478
|
-
typing.cast(
|
479
|
-
typing.Optional[typing.Any],
|
480
|
-
parse_obj_as(
|
481
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
482
|
-
object_=_response.json(),
|
483
|
-
),
|
484
|
-
)
|
485
|
-
)
|
486
|
-
if _response.status_code == 403:
|
487
|
-
raise ForbiddenError(
|
488
|
-
typing.cast(
|
489
|
-
typing.Optional[typing.Any],
|
490
|
-
parse_obj_as(
|
491
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
492
|
-
object_=_response.json(),
|
493
|
-
),
|
494
|
-
)
|
495
|
-
)
|
496
|
-
if _response.status_code == 404:
|
497
|
-
raise NotFoundError(
|
498
|
-
typing.cast(
|
499
|
-
typing.Optional[typing.Any],
|
500
|
-
parse_obj_as(
|
501
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
502
|
-
object_=_response.json(),
|
503
|
-
),
|
504
|
-
)
|
505
|
-
)
|
506
|
-
if _response.status_code == 500:
|
507
|
-
raise InternalServerError(
|
508
|
-
typing.cast(
|
509
|
-
typing.Optional[typing.Any],
|
510
|
-
parse_obj_as(
|
511
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
512
|
-
object_=_response.json(),
|
513
|
-
),
|
514
|
-
)
|
515
|
-
)
|
516
|
-
_response_json = _response.json()
|
517
|
-
except JSONDecodeError:
|
518
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
519
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
400
|
+
return response.data
|
520
401
|
|
521
402
|
def execute_prompt_stream(
|
522
403
|
self,
|
@@ -595,9 +476,9 @@ class Vellum:
|
|
595
476
|
for chunk in response:
|
596
477
|
yield chunk
|
597
478
|
"""
|
598
|
-
with self._client_wrapper.httpx_client.stream(
|
479
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
599
480
|
"v1/execute-prompt-stream",
|
600
|
-
base_url=self._client_wrapper.get_environment().predict,
|
481
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
601
482
|
method="POST",
|
602
483
|
json={
|
603
484
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -755,72 +636,17 @@ class Vellum:
|
|
755
636
|
],
|
756
637
|
)
|
757
638
|
"""
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
767
|
-
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
768
|
-
),
|
769
|
-
"workflow_deployment_id": workflow_deployment_id,
|
770
|
-
"workflow_deployment_name": workflow_deployment_name,
|
771
|
-
"release_tag": release_tag,
|
772
|
-
"external_id": external_id,
|
773
|
-
"metadata": metadata,
|
774
|
-
},
|
775
|
-
headers={
|
776
|
-
"content-type": "application/json",
|
777
|
-
},
|
639
|
+
response = self._raw_client.execute_workflow(
|
640
|
+
inputs=inputs,
|
641
|
+
expand_meta=expand_meta,
|
642
|
+
workflow_deployment_id=workflow_deployment_id,
|
643
|
+
workflow_deployment_name=workflow_deployment_name,
|
644
|
+
release_tag=release_tag,
|
645
|
+
external_id=external_id,
|
646
|
+
metadata=metadata,
|
778
647
|
request_options=request_options,
|
779
|
-
omit=OMIT,
|
780
648
|
)
|
781
|
-
|
782
|
-
if 200 <= _response.status_code < 300:
|
783
|
-
return typing.cast(
|
784
|
-
ExecuteWorkflowResponse,
|
785
|
-
parse_obj_as(
|
786
|
-
type_=ExecuteWorkflowResponse, # type: ignore
|
787
|
-
object_=_response.json(),
|
788
|
-
),
|
789
|
-
)
|
790
|
-
if _response.status_code == 400:
|
791
|
-
raise BadRequestError(
|
792
|
-
typing.cast(
|
793
|
-
typing.Optional[typing.Any],
|
794
|
-
parse_obj_as(
|
795
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
796
|
-
object_=_response.json(),
|
797
|
-
),
|
798
|
-
)
|
799
|
-
)
|
800
|
-
if _response.status_code == 404:
|
801
|
-
raise NotFoundError(
|
802
|
-
typing.cast(
|
803
|
-
typing.Optional[typing.Any],
|
804
|
-
parse_obj_as(
|
805
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
806
|
-
object_=_response.json(),
|
807
|
-
),
|
808
|
-
)
|
809
|
-
)
|
810
|
-
if _response.status_code == 500:
|
811
|
-
raise InternalServerError(
|
812
|
-
typing.cast(
|
813
|
-
typing.Optional[typing.Any],
|
814
|
-
parse_obj_as(
|
815
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
816
|
-
object_=_response.json(),
|
817
|
-
),
|
818
|
-
)
|
819
|
-
)
|
820
|
-
_response_json = _response.json()
|
821
|
-
except JSONDecodeError:
|
822
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
823
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
649
|
+
return response.data
|
824
650
|
|
825
651
|
def execute_workflow_stream(
|
826
652
|
self,
|
@@ -895,9 +721,9 @@ class Vellum:
|
|
895
721
|
for chunk in response:
|
896
722
|
yield chunk
|
897
723
|
"""
|
898
|
-
with self._client_wrapper.httpx_client.stream(
|
724
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
899
725
|
"v1/execute-workflow-stream",
|
900
|
-
base_url=self._client_wrapper.get_environment().predict,
|
726
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
901
727
|
method="POST",
|
902
728
|
json={
|
903
729
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -1027,79 +853,14 @@ class Vellum:
|
|
1027
853
|
],
|
1028
854
|
)
|
1029
855
|
"""
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
"deployment_id": deployment_id,
|
1036
|
-
"deployment_name": deployment_name,
|
1037
|
-
"requests": convert_and_respect_annotation_metadata(
|
1038
|
-
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
1039
|
-
),
|
1040
|
-
"options": convert_and_respect_annotation_metadata(
|
1041
|
-
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
1042
|
-
),
|
1043
|
-
},
|
1044
|
-
headers={
|
1045
|
-
"content-type": "application/json",
|
1046
|
-
},
|
856
|
+
response = self._raw_client.generate(
|
857
|
+
requests=requests,
|
858
|
+
deployment_id=deployment_id,
|
859
|
+
deployment_name=deployment_name,
|
860
|
+
options=options,
|
1047
861
|
request_options=request_options,
|
1048
|
-
omit=OMIT,
|
1049
862
|
)
|
1050
|
-
|
1051
|
-
if 200 <= _response.status_code < 300:
|
1052
|
-
return typing.cast(
|
1053
|
-
GenerateResponse,
|
1054
|
-
parse_obj_as(
|
1055
|
-
type_=GenerateResponse, # type: ignore
|
1056
|
-
object_=_response.json(),
|
1057
|
-
),
|
1058
|
-
)
|
1059
|
-
if _response.status_code == 400:
|
1060
|
-
raise BadRequestError(
|
1061
|
-
typing.cast(
|
1062
|
-
typing.Optional[typing.Any],
|
1063
|
-
parse_obj_as(
|
1064
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1065
|
-
object_=_response.json(),
|
1066
|
-
),
|
1067
|
-
)
|
1068
|
-
)
|
1069
|
-
if _response.status_code == 403:
|
1070
|
-
raise ForbiddenError(
|
1071
|
-
typing.cast(
|
1072
|
-
typing.Optional[typing.Any],
|
1073
|
-
parse_obj_as(
|
1074
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1075
|
-
object_=_response.json(),
|
1076
|
-
),
|
1077
|
-
)
|
1078
|
-
)
|
1079
|
-
if _response.status_code == 404:
|
1080
|
-
raise NotFoundError(
|
1081
|
-
typing.cast(
|
1082
|
-
typing.Optional[typing.Any],
|
1083
|
-
parse_obj_as(
|
1084
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1085
|
-
object_=_response.json(),
|
1086
|
-
),
|
1087
|
-
)
|
1088
|
-
)
|
1089
|
-
if _response.status_code == 500:
|
1090
|
-
raise InternalServerError(
|
1091
|
-
typing.cast(
|
1092
|
-
typing.Optional[typing.Any],
|
1093
|
-
parse_obj_as(
|
1094
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1095
|
-
object_=_response.json(),
|
1096
|
-
),
|
1097
|
-
)
|
1098
|
-
)
|
1099
|
-
_response_json = _response.json()
|
1100
|
-
except JSONDecodeError:
|
1101
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1102
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
863
|
+
return response.data
|
1103
864
|
|
1104
865
|
def generate_stream(
|
1105
866
|
self,
|
@@ -1159,9 +920,9 @@ class Vellum:
|
|
1159
920
|
for chunk in response:
|
1160
921
|
yield chunk
|
1161
922
|
"""
|
1162
|
-
with self._client_wrapper.httpx_client.stream(
|
923
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
1163
924
|
"v1/generate-stream",
|
1164
|
-
base_url=self._client_wrapper.get_environment().predict,
|
925
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
1165
926
|
method="POST",
|
1166
927
|
json={
|
1167
928
|
"deployment_id": deployment_id,
|
@@ -1291,68 +1052,15 @@ class Vellum:
|
|
1291
1052
|
query="x",
|
1292
1053
|
)
|
1293
1054
|
"""
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
"index_name": index_name,
|
1301
|
-
"query": query,
|
1302
|
-
"options": convert_and_respect_annotation_metadata(
|
1303
|
-
object_=options, annotation=typing.Optional[SearchRequestOptionsRequest], direction="write"
|
1304
|
-
),
|
1305
|
-
"document_index": document_index,
|
1306
|
-
},
|
1307
|
-
headers={
|
1308
|
-
"content-type": "application/json",
|
1309
|
-
},
|
1055
|
+
response = self._raw_client.search(
|
1056
|
+
query=query,
|
1057
|
+
index_id=index_id,
|
1058
|
+
index_name=index_name,
|
1059
|
+
options=options,
|
1060
|
+
document_index=document_index,
|
1310
1061
|
request_options=request_options,
|
1311
|
-
omit=OMIT,
|
1312
1062
|
)
|
1313
|
-
|
1314
|
-
if 200 <= _response.status_code < 300:
|
1315
|
-
return typing.cast(
|
1316
|
-
SearchResponse,
|
1317
|
-
parse_obj_as(
|
1318
|
-
type_=SearchResponse, # type: ignore
|
1319
|
-
object_=_response.json(),
|
1320
|
-
),
|
1321
|
-
)
|
1322
|
-
if _response.status_code == 400:
|
1323
|
-
raise BadRequestError(
|
1324
|
-
typing.cast(
|
1325
|
-
typing.Optional[typing.Any],
|
1326
|
-
parse_obj_as(
|
1327
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1328
|
-
object_=_response.json(),
|
1329
|
-
),
|
1330
|
-
)
|
1331
|
-
)
|
1332
|
-
if _response.status_code == 404:
|
1333
|
-
raise NotFoundError(
|
1334
|
-
typing.cast(
|
1335
|
-
typing.Optional[typing.Any],
|
1336
|
-
parse_obj_as(
|
1337
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1338
|
-
object_=_response.json(),
|
1339
|
-
),
|
1340
|
-
)
|
1341
|
-
)
|
1342
|
-
if _response.status_code == 500:
|
1343
|
-
raise InternalServerError(
|
1344
|
-
typing.cast(
|
1345
|
-
typing.Optional[typing.Any],
|
1346
|
-
parse_obj_as(
|
1347
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1348
|
-
object_=_response.json(),
|
1349
|
-
),
|
1350
|
-
)
|
1351
|
-
)
|
1352
|
-
_response_json = _response.json()
|
1353
|
-
except JSONDecodeError:
|
1354
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1355
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1063
|
+
return response.data
|
1356
1064
|
|
1357
1065
|
def submit_completion_actuals(
|
1358
1066
|
self,
|
@@ -1395,60 +1103,13 @@ class Vellum:
|
|
1395
1103
|
actuals=[SubmitCompletionActualRequest(), SubmitCompletionActualRequest()],
|
1396
1104
|
)
|
1397
1105
|
"""
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
json={
|
1403
|
-
"deployment_id": deployment_id,
|
1404
|
-
"deployment_name": deployment_name,
|
1405
|
-
"actuals": convert_and_respect_annotation_metadata(
|
1406
|
-
object_=actuals, annotation=typing.Sequence[SubmitCompletionActualRequest], direction="write"
|
1407
|
-
),
|
1408
|
-
},
|
1409
|
-
headers={
|
1410
|
-
"content-type": "application/json",
|
1411
|
-
},
|
1106
|
+
response = self._raw_client.submit_completion_actuals(
|
1107
|
+
actuals=actuals,
|
1108
|
+
deployment_id=deployment_id,
|
1109
|
+
deployment_name=deployment_name,
|
1412
1110
|
request_options=request_options,
|
1413
|
-
omit=OMIT,
|
1414
1111
|
)
|
1415
|
-
|
1416
|
-
if 200 <= _response.status_code < 300:
|
1417
|
-
return
|
1418
|
-
if _response.status_code == 400:
|
1419
|
-
raise BadRequestError(
|
1420
|
-
typing.cast(
|
1421
|
-
typing.Optional[typing.Any],
|
1422
|
-
parse_obj_as(
|
1423
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1424
|
-
object_=_response.json(),
|
1425
|
-
),
|
1426
|
-
)
|
1427
|
-
)
|
1428
|
-
if _response.status_code == 404:
|
1429
|
-
raise NotFoundError(
|
1430
|
-
typing.cast(
|
1431
|
-
typing.Optional[typing.Any],
|
1432
|
-
parse_obj_as(
|
1433
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1434
|
-
object_=_response.json(),
|
1435
|
-
),
|
1436
|
-
)
|
1437
|
-
)
|
1438
|
-
if _response.status_code == 500:
|
1439
|
-
raise InternalServerError(
|
1440
|
-
typing.cast(
|
1441
|
-
typing.Optional[typing.Any],
|
1442
|
-
parse_obj_as(
|
1443
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1444
|
-
object_=_response.json(),
|
1445
|
-
),
|
1446
|
-
)
|
1447
|
-
)
|
1448
|
-
_response_json = _response.json()
|
1449
|
-
except JSONDecodeError:
|
1450
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1451
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1112
|
+
return response.data
|
1452
1113
|
|
1453
1114
|
def submit_workflow_execution_actuals(
|
1454
1115
|
self,
|
@@ -1496,30 +1157,13 @@ class Vellum:
|
|
1496
1157
|
],
|
1497
1158
|
)
|
1498
1159
|
"""
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
json={
|
1504
|
-
"actuals": convert_and_respect_annotation_metadata(
|
1505
|
-
object_=actuals, annotation=typing.Sequence[SubmitWorkflowExecutionActualRequest], direction="write"
|
1506
|
-
),
|
1507
|
-
"execution_id": execution_id,
|
1508
|
-
"external_id": external_id,
|
1509
|
-
},
|
1510
|
-
headers={
|
1511
|
-
"content-type": "application/json",
|
1512
|
-
},
|
1160
|
+
response = self._raw_client.submit_workflow_execution_actuals(
|
1161
|
+
actuals=actuals,
|
1162
|
+
execution_id=execution_id,
|
1163
|
+
external_id=external_id,
|
1513
1164
|
request_options=request_options,
|
1514
|
-
omit=OMIT,
|
1515
1165
|
)
|
1516
|
-
|
1517
|
-
if 200 <= _response.status_code < 300:
|
1518
|
-
return
|
1519
|
-
_response_json = _response.json()
|
1520
|
-
except JSONDecodeError:
|
1521
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1522
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1166
|
+
return response.data
|
1523
1167
|
|
1524
1168
|
|
1525
1169
|
class AsyncVellum:
|
@@ -1582,6 +1226,7 @@ class AsyncVellum:
|
|
1582
1226
|
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
1583
1227
|
timeout=_defaulted_timeout,
|
1584
1228
|
)
|
1229
|
+
self._raw_client = AsyncRawVellum(client_wrapper=self._client_wrapper)
|
1585
1230
|
self.ad_hoc = AsyncAdHocClient(client_wrapper=self._client_wrapper)
|
1586
1231
|
self.container_images = AsyncContainerImagesClient(client_wrapper=self._client_wrapper)
|
1587
1232
|
self.deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper)
|
@@ -1602,6 +1247,17 @@ class AsyncVellum:
|
|
1602
1247
|
self.workspace_secrets = AsyncWorkspaceSecretsClient(client_wrapper=self._client_wrapper)
|
1603
1248
|
self.workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper)
|
1604
1249
|
|
1250
|
+
@property
|
1251
|
+
def with_raw_response(self) -> AsyncRawVellum:
|
1252
|
+
"""
|
1253
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
1254
|
+
|
1255
|
+
Returns
|
1256
|
+
-------
|
1257
|
+
AsyncRawVellum
|
1258
|
+
"""
|
1259
|
+
return self._raw_client
|
1260
|
+
|
1605
1261
|
async def execute_api(
|
1606
1262
|
self,
|
1607
1263
|
*,
|
@@ -1653,42 +1309,15 @@ class AsyncVellum:
|
|
1653
1309
|
|
1654
1310
|
asyncio.run(main())
|
1655
1311
|
"""
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
"method": method,
|
1663
|
-
"body": convert_and_respect_annotation_metadata(
|
1664
|
-
object_=body, annotation=typing.Optional[ExecuteApiRequestBody], direction="write"
|
1665
|
-
),
|
1666
|
-
"headers": convert_and_respect_annotation_metadata(
|
1667
|
-
object_=headers, annotation=typing.Dict[str, ExecuteApiRequestHeadersValue], direction="write"
|
1668
|
-
),
|
1669
|
-
"bearer_token": convert_and_respect_annotation_metadata(
|
1670
|
-
object_=bearer_token, annotation=typing.Optional[ExecuteApiRequestBearerToken], direction="write"
|
1671
|
-
),
|
1672
|
-
},
|
1673
|
-
headers={
|
1674
|
-
"content-type": "application/json",
|
1675
|
-
},
|
1312
|
+
response = await self._raw_client.execute_api(
|
1313
|
+
url=url,
|
1314
|
+
method=method,
|
1315
|
+
body=body,
|
1316
|
+
headers=headers,
|
1317
|
+
bearer_token=bearer_token,
|
1676
1318
|
request_options=request_options,
|
1677
|
-
omit=OMIT,
|
1678
1319
|
)
|
1679
|
-
|
1680
|
-
if 200 <= _response.status_code < 300:
|
1681
|
-
return typing.cast(
|
1682
|
-
ExecuteApiResponse,
|
1683
|
-
parse_obj_as(
|
1684
|
-
type_=ExecuteApiResponse, # type: ignore
|
1685
|
-
object_=_response.json(),
|
1686
|
-
),
|
1687
|
-
)
|
1688
|
-
_response_json = _response.json()
|
1689
|
-
except JSONDecodeError:
|
1690
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1691
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1320
|
+
return response.data
|
1692
1321
|
|
1693
1322
|
async def execute_code(
|
1694
1323
|
self,
|
@@ -1763,50 +1392,15 @@ class AsyncVellum:
|
|
1763
1392
|
|
1764
1393
|
asyncio.run(main())
|
1765
1394
|
"""
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
"runtime": runtime,
|
1773
|
-
"input_values": convert_and_respect_annotation_metadata(
|
1774
|
-
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
1775
|
-
),
|
1776
|
-
"packages": convert_and_respect_annotation_metadata(
|
1777
|
-
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
1778
|
-
),
|
1779
|
-
"output_type": output_type,
|
1780
|
-
},
|
1781
|
-
headers={
|
1782
|
-
"content-type": "application/json",
|
1783
|
-
},
|
1395
|
+
response = await self._raw_client.execute_code(
|
1396
|
+
code=code,
|
1397
|
+
runtime=runtime,
|
1398
|
+
input_values=input_values,
|
1399
|
+
packages=packages,
|
1400
|
+
output_type=output_type,
|
1784
1401
|
request_options=request_options,
|
1785
|
-
omit=OMIT,
|
1786
1402
|
)
|
1787
|
-
|
1788
|
-
if 200 <= _response.status_code < 300:
|
1789
|
-
return typing.cast(
|
1790
|
-
CodeExecutorResponse,
|
1791
|
-
parse_obj_as(
|
1792
|
-
type_=CodeExecutorResponse, # type: ignore
|
1793
|
-
object_=_response.json(),
|
1794
|
-
),
|
1795
|
-
)
|
1796
|
-
if _response.status_code == 400:
|
1797
|
-
raise BadRequestError(
|
1798
|
-
typing.cast(
|
1799
|
-
typing.Optional[typing.Any],
|
1800
|
-
parse_obj_as(
|
1801
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1802
|
-
object_=_response.json(),
|
1803
|
-
),
|
1804
|
-
)
|
1805
|
-
)
|
1806
|
-
_response_json = _response.json()
|
1807
|
-
except JSONDecodeError:
|
1808
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1809
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1403
|
+
return response.data
|
1810
1404
|
|
1811
1405
|
async def execute_prompt(
|
1812
1406
|
self,
|
@@ -1891,90 +1485,19 @@ class AsyncVellum:
|
|
1891
1485
|
|
1892
1486
|
asyncio.run(main())
|
1893
1487
|
"""
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
"release_tag": release_tag,
|
1905
|
-
"external_id": external_id,
|
1906
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
1907
|
-
object_=expand_meta,
|
1908
|
-
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
1909
|
-
direction="write",
|
1910
|
-
),
|
1911
|
-
"raw_overrides": convert_and_respect_annotation_metadata(
|
1912
|
-
object_=raw_overrides,
|
1913
|
-
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
1914
|
-
direction="write",
|
1915
|
-
),
|
1916
|
-
"expand_raw": expand_raw,
|
1917
|
-
"metadata": metadata,
|
1918
|
-
},
|
1919
|
-
headers={
|
1920
|
-
"content-type": "application/json",
|
1921
|
-
},
|
1488
|
+
response = await self._raw_client.execute_prompt(
|
1489
|
+
inputs=inputs,
|
1490
|
+
prompt_deployment_id=prompt_deployment_id,
|
1491
|
+
prompt_deployment_name=prompt_deployment_name,
|
1492
|
+
release_tag=release_tag,
|
1493
|
+
external_id=external_id,
|
1494
|
+
expand_meta=expand_meta,
|
1495
|
+
raw_overrides=raw_overrides,
|
1496
|
+
expand_raw=expand_raw,
|
1497
|
+
metadata=metadata,
|
1922
1498
|
request_options=request_options,
|
1923
|
-
omit=OMIT,
|
1924
1499
|
)
|
1925
|
-
|
1926
|
-
if 200 <= _response.status_code < 300:
|
1927
|
-
return typing.cast(
|
1928
|
-
ExecutePromptResponse,
|
1929
|
-
parse_obj_as(
|
1930
|
-
type_=ExecutePromptResponse, # type: ignore
|
1931
|
-
object_=_response.json(),
|
1932
|
-
),
|
1933
|
-
)
|
1934
|
-
if _response.status_code == 400:
|
1935
|
-
raise BadRequestError(
|
1936
|
-
typing.cast(
|
1937
|
-
typing.Optional[typing.Any],
|
1938
|
-
parse_obj_as(
|
1939
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1940
|
-
object_=_response.json(),
|
1941
|
-
),
|
1942
|
-
)
|
1943
|
-
)
|
1944
|
-
if _response.status_code == 403:
|
1945
|
-
raise ForbiddenError(
|
1946
|
-
typing.cast(
|
1947
|
-
typing.Optional[typing.Any],
|
1948
|
-
parse_obj_as(
|
1949
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1950
|
-
object_=_response.json(),
|
1951
|
-
),
|
1952
|
-
)
|
1953
|
-
)
|
1954
|
-
if _response.status_code == 404:
|
1955
|
-
raise NotFoundError(
|
1956
|
-
typing.cast(
|
1957
|
-
typing.Optional[typing.Any],
|
1958
|
-
parse_obj_as(
|
1959
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1960
|
-
object_=_response.json(),
|
1961
|
-
),
|
1962
|
-
)
|
1963
|
-
)
|
1964
|
-
if _response.status_code == 500:
|
1965
|
-
raise InternalServerError(
|
1966
|
-
typing.cast(
|
1967
|
-
typing.Optional[typing.Any],
|
1968
|
-
parse_obj_as(
|
1969
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1970
|
-
object_=_response.json(),
|
1971
|
-
),
|
1972
|
-
)
|
1973
|
-
)
|
1974
|
-
_response_json = _response.json()
|
1975
|
-
except JSONDecodeError:
|
1976
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1977
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1500
|
+
return response.data
|
1978
1501
|
|
1979
1502
|
async def execute_prompt_stream(
|
1980
1503
|
self,
|
@@ -2061,9 +1584,9 @@ class AsyncVellum:
|
|
2061
1584
|
|
2062
1585
|
asyncio.run(main())
|
2063
1586
|
"""
|
2064
|
-
async with self._client_wrapper.httpx_client.stream(
|
1587
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2065
1588
|
"v1/execute-prompt-stream",
|
2066
|
-
base_url=self._client_wrapper.get_environment().predict,
|
1589
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2067
1590
|
method="POST",
|
2068
1591
|
json={
|
2069
1592
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -2229,72 +1752,17 @@ class AsyncVellum:
|
|
2229
1752
|
|
2230
1753
|
asyncio.run(main())
|
2231
1754
|
"""
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
2241
|
-
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
2242
|
-
),
|
2243
|
-
"workflow_deployment_id": workflow_deployment_id,
|
2244
|
-
"workflow_deployment_name": workflow_deployment_name,
|
2245
|
-
"release_tag": release_tag,
|
2246
|
-
"external_id": external_id,
|
2247
|
-
"metadata": metadata,
|
2248
|
-
},
|
2249
|
-
headers={
|
2250
|
-
"content-type": "application/json",
|
2251
|
-
},
|
1755
|
+
response = await self._raw_client.execute_workflow(
|
1756
|
+
inputs=inputs,
|
1757
|
+
expand_meta=expand_meta,
|
1758
|
+
workflow_deployment_id=workflow_deployment_id,
|
1759
|
+
workflow_deployment_name=workflow_deployment_name,
|
1760
|
+
release_tag=release_tag,
|
1761
|
+
external_id=external_id,
|
1762
|
+
metadata=metadata,
|
2252
1763
|
request_options=request_options,
|
2253
|
-
omit=OMIT,
|
2254
1764
|
)
|
2255
|
-
|
2256
|
-
if 200 <= _response.status_code < 300:
|
2257
|
-
return typing.cast(
|
2258
|
-
ExecuteWorkflowResponse,
|
2259
|
-
parse_obj_as(
|
2260
|
-
type_=ExecuteWorkflowResponse, # type: ignore
|
2261
|
-
object_=_response.json(),
|
2262
|
-
),
|
2263
|
-
)
|
2264
|
-
if _response.status_code == 400:
|
2265
|
-
raise BadRequestError(
|
2266
|
-
typing.cast(
|
2267
|
-
typing.Optional[typing.Any],
|
2268
|
-
parse_obj_as(
|
2269
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2270
|
-
object_=_response.json(),
|
2271
|
-
),
|
2272
|
-
)
|
2273
|
-
)
|
2274
|
-
if _response.status_code == 404:
|
2275
|
-
raise NotFoundError(
|
2276
|
-
typing.cast(
|
2277
|
-
typing.Optional[typing.Any],
|
2278
|
-
parse_obj_as(
|
2279
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2280
|
-
object_=_response.json(),
|
2281
|
-
),
|
2282
|
-
)
|
2283
|
-
)
|
2284
|
-
if _response.status_code == 500:
|
2285
|
-
raise InternalServerError(
|
2286
|
-
typing.cast(
|
2287
|
-
typing.Optional[typing.Any],
|
2288
|
-
parse_obj_as(
|
2289
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2290
|
-
object_=_response.json(),
|
2291
|
-
),
|
2292
|
-
)
|
2293
|
-
)
|
2294
|
-
_response_json = _response.json()
|
2295
|
-
except JSONDecodeError:
|
2296
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2297
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1765
|
+
return response.data
|
2298
1766
|
|
2299
1767
|
async def execute_workflow_stream(
|
2300
1768
|
self,
|
@@ -2377,9 +1845,9 @@ class AsyncVellum:
|
|
2377
1845
|
|
2378
1846
|
asyncio.run(main())
|
2379
1847
|
"""
|
2380
|
-
async with self._client_wrapper.httpx_client.stream(
|
1848
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2381
1849
|
"v1/execute-workflow-stream",
|
2382
|
-
base_url=self._client_wrapper.get_environment().predict,
|
1850
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2383
1851
|
method="POST",
|
2384
1852
|
json={
|
2385
1853
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -2517,79 +1985,14 @@ class AsyncVellum:
|
|
2517
1985
|
|
2518
1986
|
asyncio.run(main())
|
2519
1987
|
"""
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
2525
|
-
"deployment_id": deployment_id,
|
2526
|
-
"deployment_name": deployment_name,
|
2527
|
-
"requests": convert_and_respect_annotation_metadata(
|
2528
|
-
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
2529
|
-
),
|
2530
|
-
"options": convert_and_respect_annotation_metadata(
|
2531
|
-
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
2532
|
-
),
|
2533
|
-
},
|
2534
|
-
headers={
|
2535
|
-
"content-type": "application/json",
|
2536
|
-
},
|
1988
|
+
response = await self._raw_client.generate(
|
1989
|
+
requests=requests,
|
1990
|
+
deployment_id=deployment_id,
|
1991
|
+
deployment_name=deployment_name,
|
1992
|
+
options=options,
|
2537
1993
|
request_options=request_options,
|
2538
|
-
omit=OMIT,
|
2539
1994
|
)
|
2540
|
-
|
2541
|
-
if 200 <= _response.status_code < 300:
|
2542
|
-
return typing.cast(
|
2543
|
-
GenerateResponse,
|
2544
|
-
parse_obj_as(
|
2545
|
-
type_=GenerateResponse, # type: ignore
|
2546
|
-
object_=_response.json(),
|
2547
|
-
),
|
2548
|
-
)
|
2549
|
-
if _response.status_code == 400:
|
2550
|
-
raise BadRequestError(
|
2551
|
-
typing.cast(
|
2552
|
-
typing.Optional[typing.Any],
|
2553
|
-
parse_obj_as(
|
2554
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2555
|
-
object_=_response.json(),
|
2556
|
-
),
|
2557
|
-
)
|
2558
|
-
)
|
2559
|
-
if _response.status_code == 403:
|
2560
|
-
raise ForbiddenError(
|
2561
|
-
typing.cast(
|
2562
|
-
typing.Optional[typing.Any],
|
2563
|
-
parse_obj_as(
|
2564
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2565
|
-
object_=_response.json(),
|
2566
|
-
),
|
2567
|
-
)
|
2568
|
-
)
|
2569
|
-
if _response.status_code == 404:
|
2570
|
-
raise NotFoundError(
|
2571
|
-
typing.cast(
|
2572
|
-
typing.Optional[typing.Any],
|
2573
|
-
parse_obj_as(
|
2574
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2575
|
-
object_=_response.json(),
|
2576
|
-
),
|
2577
|
-
)
|
2578
|
-
)
|
2579
|
-
if _response.status_code == 500:
|
2580
|
-
raise InternalServerError(
|
2581
|
-
typing.cast(
|
2582
|
-
typing.Optional[typing.Any],
|
2583
|
-
parse_obj_as(
|
2584
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2585
|
-
object_=_response.json(),
|
2586
|
-
),
|
2587
|
-
)
|
2588
|
-
)
|
2589
|
-
_response_json = _response.json()
|
2590
|
-
except JSONDecodeError:
|
2591
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2592
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1995
|
+
return response.data
|
2593
1996
|
|
2594
1997
|
async def generate_stream(
|
2595
1998
|
self,
|
@@ -2657,9 +2060,9 @@ class AsyncVellum:
|
|
2657
2060
|
|
2658
2061
|
asyncio.run(main())
|
2659
2062
|
"""
|
2660
|
-
async with self._client_wrapper.httpx_client.stream(
|
2063
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2661
2064
|
"v1/generate-stream",
|
2662
|
-
base_url=self._client_wrapper.get_environment().predict,
|
2065
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2663
2066
|
method="POST",
|
2664
2067
|
json={
|
2665
2068
|
"deployment_id": deployment_id,
|
@@ -2797,68 +2200,15 @@ class AsyncVellum:
|
|
2797
2200
|
|
2798
2201
|
asyncio.run(main())
|
2799
2202
|
"""
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2806
|
-
"index_name": index_name,
|
2807
|
-
"query": query,
|
2808
|
-
"options": convert_and_respect_annotation_metadata(
|
2809
|
-
object_=options, annotation=typing.Optional[SearchRequestOptionsRequest], direction="write"
|
2810
|
-
),
|
2811
|
-
"document_index": document_index,
|
2812
|
-
},
|
2813
|
-
headers={
|
2814
|
-
"content-type": "application/json",
|
2815
|
-
},
|
2203
|
+
response = await self._raw_client.search(
|
2204
|
+
query=query,
|
2205
|
+
index_id=index_id,
|
2206
|
+
index_name=index_name,
|
2207
|
+
options=options,
|
2208
|
+
document_index=document_index,
|
2816
2209
|
request_options=request_options,
|
2817
|
-
omit=OMIT,
|
2818
2210
|
)
|
2819
|
-
|
2820
|
-
if 200 <= _response.status_code < 300:
|
2821
|
-
return typing.cast(
|
2822
|
-
SearchResponse,
|
2823
|
-
parse_obj_as(
|
2824
|
-
type_=SearchResponse, # type: ignore
|
2825
|
-
object_=_response.json(),
|
2826
|
-
),
|
2827
|
-
)
|
2828
|
-
if _response.status_code == 400:
|
2829
|
-
raise BadRequestError(
|
2830
|
-
typing.cast(
|
2831
|
-
typing.Optional[typing.Any],
|
2832
|
-
parse_obj_as(
|
2833
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2834
|
-
object_=_response.json(),
|
2835
|
-
),
|
2836
|
-
)
|
2837
|
-
)
|
2838
|
-
if _response.status_code == 404:
|
2839
|
-
raise NotFoundError(
|
2840
|
-
typing.cast(
|
2841
|
-
typing.Optional[typing.Any],
|
2842
|
-
parse_obj_as(
|
2843
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2844
|
-
object_=_response.json(),
|
2845
|
-
),
|
2846
|
-
)
|
2847
|
-
)
|
2848
|
-
if _response.status_code == 500:
|
2849
|
-
raise InternalServerError(
|
2850
|
-
typing.cast(
|
2851
|
-
typing.Optional[typing.Any],
|
2852
|
-
parse_obj_as(
|
2853
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2854
|
-
object_=_response.json(),
|
2855
|
-
),
|
2856
|
-
)
|
2857
|
-
)
|
2858
|
-
_response_json = _response.json()
|
2859
|
-
except JSONDecodeError:
|
2860
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2861
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2211
|
+
return response.data
|
2862
2212
|
|
2863
2213
|
async def submit_completion_actuals(
|
2864
2214
|
self,
|
@@ -2912,60 +2262,13 @@ class AsyncVellum:
|
|
2912
2262
|
|
2913
2263
|
asyncio.run(main())
|
2914
2264
|
"""
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
json={
|
2920
|
-
"deployment_id": deployment_id,
|
2921
|
-
"deployment_name": deployment_name,
|
2922
|
-
"actuals": convert_and_respect_annotation_metadata(
|
2923
|
-
object_=actuals, annotation=typing.Sequence[SubmitCompletionActualRequest], direction="write"
|
2924
|
-
),
|
2925
|
-
},
|
2926
|
-
headers={
|
2927
|
-
"content-type": "application/json",
|
2928
|
-
},
|
2265
|
+
response = await self._raw_client.submit_completion_actuals(
|
2266
|
+
actuals=actuals,
|
2267
|
+
deployment_id=deployment_id,
|
2268
|
+
deployment_name=deployment_name,
|
2929
2269
|
request_options=request_options,
|
2930
|
-
omit=OMIT,
|
2931
2270
|
)
|
2932
|
-
|
2933
|
-
if 200 <= _response.status_code < 300:
|
2934
|
-
return
|
2935
|
-
if _response.status_code == 400:
|
2936
|
-
raise BadRequestError(
|
2937
|
-
typing.cast(
|
2938
|
-
typing.Optional[typing.Any],
|
2939
|
-
parse_obj_as(
|
2940
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2941
|
-
object_=_response.json(),
|
2942
|
-
),
|
2943
|
-
)
|
2944
|
-
)
|
2945
|
-
if _response.status_code == 404:
|
2946
|
-
raise NotFoundError(
|
2947
|
-
typing.cast(
|
2948
|
-
typing.Optional[typing.Any],
|
2949
|
-
parse_obj_as(
|
2950
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2951
|
-
object_=_response.json(),
|
2952
|
-
),
|
2953
|
-
)
|
2954
|
-
)
|
2955
|
-
if _response.status_code == 500:
|
2956
|
-
raise InternalServerError(
|
2957
|
-
typing.cast(
|
2958
|
-
typing.Optional[typing.Any],
|
2959
|
-
parse_obj_as(
|
2960
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2961
|
-
object_=_response.json(),
|
2962
|
-
),
|
2963
|
-
)
|
2964
|
-
)
|
2965
|
-
_response_json = _response.json()
|
2966
|
-
except JSONDecodeError:
|
2967
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2968
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2271
|
+
return response.data
|
2969
2272
|
|
2970
2273
|
async def submit_workflow_execution_actuals(
|
2971
2274
|
self,
|
@@ -3021,27 +2324,10 @@ class AsyncVellum:
|
|
3021
2324
|
|
3022
2325
|
asyncio.run(main())
|
3023
2326
|
"""
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
json={
|
3029
|
-
"actuals": convert_and_respect_annotation_metadata(
|
3030
|
-
object_=actuals, annotation=typing.Sequence[SubmitWorkflowExecutionActualRequest], direction="write"
|
3031
|
-
),
|
3032
|
-
"execution_id": execution_id,
|
3033
|
-
"external_id": external_id,
|
3034
|
-
},
|
3035
|
-
headers={
|
3036
|
-
"content-type": "application/json",
|
3037
|
-
},
|
2327
|
+
response = await self._raw_client.submit_workflow_execution_actuals(
|
2328
|
+
actuals=actuals,
|
2329
|
+
execution_id=execution_id,
|
2330
|
+
external_id=external_id,
|
3038
2331
|
request_options=request_options,
|
3039
|
-
omit=OMIT,
|
3040
2332
|
)
|
3041
|
-
|
3042
|
-
if 200 <= _response.status_code < 300:
|
3043
|
-
return
|
3044
|
-
_response_json = _response.json()
|
3045
|
-
except JSONDecodeError:
|
3046
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
3047
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2333
|
+
return response.data
|