vellum-ai 1.0.11__py3-none-any.whl → 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vellum/__init__.py +2 -2
- vellum/client/README.md +0 -55
- vellum/client/__init__.py +159 -877
- vellum/client/core/__init__.py +3 -0
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/http_response.py +47 -0
- vellum/client/raw_client.py +1561 -0
- vellum/client/reference.md +22 -696
- vellum/client/resources/__init__.py +0 -2
- vellum/client/resources/ad_hoc/client.py +55 -161
- vellum/client/resources/ad_hoc/raw_client.py +278 -0
- vellum/client/resources/container_images/client.py +62 -172
- vellum/client/resources/container_images/raw_client.py +400 -0
- vellum/client/resources/deployments/client.py +112 -437
- vellum/client/resources/deployments/raw_client.py +995 -0
- vellum/client/resources/document_indexes/client.py +108 -317
- vellum/client/resources/document_indexes/raw_client.py +847 -0
- vellum/client/resources/documents/client.py +88 -285
- vellum/client/resources/documents/raw_client.py +655 -0
- vellum/client/resources/folder_entities/client.py +54 -92
- vellum/client/resources/folder_entities/raw_client.py +277 -0
- vellum/client/resources/metric_definitions/client.py +48 -95
- vellum/client/resources/metric_definitions/raw_client.py +225 -0
- vellum/client/resources/ml_models/client.py +36 -40
- vellum/client/resources/ml_models/raw_client.py +103 -0
- vellum/client/resources/organizations/client.py +34 -39
- vellum/client/resources/organizations/raw_client.py +96 -0
- vellum/client/resources/prompts/client.py +50 -193
- vellum/client/resources/prompts/raw_client.py +346 -0
- vellum/client/resources/sandboxes/client.py +68 -141
- vellum/client/resources/sandboxes/raw_client.py +393 -0
- vellum/client/resources/test_suite_runs/client.py +58 -141
- vellum/client/resources/test_suite_runs/raw_client.py +355 -0
- vellum/client/resources/test_suites/client.py +73 -141
- vellum/client/resources/test_suites/raw_client.py +379 -0
- vellum/client/resources/workflow_deployments/client.py +203 -328
- vellum/client/resources/workflow_deployments/raw_client.py +931 -0
- vellum/client/resources/workflow_executions/client.py +36 -40
- vellum/client/resources/workflow_executions/raw_client.py +97 -0
- vellum/client/resources/workflow_sandboxes/client.py +60 -108
- vellum/client/resources/workflow_sandboxes/raw_client.py +300 -0
- vellum/client/resources/workflows/client.py +68 -133
- vellum/client/resources/workflows/raw_client.py +307 -0
- vellum/client/resources/workspace_secrets/client.py +46 -90
- vellum/client/resources/workspace_secrets/raw_client.py +220 -0
- vellum/client/resources/workspaces/client.py +34 -39
- vellum/client/resources/workspaces/raw_client.py +96 -0
- vellum/client/types/__init__.py +2 -0
- vellum/client/types/api_request_parent_context.py +1 -0
- vellum/client/types/external_parent_context.py +36 -0
- vellum/client/types/node_execution_fulfilled_event.py +1 -0
- vellum/client/types/node_execution_initiated_event.py +1 -0
- vellum/client/types/node_execution_paused_event.py +1 -0
- vellum/client/types/node_execution_rejected_event.py +1 -0
- vellum/client/types/node_execution_resumed_event.py +1 -0
- vellum/client/types/node_execution_span.py +1 -0
- vellum/client/types/node_execution_span_attributes.py +1 -0
- vellum/client/types/node_execution_streaming_event.py +1 -0
- vellum/client/types/node_parent_context.py +1 -0
- vellum/client/types/parent_context.py +2 -0
- vellum/client/types/prompt_deployment_parent_context.py +1 -0
- vellum/client/types/slim_workflow_execution_read.py +1 -0
- vellum/client/types/span_link.py +1 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +1 -0
- vellum/client/types/workflow_deployment_parent_context.py +1 -0
- vellum/client/types/workflow_event_execution_read.py +1 -0
- vellum/client/types/workflow_execution_detail.py +1 -0
- vellum/client/types/workflow_execution_fulfilled_event.py +1 -0
- vellum/client/types/workflow_execution_initiated_event.py +1 -0
- vellum/client/types/workflow_execution_paused_event.py +1 -0
- vellum/client/types/workflow_execution_rejected_event.py +1 -0
- vellum/client/types/workflow_execution_resumed_event.py +1 -0
- vellum/client/types/workflow_execution_snapshotted_event.py +1 -0
- vellum/client/types/workflow_execution_span.py +1 -0
- vellum/client/types/workflow_execution_span_attributes.py +1 -0
- vellum/client/types/workflow_execution_streaming_event.py +1 -0
- vellum/client/types/workflow_parent_context.py +1 -0
- vellum/client/types/workflow_sandbox_parent_context.py +1 -0
- vellum/{resources/release_reviews/__init__.py → core/http_response.py} +1 -1
- vellum/{resources/release_reviews/client.py → raw_client.py} +1 -1
- vellum/resources/ad_hoc/raw_client.py +3 -0
- vellum/resources/container_images/raw_client.py +3 -0
- vellum/resources/deployments/raw_client.py +3 -0
- vellum/resources/document_indexes/raw_client.py +3 -0
- vellum/resources/documents/raw_client.py +3 -0
- vellum/resources/folder_entities/raw_client.py +3 -0
- vellum/resources/metric_definitions/raw_client.py +3 -0
- vellum/resources/ml_models/raw_client.py +3 -0
- vellum/resources/organizations/raw_client.py +3 -0
- vellum/resources/prompts/raw_client.py +3 -0
- vellum/resources/sandboxes/raw_client.py +3 -0
- vellum/resources/test_suite_runs/raw_client.py +3 -0
- vellum/resources/test_suites/raw_client.py +3 -0
- vellum/resources/workflow_deployments/raw_client.py +3 -0
- vellum/resources/workflow_executions/raw_client.py +3 -0
- vellum/resources/workflow_sandboxes/raw_client.py +3 -0
- vellum/resources/workflows/raw_client.py +3 -0
- vellum/resources/workspace_secrets/raw_client.py +3 -0
- vellum/resources/workspaces/raw_client.py +3 -0
- vellum/types/external_parent_context.py +3 -0
- vellum/workflows/emitters/vellum_emitter.py +3 -2
- vellum/workflows/events/types.py +6 -0
- vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +5 -15
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +6 -0
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +75 -0
- vellum/workflows/state/context.py +13 -2
- vellum/workflows/types/definition.py +2 -2
- vellum/workflows/types/tests/test_definition.py +2 -3
- vellum/workflows/utils/functions.py +1 -1
- vellum/workflows/utils/tests/test_functions.py +3 -3
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/METADATA +1 -1
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/RECORD +123 -81
- vellum_ee/workflows/display/exceptions.py +7 -0
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +2 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +53 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +93 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +98 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py +1 -1
- vellum_ee/workflows/display/utils/expressions.py +1 -1
- vellum_ee/workflows/display/workflows/base_workflow_display.py +2 -1
- vellum/client/resources/release_reviews/__init__.py +0 -2
- vellum/client/resources/release_reviews/client.py +0 -139
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/LICENSE +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/WHEEL +0 -0
- {vellum_ai-1.0.11.dist-info → vellum_ai-1.1.1.dist-info}/entry_points.txt +0 -0
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
|
@@ -20,7 +21,6 @@ from .resources.sandboxes.client import SandboxesClient
|
|
20
21
|
from .resources.test_suite_runs.client import TestSuiteRunsClient
|
21
22
|
from .resources.test_suites.client import TestSuitesClient
|
22
23
|
from .resources.workflow_deployments.client import WorkflowDeploymentsClient
|
23
|
-
from .resources.release_reviews.client import ReleaseReviewsClient
|
24
24
|
from .resources.workflow_executions.client import WorkflowExecutionsClient
|
25
25
|
from .resources.workflow_sandboxes.client import WorkflowSandboxesClient
|
26
26
|
from .resources.workflows.client import WorkflowsClient
|
@@ -32,25 +32,25 @@ from .types.execute_api_request_headers_value import ExecuteApiRequestHeadersVal
|
|
32
32
|
from .types.execute_api_request_bearer_token import ExecuteApiRequestBearerToken
|
33
33
|
from .core.request_options import RequestOptions
|
34
34
|
from .types.execute_api_response import ExecuteApiResponse
|
35
|
-
from .core.serialization import convert_and_respect_annotation_metadata
|
36
|
-
from .core.pydantic_utilities import parse_obj_as
|
37
|
-
from json.decoder import JSONDecodeError
|
38
|
-
from .core.api_error import ApiError
|
39
35
|
from .types.code_execution_runtime import CodeExecutionRuntime
|
40
36
|
from .types.code_executor_input import CodeExecutorInput
|
41
37
|
from .types.code_execution_package import CodeExecutionPackage
|
42
38
|
from .types.vellum_variable_type import VellumVariableType
|
43
39
|
from .types.code_executor_response import CodeExecutorResponse
|
44
|
-
from .errors.bad_request_error import BadRequestError
|
45
40
|
from .types.prompt_deployment_input_request import PromptDeploymentInputRequest
|
46
41
|
from .types.prompt_deployment_expand_meta_request import PromptDeploymentExpandMetaRequest
|
47
42
|
from .types.raw_prompt_execution_overrides_request import RawPromptExecutionOverridesRequest
|
48
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
|
49
49
|
from .errors.forbidden_error import ForbiddenError
|
50
50
|
from .errors.not_found_error import NotFoundError
|
51
51
|
from .errors.internal_server_error import InternalServerError
|
52
|
-
from .
|
53
|
-
import
|
52
|
+
from json.decoder import JSONDecodeError
|
53
|
+
from .core.api_error import ApiError
|
54
54
|
from .types.workflow_request_input_request import WorkflowRequestInputRequest
|
55
55
|
from .types.workflow_expand_meta_request import WorkflowExpandMetaRequest
|
56
56
|
from .types.execute_workflow_response import ExecuteWorkflowResponse
|
@@ -65,6 +65,7 @@ from .types.search_response import SearchResponse
|
|
65
65
|
from .types.submit_completion_actual_request import SubmitCompletionActualRequest
|
66
66
|
from .types.submit_workflow_execution_actual_request import SubmitWorkflowExecutionActualRequest
|
67
67
|
from .core.client_wrapper import AsyncClientWrapper
|
68
|
+
from .raw_client import AsyncRawVellum
|
68
69
|
from .resources.ad_hoc.client import AsyncAdHocClient
|
69
70
|
from .resources.container_images.client import AsyncContainerImagesClient
|
70
71
|
from .resources.deployments.client import AsyncDeploymentsClient
|
@@ -79,7 +80,6 @@ from .resources.sandboxes.client import AsyncSandboxesClient
|
|
79
80
|
from .resources.test_suite_runs.client import AsyncTestSuiteRunsClient
|
80
81
|
from .resources.test_suites.client import AsyncTestSuitesClient
|
81
82
|
from .resources.workflow_deployments.client import AsyncWorkflowDeploymentsClient
|
82
|
-
from .resources.release_reviews.client import AsyncReleaseReviewsClient
|
83
83
|
from .resources.workflow_executions.client import AsyncWorkflowExecutionsClient
|
84
84
|
from .resources.workflow_sandboxes.client import AsyncWorkflowSandboxesClient
|
85
85
|
from .resources.workflows.client import AsyncWorkflowsClient
|
@@ -150,6 +150,7 @@ class Vellum:
|
|
150
150
|
else httpx.Client(timeout=_defaulted_timeout),
|
151
151
|
timeout=_defaulted_timeout,
|
152
152
|
)
|
153
|
+
self._raw_client = RawVellum(client_wrapper=self._client_wrapper)
|
153
154
|
self.ad_hoc = AdHocClient(client_wrapper=self._client_wrapper)
|
154
155
|
self.container_images = ContainerImagesClient(client_wrapper=self._client_wrapper)
|
155
156
|
self.deployments = DeploymentsClient(client_wrapper=self._client_wrapper)
|
@@ -164,13 +165,23 @@ class Vellum:
|
|
164
165
|
self.test_suite_runs = TestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
165
166
|
self.test_suites = TestSuitesClient(client_wrapper=self._client_wrapper)
|
166
167
|
self.workflow_deployments = WorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
167
|
-
self.release_reviews = ReleaseReviewsClient(client_wrapper=self._client_wrapper)
|
168
168
|
self.workflow_executions = WorkflowExecutionsClient(client_wrapper=self._client_wrapper)
|
169
169
|
self.workflow_sandboxes = WorkflowSandboxesClient(client_wrapper=self._client_wrapper)
|
170
170
|
self.workflows = WorkflowsClient(client_wrapper=self._client_wrapper)
|
171
171
|
self.workspace_secrets = WorkspaceSecretsClient(client_wrapper=self._client_wrapper)
|
172
172
|
self.workspaces = WorkspacesClient(client_wrapper=self._client_wrapper)
|
173
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
|
+
|
174
185
|
def execute_api(
|
175
186
|
self,
|
176
187
|
*,
|
@@ -214,42 +225,15 @@ class Vellum:
|
|
214
225
|
url="x",
|
215
226
|
)
|
216
227
|
"""
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
"method": method,
|
224
|
-
"body": convert_and_respect_annotation_metadata(
|
225
|
-
object_=body, annotation=typing.Optional[ExecuteApiRequestBody], direction="write"
|
226
|
-
),
|
227
|
-
"headers": convert_and_respect_annotation_metadata(
|
228
|
-
object_=headers, annotation=typing.Dict[str, ExecuteApiRequestHeadersValue], direction="write"
|
229
|
-
),
|
230
|
-
"bearer_token": convert_and_respect_annotation_metadata(
|
231
|
-
object_=bearer_token, annotation=typing.Optional[ExecuteApiRequestBearerToken], direction="write"
|
232
|
-
),
|
233
|
-
},
|
234
|
-
headers={
|
235
|
-
"content-type": "application/json",
|
236
|
-
},
|
228
|
+
response = self._raw_client.execute_api(
|
229
|
+
url=url,
|
230
|
+
method=method,
|
231
|
+
body=body,
|
232
|
+
headers=headers,
|
233
|
+
bearer_token=bearer_token,
|
237
234
|
request_options=request_options,
|
238
|
-
omit=OMIT,
|
239
235
|
)
|
240
|
-
|
241
|
-
if 200 <= _response.status_code < 300:
|
242
|
-
return typing.cast(
|
243
|
-
ExecuteApiResponse,
|
244
|
-
parse_obj_as(
|
245
|
-
type_=ExecuteApiResponse, # type: ignore
|
246
|
-
object_=_response.json(),
|
247
|
-
),
|
248
|
-
)
|
249
|
-
_response_json = _response.json()
|
250
|
-
except JSONDecodeError:
|
251
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
252
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
236
|
+
return response.data
|
253
237
|
|
254
238
|
def execute_code(
|
255
239
|
self,
|
@@ -316,50 +300,15 @@ class Vellum:
|
|
316
300
|
output_type="STRING",
|
317
301
|
)
|
318
302
|
"""
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
"runtime": runtime,
|
326
|
-
"input_values": convert_and_respect_annotation_metadata(
|
327
|
-
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
328
|
-
),
|
329
|
-
"packages": convert_and_respect_annotation_metadata(
|
330
|
-
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
331
|
-
),
|
332
|
-
"output_type": output_type,
|
333
|
-
},
|
334
|
-
headers={
|
335
|
-
"content-type": "application/json",
|
336
|
-
},
|
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,
|
337
309
|
request_options=request_options,
|
338
|
-
omit=OMIT,
|
339
310
|
)
|
340
|
-
|
341
|
-
if 200 <= _response.status_code < 300:
|
342
|
-
return typing.cast(
|
343
|
-
CodeExecutorResponse,
|
344
|
-
parse_obj_as(
|
345
|
-
type_=CodeExecutorResponse, # type: ignore
|
346
|
-
object_=_response.json(),
|
347
|
-
),
|
348
|
-
)
|
349
|
-
if _response.status_code == 400:
|
350
|
-
raise BadRequestError(
|
351
|
-
typing.cast(
|
352
|
-
typing.Optional[typing.Any],
|
353
|
-
parse_obj_as(
|
354
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
355
|
-
object_=_response.json(),
|
356
|
-
),
|
357
|
-
)
|
358
|
-
)
|
359
|
-
_response_json = _response.json()
|
360
|
-
except JSONDecodeError:
|
361
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
362
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
311
|
+
return response.data
|
363
312
|
|
364
313
|
def execute_prompt(
|
365
314
|
self,
|
@@ -436,90 +385,19 @@ class Vellum:
|
|
436
385
|
],
|
437
386
|
)
|
438
387
|
"""
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
"release_tag": release_tag,
|
450
|
-
"external_id": external_id,
|
451
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
452
|
-
object_=expand_meta,
|
453
|
-
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
454
|
-
direction="write",
|
455
|
-
),
|
456
|
-
"raw_overrides": convert_and_respect_annotation_metadata(
|
457
|
-
object_=raw_overrides,
|
458
|
-
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
459
|
-
direction="write",
|
460
|
-
),
|
461
|
-
"expand_raw": expand_raw,
|
462
|
-
"metadata": metadata,
|
463
|
-
},
|
464
|
-
headers={
|
465
|
-
"content-type": "application/json",
|
466
|
-
},
|
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,
|
467
398
|
request_options=request_options,
|
468
|
-
omit=OMIT,
|
469
399
|
)
|
470
|
-
|
471
|
-
if 200 <= _response.status_code < 300:
|
472
|
-
return typing.cast(
|
473
|
-
ExecutePromptResponse,
|
474
|
-
parse_obj_as(
|
475
|
-
type_=ExecutePromptResponse, # type: ignore
|
476
|
-
object_=_response.json(),
|
477
|
-
),
|
478
|
-
)
|
479
|
-
if _response.status_code == 400:
|
480
|
-
raise BadRequestError(
|
481
|
-
typing.cast(
|
482
|
-
typing.Optional[typing.Any],
|
483
|
-
parse_obj_as(
|
484
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
485
|
-
object_=_response.json(),
|
486
|
-
),
|
487
|
-
)
|
488
|
-
)
|
489
|
-
if _response.status_code == 403:
|
490
|
-
raise ForbiddenError(
|
491
|
-
typing.cast(
|
492
|
-
typing.Optional[typing.Any],
|
493
|
-
parse_obj_as(
|
494
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
495
|
-
object_=_response.json(),
|
496
|
-
),
|
497
|
-
)
|
498
|
-
)
|
499
|
-
if _response.status_code == 404:
|
500
|
-
raise NotFoundError(
|
501
|
-
typing.cast(
|
502
|
-
typing.Optional[typing.Any],
|
503
|
-
parse_obj_as(
|
504
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
505
|
-
object_=_response.json(),
|
506
|
-
),
|
507
|
-
)
|
508
|
-
)
|
509
|
-
if _response.status_code == 500:
|
510
|
-
raise InternalServerError(
|
511
|
-
typing.cast(
|
512
|
-
typing.Optional[typing.Any],
|
513
|
-
parse_obj_as(
|
514
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
515
|
-
object_=_response.json(),
|
516
|
-
),
|
517
|
-
)
|
518
|
-
)
|
519
|
-
_response_json = _response.json()
|
520
|
-
except JSONDecodeError:
|
521
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
522
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
400
|
+
return response.data
|
523
401
|
|
524
402
|
def execute_prompt_stream(
|
525
403
|
self,
|
@@ -598,9 +476,9 @@ class Vellum:
|
|
598
476
|
for chunk in response:
|
599
477
|
yield chunk
|
600
478
|
"""
|
601
|
-
with self._client_wrapper.httpx_client.stream(
|
479
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
602
480
|
"v1/execute-prompt-stream",
|
603
|
-
base_url=self._client_wrapper.get_environment().predict,
|
481
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
604
482
|
method="POST",
|
605
483
|
json={
|
606
484
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -758,72 +636,17 @@ class Vellum:
|
|
758
636
|
],
|
759
637
|
)
|
760
638
|
"""
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
770
|
-
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
771
|
-
),
|
772
|
-
"workflow_deployment_id": workflow_deployment_id,
|
773
|
-
"workflow_deployment_name": workflow_deployment_name,
|
774
|
-
"release_tag": release_tag,
|
775
|
-
"external_id": external_id,
|
776
|
-
"metadata": metadata,
|
777
|
-
},
|
778
|
-
headers={
|
779
|
-
"content-type": "application/json",
|
780
|
-
},
|
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,
|
781
647
|
request_options=request_options,
|
782
|
-
omit=OMIT,
|
783
648
|
)
|
784
|
-
|
785
|
-
if 200 <= _response.status_code < 300:
|
786
|
-
return typing.cast(
|
787
|
-
ExecuteWorkflowResponse,
|
788
|
-
parse_obj_as(
|
789
|
-
type_=ExecuteWorkflowResponse, # type: ignore
|
790
|
-
object_=_response.json(),
|
791
|
-
),
|
792
|
-
)
|
793
|
-
if _response.status_code == 400:
|
794
|
-
raise BadRequestError(
|
795
|
-
typing.cast(
|
796
|
-
typing.Optional[typing.Any],
|
797
|
-
parse_obj_as(
|
798
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
799
|
-
object_=_response.json(),
|
800
|
-
),
|
801
|
-
)
|
802
|
-
)
|
803
|
-
if _response.status_code == 404:
|
804
|
-
raise NotFoundError(
|
805
|
-
typing.cast(
|
806
|
-
typing.Optional[typing.Any],
|
807
|
-
parse_obj_as(
|
808
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
809
|
-
object_=_response.json(),
|
810
|
-
),
|
811
|
-
)
|
812
|
-
)
|
813
|
-
if _response.status_code == 500:
|
814
|
-
raise InternalServerError(
|
815
|
-
typing.cast(
|
816
|
-
typing.Optional[typing.Any],
|
817
|
-
parse_obj_as(
|
818
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
819
|
-
object_=_response.json(),
|
820
|
-
),
|
821
|
-
)
|
822
|
-
)
|
823
|
-
_response_json = _response.json()
|
824
|
-
except JSONDecodeError:
|
825
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
826
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
649
|
+
return response.data
|
827
650
|
|
828
651
|
def execute_workflow_stream(
|
829
652
|
self,
|
@@ -898,9 +721,9 @@ class Vellum:
|
|
898
721
|
for chunk in response:
|
899
722
|
yield chunk
|
900
723
|
"""
|
901
|
-
with self._client_wrapper.httpx_client.stream(
|
724
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
902
725
|
"v1/execute-workflow-stream",
|
903
|
-
base_url=self._client_wrapper.get_environment().predict,
|
726
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
904
727
|
method="POST",
|
905
728
|
json={
|
906
729
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -1030,79 +853,14 @@ class Vellum:
|
|
1030
853
|
],
|
1031
854
|
)
|
1032
855
|
"""
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
"deployment_id": deployment_id,
|
1039
|
-
"deployment_name": deployment_name,
|
1040
|
-
"requests": convert_and_respect_annotation_metadata(
|
1041
|
-
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
1042
|
-
),
|
1043
|
-
"options": convert_and_respect_annotation_metadata(
|
1044
|
-
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
1045
|
-
),
|
1046
|
-
},
|
1047
|
-
headers={
|
1048
|
-
"content-type": "application/json",
|
1049
|
-
},
|
856
|
+
response = self._raw_client.generate(
|
857
|
+
requests=requests,
|
858
|
+
deployment_id=deployment_id,
|
859
|
+
deployment_name=deployment_name,
|
860
|
+
options=options,
|
1050
861
|
request_options=request_options,
|
1051
|
-
omit=OMIT,
|
1052
862
|
)
|
1053
|
-
|
1054
|
-
if 200 <= _response.status_code < 300:
|
1055
|
-
return typing.cast(
|
1056
|
-
GenerateResponse,
|
1057
|
-
parse_obj_as(
|
1058
|
-
type_=GenerateResponse, # type: ignore
|
1059
|
-
object_=_response.json(),
|
1060
|
-
),
|
1061
|
-
)
|
1062
|
-
if _response.status_code == 400:
|
1063
|
-
raise BadRequestError(
|
1064
|
-
typing.cast(
|
1065
|
-
typing.Optional[typing.Any],
|
1066
|
-
parse_obj_as(
|
1067
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1068
|
-
object_=_response.json(),
|
1069
|
-
),
|
1070
|
-
)
|
1071
|
-
)
|
1072
|
-
if _response.status_code == 403:
|
1073
|
-
raise ForbiddenError(
|
1074
|
-
typing.cast(
|
1075
|
-
typing.Optional[typing.Any],
|
1076
|
-
parse_obj_as(
|
1077
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1078
|
-
object_=_response.json(),
|
1079
|
-
),
|
1080
|
-
)
|
1081
|
-
)
|
1082
|
-
if _response.status_code == 404:
|
1083
|
-
raise NotFoundError(
|
1084
|
-
typing.cast(
|
1085
|
-
typing.Optional[typing.Any],
|
1086
|
-
parse_obj_as(
|
1087
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1088
|
-
object_=_response.json(),
|
1089
|
-
),
|
1090
|
-
)
|
1091
|
-
)
|
1092
|
-
if _response.status_code == 500:
|
1093
|
-
raise InternalServerError(
|
1094
|
-
typing.cast(
|
1095
|
-
typing.Optional[typing.Any],
|
1096
|
-
parse_obj_as(
|
1097
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1098
|
-
object_=_response.json(),
|
1099
|
-
),
|
1100
|
-
)
|
1101
|
-
)
|
1102
|
-
_response_json = _response.json()
|
1103
|
-
except JSONDecodeError:
|
1104
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1105
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
863
|
+
return response.data
|
1106
864
|
|
1107
865
|
def generate_stream(
|
1108
866
|
self,
|
@@ -1162,9 +920,9 @@ class Vellum:
|
|
1162
920
|
for chunk in response:
|
1163
921
|
yield chunk
|
1164
922
|
"""
|
1165
|
-
with self._client_wrapper.httpx_client.stream(
|
923
|
+
with self._raw_client._client_wrapper.httpx_client.stream(
|
1166
924
|
"v1/generate-stream",
|
1167
|
-
base_url=self._client_wrapper.get_environment().predict,
|
925
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
1168
926
|
method="POST",
|
1169
927
|
json={
|
1170
928
|
"deployment_id": deployment_id,
|
@@ -1294,68 +1052,15 @@ class Vellum:
|
|
1294
1052
|
query="x",
|
1295
1053
|
)
|
1296
1054
|
"""
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
"index_name": index_name,
|
1304
|
-
"query": query,
|
1305
|
-
"options": convert_and_respect_annotation_metadata(
|
1306
|
-
object_=options, annotation=typing.Optional[SearchRequestOptionsRequest], direction="write"
|
1307
|
-
),
|
1308
|
-
"document_index": document_index,
|
1309
|
-
},
|
1310
|
-
headers={
|
1311
|
-
"content-type": "application/json",
|
1312
|
-
},
|
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,
|
1313
1061
|
request_options=request_options,
|
1314
|
-
omit=OMIT,
|
1315
1062
|
)
|
1316
|
-
|
1317
|
-
if 200 <= _response.status_code < 300:
|
1318
|
-
return typing.cast(
|
1319
|
-
SearchResponse,
|
1320
|
-
parse_obj_as(
|
1321
|
-
type_=SearchResponse, # type: ignore
|
1322
|
-
object_=_response.json(),
|
1323
|
-
),
|
1324
|
-
)
|
1325
|
-
if _response.status_code == 400:
|
1326
|
-
raise BadRequestError(
|
1327
|
-
typing.cast(
|
1328
|
-
typing.Optional[typing.Any],
|
1329
|
-
parse_obj_as(
|
1330
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1331
|
-
object_=_response.json(),
|
1332
|
-
),
|
1333
|
-
)
|
1334
|
-
)
|
1335
|
-
if _response.status_code == 404:
|
1336
|
-
raise NotFoundError(
|
1337
|
-
typing.cast(
|
1338
|
-
typing.Optional[typing.Any],
|
1339
|
-
parse_obj_as(
|
1340
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1341
|
-
object_=_response.json(),
|
1342
|
-
),
|
1343
|
-
)
|
1344
|
-
)
|
1345
|
-
if _response.status_code == 500:
|
1346
|
-
raise InternalServerError(
|
1347
|
-
typing.cast(
|
1348
|
-
typing.Optional[typing.Any],
|
1349
|
-
parse_obj_as(
|
1350
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1351
|
-
object_=_response.json(),
|
1352
|
-
),
|
1353
|
-
)
|
1354
|
-
)
|
1355
|
-
_response_json = _response.json()
|
1356
|
-
except JSONDecodeError:
|
1357
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1358
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1063
|
+
return response.data
|
1359
1064
|
|
1360
1065
|
def submit_completion_actuals(
|
1361
1066
|
self,
|
@@ -1398,60 +1103,13 @@ class Vellum:
|
|
1398
1103
|
actuals=[SubmitCompletionActualRequest(), SubmitCompletionActualRequest()],
|
1399
1104
|
)
|
1400
1105
|
"""
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
json={
|
1406
|
-
"deployment_id": deployment_id,
|
1407
|
-
"deployment_name": deployment_name,
|
1408
|
-
"actuals": convert_and_respect_annotation_metadata(
|
1409
|
-
object_=actuals, annotation=typing.Sequence[SubmitCompletionActualRequest], direction="write"
|
1410
|
-
),
|
1411
|
-
},
|
1412
|
-
headers={
|
1413
|
-
"content-type": "application/json",
|
1414
|
-
},
|
1106
|
+
response = self._raw_client.submit_completion_actuals(
|
1107
|
+
actuals=actuals,
|
1108
|
+
deployment_id=deployment_id,
|
1109
|
+
deployment_name=deployment_name,
|
1415
1110
|
request_options=request_options,
|
1416
|
-
omit=OMIT,
|
1417
1111
|
)
|
1418
|
-
|
1419
|
-
if 200 <= _response.status_code < 300:
|
1420
|
-
return
|
1421
|
-
if _response.status_code == 400:
|
1422
|
-
raise BadRequestError(
|
1423
|
-
typing.cast(
|
1424
|
-
typing.Optional[typing.Any],
|
1425
|
-
parse_obj_as(
|
1426
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1427
|
-
object_=_response.json(),
|
1428
|
-
),
|
1429
|
-
)
|
1430
|
-
)
|
1431
|
-
if _response.status_code == 404:
|
1432
|
-
raise NotFoundError(
|
1433
|
-
typing.cast(
|
1434
|
-
typing.Optional[typing.Any],
|
1435
|
-
parse_obj_as(
|
1436
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1437
|
-
object_=_response.json(),
|
1438
|
-
),
|
1439
|
-
)
|
1440
|
-
)
|
1441
|
-
if _response.status_code == 500:
|
1442
|
-
raise InternalServerError(
|
1443
|
-
typing.cast(
|
1444
|
-
typing.Optional[typing.Any],
|
1445
|
-
parse_obj_as(
|
1446
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1447
|
-
object_=_response.json(),
|
1448
|
-
),
|
1449
|
-
)
|
1450
|
-
)
|
1451
|
-
_response_json = _response.json()
|
1452
|
-
except JSONDecodeError:
|
1453
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1454
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1112
|
+
return response.data
|
1455
1113
|
|
1456
1114
|
def submit_workflow_execution_actuals(
|
1457
1115
|
self,
|
@@ -1499,30 +1157,13 @@ class Vellum:
|
|
1499
1157
|
],
|
1500
1158
|
)
|
1501
1159
|
"""
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
json={
|
1507
|
-
"actuals": convert_and_respect_annotation_metadata(
|
1508
|
-
object_=actuals, annotation=typing.Sequence[SubmitWorkflowExecutionActualRequest], direction="write"
|
1509
|
-
),
|
1510
|
-
"execution_id": execution_id,
|
1511
|
-
"external_id": external_id,
|
1512
|
-
},
|
1513
|
-
headers={
|
1514
|
-
"content-type": "application/json",
|
1515
|
-
},
|
1160
|
+
response = self._raw_client.submit_workflow_execution_actuals(
|
1161
|
+
actuals=actuals,
|
1162
|
+
execution_id=execution_id,
|
1163
|
+
external_id=external_id,
|
1516
1164
|
request_options=request_options,
|
1517
|
-
omit=OMIT,
|
1518
1165
|
)
|
1519
|
-
|
1520
|
-
if 200 <= _response.status_code < 300:
|
1521
|
-
return
|
1522
|
-
_response_json = _response.json()
|
1523
|
-
except JSONDecodeError:
|
1524
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1525
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1166
|
+
return response.data
|
1526
1167
|
|
1527
1168
|
|
1528
1169
|
class AsyncVellum:
|
@@ -1585,6 +1226,7 @@ class AsyncVellum:
|
|
1585
1226
|
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
1586
1227
|
timeout=_defaulted_timeout,
|
1587
1228
|
)
|
1229
|
+
self._raw_client = AsyncRawVellum(client_wrapper=self._client_wrapper)
|
1588
1230
|
self.ad_hoc = AsyncAdHocClient(client_wrapper=self._client_wrapper)
|
1589
1231
|
self.container_images = AsyncContainerImagesClient(client_wrapper=self._client_wrapper)
|
1590
1232
|
self.deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper)
|
@@ -1599,13 +1241,23 @@ class AsyncVellum:
|
|
1599
1241
|
self.test_suite_runs = AsyncTestSuiteRunsClient(client_wrapper=self._client_wrapper)
|
1600
1242
|
self.test_suites = AsyncTestSuitesClient(client_wrapper=self._client_wrapper)
|
1601
1243
|
self.workflow_deployments = AsyncWorkflowDeploymentsClient(client_wrapper=self._client_wrapper)
|
1602
|
-
self.release_reviews = AsyncReleaseReviewsClient(client_wrapper=self._client_wrapper)
|
1603
1244
|
self.workflow_executions = AsyncWorkflowExecutionsClient(client_wrapper=self._client_wrapper)
|
1604
1245
|
self.workflow_sandboxes = AsyncWorkflowSandboxesClient(client_wrapper=self._client_wrapper)
|
1605
1246
|
self.workflows = AsyncWorkflowsClient(client_wrapper=self._client_wrapper)
|
1606
1247
|
self.workspace_secrets = AsyncWorkspaceSecretsClient(client_wrapper=self._client_wrapper)
|
1607
1248
|
self.workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper)
|
1608
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
|
+
|
1609
1261
|
async def execute_api(
|
1610
1262
|
self,
|
1611
1263
|
*,
|
@@ -1657,42 +1309,15 @@ class AsyncVellum:
|
|
1657
1309
|
|
1658
1310
|
asyncio.run(main())
|
1659
1311
|
"""
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
"method": method,
|
1667
|
-
"body": convert_and_respect_annotation_metadata(
|
1668
|
-
object_=body, annotation=typing.Optional[ExecuteApiRequestBody], direction="write"
|
1669
|
-
),
|
1670
|
-
"headers": convert_and_respect_annotation_metadata(
|
1671
|
-
object_=headers, annotation=typing.Dict[str, ExecuteApiRequestHeadersValue], direction="write"
|
1672
|
-
),
|
1673
|
-
"bearer_token": convert_and_respect_annotation_metadata(
|
1674
|
-
object_=bearer_token, annotation=typing.Optional[ExecuteApiRequestBearerToken], direction="write"
|
1675
|
-
),
|
1676
|
-
},
|
1677
|
-
headers={
|
1678
|
-
"content-type": "application/json",
|
1679
|
-
},
|
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,
|
1680
1318
|
request_options=request_options,
|
1681
|
-
omit=OMIT,
|
1682
1319
|
)
|
1683
|
-
|
1684
|
-
if 200 <= _response.status_code < 300:
|
1685
|
-
return typing.cast(
|
1686
|
-
ExecuteApiResponse,
|
1687
|
-
parse_obj_as(
|
1688
|
-
type_=ExecuteApiResponse, # type: ignore
|
1689
|
-
object_=_response.json(),
|
1690
|
-
),
|
1691
|
-
)
|
1692
|
-
_response_json = _response.json()
|
1693
|
-
except JSONDecodeError:
|
1694
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1695
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1320
|
+
return response.data
|
1696
1321
|
|
1697
1322
|
async def execute_code(
|
1698
1323
|
self,
|
@@ -1767,50 +1392,15 @@ class AsyncVellum:
|
|
1767
1392
|
|
1768
1393
|
asyncio.run(main())
|
1769
1394
|
"""
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
"runtime": runtime,
|
1777
|
-
"input_values": convert_and_respect_annotation_metadata(
|
1778
|
-
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
1779
|
-
),
|
1780
|
-
"packages": convert_and_respect_annotation_metadata(
|
1781
|
-
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
1782
|
-
),
|
1783
|
-
"output_type": output_type,
|
1784
|
-
},
|
1785
|
-
headers={
|
1786
|
-
"content-type": "application/json",
|
1787
|
-
},
|
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,
|
1788
1401
|
request_options=request_options,
|
1789
|
-
omit=OMIT,
|
1790
1402
|
)
|
1791
|
-
|
1792
|
-
if 200 <= _response.status_code < 300:
|
1793
|
-
return typing.cast(
|
1794
|
-
CodeExecutorResponse,
|
1795
|
-
parse_obj_as(
|
1796
|
-
type_=CodeExecutorResponse, # type: ignore
|
1797
|
-
object_=_response.json(),
|
1798
|
-
),
|
1799
|
-
)
|
1800
|
-
if _response.status_code == 400:
|
1801
|
-
raise BadRequestError(
|
1802
|
-
typing.cast(
|
1803
|
-
typing.Optional[typing.Any],
|
1804
|
-
parse_obj_as(
|
1805
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1806
|
-
object_=_response.json(),
|
1807
|
-
),
|
1808
|
-
)
|
1809
|
-
)
|
1810
|
-
_response_json = _response.json()
|
1811
|
-
except JSONDecodeError:
|
1812
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1813
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1403
|
+
return response.data
|
1814
1404
|
|
1815
1405
|
async def execute_prompt(
|
1816
1406
|
self,
|
@@ -1895,90 +1485,19 @@ class AsyncVellum:
|
|
1895
1485
|
|
1896
1486
|
asyncio.run(main())
|
1897
1487
|
"""
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
"release_tag": release_tag,
|
1909
|
-
"external_id": external_id,
|
1910
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
1911
|
-
object_=expand_meta,
|
1912
|
-
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
1913
|
-
direction="write",
|
1914
|
-
),
|
1915
|
-
"raw_overrides": convert_and_respect_annotation_metadata(
|
1916
|
-
object_=raw_overrides,
|
1917
|
-
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
1918
|
-
direction="write",
|
1919
|
-
),
|
1920
|
-
"expand_raw": expand_raw,
|
1921
|
-
"metadata": metadata,
|
1922
|
-
},
|
1923
|
-
headers={
|
1924
|
-
"content-type": "application/json",
|
1925
|
-
},
|
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,
|
1926
1498
|
request_options=request_options,
|
1927
|
-
omit=OMIT,
|
1928
1499
|
)
|
1929
|
-
|
1930
|
-
if 200 <= _response.status_code < 300:
|
1931
|
-
return typing.cast(
|
1932
|
-
ExecutePromptResponse,
|
1933
|
-
parse_obj_as(
|
1934
|
-
type_=ExecutePromptResponse, # type: ignore
|
1935
|
-
object_=_response.json(),
|
1936
|
-
),
|
1937
|
-
)
|
1938
|
-
if _response.status_code == 400:
|
1939
|
-
raise BadRequestError(
|
1940
|
-
typing.cast(
|
1941
|
-
typing.Optional[typing.Any],
|
1942
|
-
parse_obj_as(
|
1943
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1944
|
-
object_=_response.json(),
|
1945
|
-
),
|
1946
|
-
)
|
1947
|
-
)
|
1948
|
-
if _response.status_code == 403:
|
1949
|
-
raise ForbiddenError(
|
1950
|
-
typing.cast(
|
1951
|
-
typing.Optional[typing.Any],
|
1952
|
-
parse_obj_as(
|
1953
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1954
|
-
object_=_response.json(),
|
1955
|
-
),
|
1956
|
-
)
|
1957
|
-
)
|
1958
|
-
if _response.status_code == 404:
|
1959
|
-
raise NotFoundError(
|
1960
|
-
typing.cast(
|
1961
|
-
typing.Optional[typing.Any],
|
1962
|
-
parse_obj_as(
|
1963
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1964
|
-
object_=_response.json(),
|
1965
|
-
),
|
1966
|
-
)
|
1967
|
-
)
|
1968
|
-
if _response.status_code == 500:
|
1969
|
-
raise InternalServerError(
|
1970
|
-
typing.cast(
|
1971
|
-
typing.Optional[typing.Any],
|
1972
|
-
parse_obj_as(
|
1973
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
1974
|
-
object_=_response.json(),
|
1975
|
-
),
|
1976
|
-
)
|
1977
|
-
)
|
1978
|
-
_response_json = _response.json()
|
1979
|
-
except JSONDecodeError:
|
1980
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1981
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1500
|
+
return response.data
|
1982
1501
|
|
1983
1502
|
async def execute_prompt_stream(
|
1984
1503
|
self,
|
@@ -2065,9 +1584,9 @@ class AsyncVellum:
|
|
2065
1584
|
|
2066
1585
|
asyncio.run(main())
|
2067
1586
|
"""
|
2068
|
-
async with self._client_wrapper.httpx_client.stream(
|
1587
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2069
1588
|
"v1/execute-prompt-stream",
|
2070
|
-
base_url=self._client_wrapper.get_environment().predict,
|
1589
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2071
1590
|
method="POST",
|
2072
1591
|
json={
|
2073
1592
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -2233,72 +1752,17 @@ class AsyncVellum:
|
|
2233
1752
|
|
2234
1753
|
asyncio.run(main())
|
2235
1754
|
"""
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
"expand_meta": convert_and_respect_annotation_metadata(
|
2245
|
-
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
2246
|
-
),
|
2247
|
-
"workflow_deployment_id": workflow_deployment_id,
|
2248
|
-
"workflow_deployment_name": workflow_deployment_name,
|
2249
|
-
"release_tag": release_tag,
|
2250
|
-
"external_id": external_id,
|
2251
|
-
"metadata": metadata,
|
2252
|
-
},
|
2253
|
-
headers={
|
2254
|
-
"content-type": "application/json",
|
2255
|
-
},
|
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,
|
2256
1763
|
request_options=request_options,
|
2257
|
-
omit=OMIT,
|
2258
1764
|
)
|
2259
|
-
|
2260
|
-
if 200 <= _response.status_code < 300:
|
2261
|
-
return typing.cast(
|
2262
|
-
ExecuteWorkflowResponse,
|
2263
|
-
parse_obj_as(
|
2264
|
-
type_=ExecuteWorkflowResponse, # type: ignore
|
2265
|
-
object_=_response.json(),
|
2266
|
-
),
|
2267
|
-
)
|
2268
|
-
if _response.status_code == 400:
|
2269
|
-
raise BadRequestError(
|
2270
|
-
typing.cast(
|
2271
|
-
typing.Optional[typing.Any],
|
2272
|
-
parse_obj_as(
|
2273
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2274
|
-
object_=_response.json(),
|
2275
|
-
),
|
2276
|
-
)
|
2277
|
-
)
|
2278
|
-
if _response.status_code == 404:
|
2279
|
-
raise NotFoundError(
|
2280
|
-
typing.cast(
|
2281
|
-
typing.Optional[typing.Any],
|
2282
|
-
parse_obj_as(
|
2283
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2284
|
-
object_=_response.json(),
|
2285
|
-
),
|
2286
|
-
)
|
2287
|
-
)
|
2288
|
-
if _response.status_code == 500:
|
2289
|
-
raise InternalServerError(
|
2290
|
-
typing.cast(
|
2291
|
-
typing.Optional[typing.Any],
|
2292
|
-
parse_obj_as(
|
2293
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2294
|
-
object_=_response.json(),
|
2295
|
-
),
|
2296
|
-
)
|
2297
|
-
)
|
2298
|
-
_response_json = _response.json()
|
2299
|
-
except JSONDecodeError:
|
2300
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2301
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1765
|
+
return response.data
|
2302
1766
|
|
2303
1767
|
async def execute_workflow_stream(
|
2304
1768
|
self,
|
@@ -2381,9 +1845,9 @@ class AsyncVellum:
|
|
2381
1845
|
|
2382
1846
|
asyncio.run(main())
|
2383
1847
|
"""
|
2384
|
-
async with self._client_wrapper.httpx_client.stream(
|
1848
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2385
1849
|
"v1/execute-workflow-stream",
|
2386
|
-
base_url=self._client_wrapper.get_environment().predict,
|
1850
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2387
1851
|
method="POST",
|
2388
1852
|
json={
|
2389
1853
|
"inputs": convert_and_respect_annotation_metadata(
|
@@ -2521,79 +1985,14 @@ class AsyncVellum:
|
|
2521
1985
|
|
2522
1986
|
asyncio.run(main())
|
2523
1987
|
"""
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
"deployment_id": deployment_id,
|
2530
|
-
"deployment_name": deployment_name,
|
2531
|
-
"requests": convert_and_respect_annotation_metadata(
|
2532
|
-
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
2533
|
-
),
|
2534
|
-
"options": convert_and_respect_annotation_metadata(
|
2535
|
-
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
2536
|
-
),
|
2537
|
-
},
|
2538
|
-
headers={
|
2539
|
-
"content-type": "application/json",
|
2540
|
-
},
|
1988
|
+
response = await self._raw_client.generate(
|
1989
|
+
requests=requests,
|
1990
|
+
deployment_id=deployment_id,
|
1991
|
+
deployment_name=deployment_name,
|
1992
|
+
options=options,
|
2541
1993
|
request_options=request_options,
|
2542
|
-
omit=OMIT,
|
2543
1994
|
)
|
2544
|
-
|
2545
|
-
if 200 <= _response.status_code < 300:
|
2546
|
-
return typing.cast(
|
2547
|
-
GenerateResponse,
|
2548
|
-
parse_obj_as(
|
2549
|
-
type_=GenerateResponse, # type: ignore
|
2550
|
-
object_=_response.json(),
|
2551
|
-
),
|
2552
|
-
)
|
2553
|
-
if _response.status_code == 400:
|
2554
|
-
raise BadRequestError(
|
2555
|
-
typing.cast(
|
2556
|
-
typing.Optional[typing.Any],
|
2557
|
-
parse_obj_as(
|
2558
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2559
|
-
object_=_response.json(),
|
2560
|
-
),
|
2561
|
-
)
|
2562
|
-
)
|
2563
|
-
if _response.status_code == 403:
|
2564
|
-
raise ForbiddenError(
|
2565
|
-
typing.cast(
|
2566
|
-
typing.Optional[typing.Any],
|
2567
|
-
parse_obj_as(
|
2568
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2569
|
-
object_=_response.json(),
|
2570
|
-
),
|
2571
|
-
)
|
2572
|
-
)
|
2573
|
-
if _response.status_code == 404:
|
2574
|
-
raise NotFoundError(
|
2575
|
-
typing.cast(
|
2576
|
-
typing.Optional[typing.Any],
|
2577
|
-
parse_obj_as(
|
2578
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2579
|
-
object_=_response.json(),
|
2580
|
-
),
|
2581
|
-
)
|
2582
|
-
)
|
2583
|
-
if _response.status_code == 500:
|
2584
|
-
raise InternalServerError(
|
2585
|
-
typing.cast(
|
2586
|
-
typing.Optional[typing.Any],
|
2587
|
-
parse_obj_as(
|
2588
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2589
|
-
object_=_response.json(),
|
2590
|
-
),
|
2591
|
-
)
|
2592
|
-
)
|
2593
|
-
_response_json = _response.json()
|
2594
|
-
except JSONDecodeError:
|
2595
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2596
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1995
|
+
return response.data
|
2597
1996
|
|
2598
1997
|
async def generate_stream(
|
2599
1998
|
self,
|
@@ -2661,9 +2060,9 @@ class AsyncVellum:
|
|
2661
2060
|
|
2662
2061
|
asyncio.run(main())
|
2663
2062
|
"""
|
2664
|
-
async with self._client_wrapper.httpx_client.stream(
|
2063
|
+
async with self._raw_client._client_wrapper.httpx_client.stream(
|
2665
2064
|
"v1/generate-stream",
|
2666
|
-
base_url=self._client_wrapper.get_environment().predict,
|
2065
|
+
base_url=self._raw_client._client_wrapper.get_environment().predict,
|
2667
2066
|
method="POST",
|
2668
2067
|
json={
|
2669
2068
|
"deployment_id": deployment_id,
|
@@ -2801,68 +2200,15 @@ class AsyncVellum:
|
|
2801
2200
|
|
2802
2201
|
asyncio.run(main())
|
2803
2202
|
"""
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2810
|
-
"index_name": index_name,
|
2811
|
-
"query": query,
|
2812
|
-
"options": convert_and_respect_annotation_metadata(
|
2813
|
-
object_=options, annotation=typing.Optional[SearchRequestOptionsRequest], direction="write"
|
2814
|
-
),
|
2815
|
-
"document_index": document_index,
|
2816
|
-
},
|
2817
|
-
headers={
|
2818
|
-
"content-type": "application/json",
|
2819
|
-
},
|
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,
|
2820
2209
|
request_options=request_options,
|
2821
|
-
omit=OMIT,
|
2822
2210
|
)
|
2823
|
-
|
2824
|
-
if 200 <= _response.status_code < 300:
|
2825
|
-
return typing.cast(
|
2826
|
-
SearchResponse,
|
2827
|
-
parse_obj_as(
|
2828
|
-
type_=SearchResponse, # type: ignore
|
2829
|
-
object_=_response.json(),
|
2830
|
-
),
|
2831
|
-
)
|
2832
|
-
if _response.status_code == 400:
|
2833
|
-
raise BadRequestError(
|
2834
|
-
typing.cast(
|
2835
|
-
typing.Optional[typing.Any],
|
2836
|
-
parse_obj_as(
|
2837
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2838
|
-
object_=_response.json(),
|
2839
|
-
),
|
2840
|
-
)
|
2841
|
-
)
|
2842
|
-
if _response.status_code == 404:
|
2843
|
-
raise NotFoundError(
|
2844
|
-
typing.cast(
|
2845
|
-
typing.Optional[typing.Any],
|
2846
|
-
parse_obj_as(
|
2847
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2848
|
-
object_=_response.json(),
|
2849
|
-
),
|
2850
|
-
)
|
2851
|
-
)
|
2852
|
-
if _response.status_code == 500:
|
2853
|
-
raise InternalServerError(
|
2854
|
-
typing.cast(
|
2855
|
-
typing.Optional[typing.Any],
|
2856
|
-
parse_obj_as(
|
2857
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2858
|
-
object_=_response.json(),
|
2859
|
-
),
|
2860
|
-
)
|
2861
|
-
)
|
2862
|
-
_response_json = _response.json()
|
2863
|
-
except JSONDecodeError:
|
2864
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2865
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2211
|
+
return response.data
|
2866
2212
|
|
2867
2213
|
async def submit_completion_actuals(
|
2868
2214
|
self,
|
@@ -2916,60 +2262,13 @@ class AsyncVellum:
|
|
2916
2262
|
|
2917
2263
|
asyncio.run(main())
|
2918
2264
|
"""
|
2919
|
-
|
2920
|
-
|
2921
|
-
|
2922
|
-
|
2923
|
-
json={
|
2924
|
-
"deployment_id": deployment_id,
|
2925
|
-
"deployment_name": deployment_name,
|
2926
|
-
"actuals": convert_and_respect_annotation_metadata(
|
2927
|
-
object_=actuals, annotation=typing.Sequence[SubmitCompletionActualRequest], direction="write"
|
2928
|
-
),
|
2929
|
-
},
|
2930
|
-
headers={
|
2931
|
-
"content-type": "application/json",
|
2932
|
-
},
|
2265
|
+
response = await self._raw_client.submit_completion_actuals(
|
2266
|
+
actuals=actuals,
|
2267
|
+
deployment_id=deployment_id,
|
2268
|
+
deployment_name=deployment_name,
|
2933
2269
|
request_options=request_options,
|
2934
|
-
omit=OMIT,
|
2935
2270
|
)
|
2936
|
-
|
2937
|
-
if 200 <= _response.status_code < 300:
|
2938
|
-
return
|
2939
|
-
if _response.status_code == 400:
|
2940
|
-
raise BadRequestError(
|
2941
|
-
typing.cast(
|
2942
|
-
typing.Optional[typing.Any],
|
2943
|
-
parse_obj_as(
|
2944
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2945
|
-
object_=_response.json(),
|
2946
|
-
),
|
2947
|
-
)
|
2948
|
-
)
|
2949
|
-
if _response.status_code == 404:
|
2950
|
-
raise NotFoundError(
|
2951
|
-
typing.cast(
|
2952
|
-
typing.Optional[typing.Any],
|
2953
|
-
parse_obj_as(
|
2954
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2955
|
-
object_=_response.json(),
|
2956
|
-
),
|
2957
|
-
)
|
2958
|
-
)
|
2959
|
-
if _response.status_code == 500:
|
2960
|
-
raise InternalServerError(
|
2961
|
-
typing.cast(
|
2962
|
-
typing.Optional[typing.Any],
|
2963
|
-
parse_obj_as(
|
2964
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
2965
|
-
object_=_response.json(),
|
2966
|
-
),
|
2967
|
-
)
|
2968
|
-
)
|
2969
|
-
_response_json = _response.json()
|
2970
|
-
except JSONDecodeError:
|
2971
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
2972
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2271
|
+
return response.data
|
2973
2272
|
|
2974
2273
|
async def submit_workflow_execution_actuals(
|
2975
2274
|
self,
|
@@ -3025,27 +2324,10 @@ class AsyncVellum:
|
|
3025
2324
|
|
3026
2325
|
asyncio.run(main())
|
3027
2326
|
"""
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
json={
|
3033
|
-
"actuals": convert_and_respect_annotation_metadata(
|
3034
|
-
object_=actuals, annotation=typing.Sequence[SubmitWorkflowExecutionActualRequest], direction="write"
|
3035
|
-
),
|
3036
|
-
"execution_id": execution_id,
|
3037
|
-
"external_id": external_id,
|
3038
|
-
},
|
3039
|
-
headers={
|
3040
|
-
"content-type": "application/json",
|
3041
|
-
},
|
2327
|
+
response = await self._raw_client.submit_workflow_execution_actuals(
|
2328
|
+
actuals=actuals,
|
2329
|
+
execution_id=execution_id,
|
2330
|
+
external_id=external_id,
|
3042
2331
|
request_options=request_options,
|
3043
|
-
omit=OMIT,
|
3044
2332
|
)
|
3045
|
-
|
3046
|
-
if 200 <= _response.status_code < 300:
|
3047
|
-
return
|
3048
|
-
_response_json = _response.json()
|
3049
|
-
except JSONDecodeError:
|
3050
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
3051
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2333
|
+
return response.data
|