vellum-ai 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. vellum/__init__.py +90 -0
  2. vellum/client.py +107 -0
  3. vellum/core/client_wrapper.py +1 -1
  4. vellum/types/__init__.py +96 -0
  5. vellum/types/array_enum.py +5 -0
  6. vellum/types/array_variable_value.py +35 -0
  7. vellum/types/chat_history_enum.py +5 -0
  8. vellum/types/chat_history_variable_value.py +29 -0
  9. vellum/types/error_enum.py +5 -0
  10. vellum/types/execute_workflow_error_response.py +28 -0
  11. vellum/types/execute_workflow_response.py +32 -0
  12. vellum/types/execute_workflow_workflow_result_event.py +33 -0
  13. vellum/types/fulfilled_execute_workflow_workflow_result_event.py +35 -0
  14. vellum/types/json_enum.py +5 -0
  15. vellum/types/number_enum.py +5 -0
  16. vellum/types/number_variable_value.py +28 -0
  17. vellum/types/rejected_execute_workflow_workflow_result_event.py +35 -0
  18. vellum/types/scenario_input_type_enum.py +2 -2
  19. vellum/types/search_results_enum.py +5 -0
  20. vellum/types/search_results_variable_value.py +29 -0
  21. vellum/types/variable_value.py +102 -0
  22. vellum/types/workflow_output.py +111 -0
  23. vellum/types/workflow_output_array.py +35 -0
  24. vellum/types/workflow_output_chat_history.py +35 -0
  25. vellum/types/workflow_output_error.py +35 -0
  26. vellum/types/workflow_output_function_call.py +35 -0
  27. vellum/types/workflow_output_image.py +35 -0
  28. vellum/types/workflow_output_json.py +34 -0
  29. vellum/types/workflow_output_number.py +34 -0
  30. vellum/types/workflow_output_search_results.py +35 -0
  31. vellum/types/workflow_output_string.py +34 -0
  32. vellum/types/workflow_result_event.py +2 -0
  33. {vellum_ai-0.2.0.dist-info → vellum_ai-0.2.1.dist-info}/METADATA +1 -1
  34. {vellum_ai-0.2.0.dist-info → vellum_ai-0.2.1.dist-info}/RECORD +36 -10
  35. {vellum_ai-0.2.0.dist-info → vellum_ai-0.2.1.dist-info}/LICENSE +0 -0
  36. {vellum_ai-0.2.0.dist-info → vellum_ai-0.2.1.dist-info}/WHEEL +0 -0
vellum/__init__.py CHANGED
@@ -13,8 +13,12 @@ from .types import (
13
13
  ArrayChatMessageContentItem_Image,
14
14
  ArrayChatMessageContentItem_String,
15
15
  ArrayChatMessageContentRequest,
16
+ ArrayEnum,
17
+ ArrayVariableValue,
16
18
  BlockTypeEnum,
19
+ ChatHistoryEnum,
17
20
  ChatHistoryInputRequest,
21
+ ChatHistoryVariableValue,
18
22
  ChatMessage,
19
23
  ChatMessageContent,
20
24
  ChatMessageContentRequest,
@@ -54,6 +58,7 @@ from .types import (
54
58
  EnrichedNormalizedCompletion,
55
59
  EntityStatus,
56
60
  EnvironmentEnum,
61
+ ErrorEnum,
57
62
  ErrorVariableValue,
58
63
  EvaluationParams,
59
64
  EvaluationParamsRequest,
@@ -66,11 +71,17 @@ from .types import (
66
71
  ExecutePromptResponse,
67
72
  ExecutePromptResponse_Fulfilled,
68
73
  ExecutePromptResponse_Rejected,
74
+ ExecuteWorkflowErrorResponse,
75
+ ExecuteWorkflowResponse,
69
76
  ExecuteWorkflowStreamErrorResponse,
77
+ ExecuteWorkflowWorkflowResultEvent,
78
+ ExecuteWorkflowWorkflowResultEvent_Fulfilled,
79
+ ExecuteWorkflowWorkflowResultEvent_Rejected,
70
80
  FinishReasonEnum,
71
81
  FulfilledEnum,
72
82
  FulfilledExecutePromptEvent,
73
83
  FulfilledExecutePromptResponse,
84
+ FulfilledExecuteWorkflowWorkflowResultEvent,
74
85
  FulfilledFunctionCall,
75
86
  FulfilledPromptExecutionMeta,
76
87
  FunctionCall,
@@ -99,6 +110,7 @@ from .types import (
99
110
  InitiatedEnum,
100
111
  InitiatedExecutePromptEvent,
101
112
  InitiatedPromptExecutionMeta,
113
+ JsonEnum,
102
114
  JsonInputRequest,
103
115
  JsonVariableValue,
104
116
  LogicalOperator,
@@ -140,6 +152,8 @@ from .types import (
140
152
  NodeInputVariableCompiledValue_String,
141
153
  NormalizedLogProbs,
142
154
  NormalizedTokenLogProbs,
155
+ NumberEnum,
156
+ NumberVariableValue,
143
157
  PaginatedSlimDeploymentReadList,
144
158
  PaginatedSlimDocumentList,
145
159
  PaginatedSlimWorkflowDeploymentList,
@@ -179,6 +193,7 @@ from .types import (
179
193
  RejectedEnum,
180
194
  RejectedExecutePromptEvent,
181
195
  RejectedExecutePromptResponse,
196
+ RejectedExecuteWorkflowWorkflowResultEvent,
182
197
  RejectedFunctionCall,
183
198
  RejectedPromptExecutionMeta,
184
199
  SandboxMetricInputParams,
@@ -198,6 +213,8 @@ from .types import (
198
213
  SearchResultDocumentRequest,
199
214
  SearchResultMergingRequest,
200
215
  SearchResultRequest,
216
+ SearchResultsEnum,
217
+ SearchResultsVariableValue,
201
218
  SearchWeightsRequest,
202
219
  SlimDeploymentRead,
203
220
  SlimDocument,
@@ -262,6 +279,15 @@ from .types import (
262
279
  TestSuiteTestCase,
263
280
  UploadDocumentErrorResponse,
264
281
  UploadDocumentResponse,
282
+ VariableValue,
283
+ VariableValue_Array,
284
+ VariableValue_ChatHistory,
285
+ VariableValue_Error,
286
+ VariableValue_FunctionCall,
287
+ VariableValue_Json,
288
+ VariableValue_Number,
289
+ VariableValue_SearchResults,
290
+ VariableValue_String,
265
291
  VellumError,
266
292
  VellumErrorCodeEnum,
267
293
  VellumErrorRequest,
@@ -287,6 +313,25 @@ from .types import (
287
313
  WorkflowNodeResultData_Terminal,
288
314
  WorkflowNodeResultEvent,
289
315
  WorkflowNodeResultEventState,
316
+ WorkflowOutput,
317
+ WorkflowOutputArray,
318
+ WorkflowOutputChatHistory,
319
+ WorkflowOutputError,
320
+ WorkflowOutputFunctionCall,
321
+ WorkflowOutputImage,
322
+ WorkflowOutputJson,
323
+ WorkflowOutputNumber,
324
+ WorkflowOutputSearchResults,
325
+ WorkflowOutputString,
326
+ WorkflowOutput_Array,
327
+ WorkflowOutput_ChatHistory,
328
+ WorkflowOutput_Error,
329
+ WorkflowOutput_FunctionCall,
330
+ WorkflowOutput_Image,
331
+ WorkflowOutput_Json,
332
+ WorkflowOutput_Number,
333
+ WorkflowOutput_SearchResults,
334
+ WorkflowOutput_String,
290
335
  WorkflowRequestChatHistoryInputRequest,
291
336
  WorkflowRequestInputRequest,
292
337
  WorkflowRequestInputRequest_ChatHistory,
@@ -342,9 +387,13 @@ __all__ = [
342
387
  "ArrayChatMessageContentItem_Image",
343
388
  "ArrayChatMessageContentItem_String",
344
389
  "ArrayChatMessageContentRequest",
390
+ "ArrayEnum",
391
+ "ArrayVariableValue",
345
392
  "BadRequestError",
346
393
  "BlockTypeEnum",
394
+ "ChatHistoryEnum",
347
395
  "ChatHistoryInputRequest",
396
+ "ChatHistoryVariableValue",
348
397
  "ChatMessage",
349
398
  "ChatMessageContent",
350
399
  "ChatMessageContentRequest",
@@ -386,6 +435,7 @@ __all__ = [
386
435
  "EnrichedNormalizedCompletion",
387
436
  "EntityStatus",
388
437
  "EnvironmentEnum",
438
+ "ErrorEnum",
389
439
  "ErrorVariableValue",
390
440
  "EvaluationParams",
391
441
  "EvaluationParamsRequest",
@@ -398,12 +448,18 @@ __all__ = [
398
448
  "ExecutePromptResponse",
399
449
  "ExecutePromptResponse_Fulfilled",
400
450
  "ExecutePromptResponse_Rejected",
451
+ "ExecuteWorkflowErrorResponse",
452
+ "ExecuteWorkflowResponse",
401
453
  "ExecuteWorkflowStreamErrorResponse",
454
+ "ExecuteWorkflowWorkflowResultEvent",
455
+ "ExecuteWorkflowWorkflowResultEvent_Fulfilled",
456
+ "ExecuteWorkflowWorkflowResultEvent_Rejected",
402
457
  "FinishReasonEnum",
403
458
  "ForbiddenError",
404
459
  "FulfilledEnum",
405
460
  "FulfilledExecutePromptEvent",
406
461
  "FulfilledExecutePromptResponse",
462
+ "FulfilledExecuteWorkflowWorkflowResultEvent",
407
463
  "FulfilledFunctionCall",
408
464
  "FulfilledPromptExecutionMeta",
409
465
  "FunctionCall",
@@ -433,6 +489,7 @@ __all__ = [
433
489
  "InitiatedExecutePromptEvent",
434
490
  "InitiatedPromptExecutionMeta",
435
491
  "InternalServerError",
492
+ "JsonEnum",
436
493
  "JsonInputRequest",
437
494
  "JsonVariableValue",
438
495
  "LogicalOperator",
@@ -475,6 +532,8 @@ __all__ = [
475
532
  "NormalizedLogProbs",
476
533
  "NormalizedTokenLogProbs",
477
534
  "NotFoundError",
535
+ "NumberEnum",
536
+ "NumberVariableValue",
478
537
  "PaginatedSlimDeploymentReadList",
479
538
  "PaginatedSlimDocumentList",
480
539
  "PaginatedSlimWorkflowDeploymentList",
@@ -514,6 +573,7 @@ __all__ = [
514
573
  "RejectedEnum",
515
574
  "RejectedExecutePromptEvent",
516
575
  "RejectedExecutePromptResponse",
576
+ "RejectedExecuteWorkflowWorkflowResultEvent",
517
577
  "RejectedFunctionCall",
518
578
  "RejectedPromptExecutionMeta",
519
579
  "SandboxMetricInputParams",
@@ -533,6 +593,8 @@ __all__ = [
533
593
  "SearchResultDocumentRequest",
534
594
  "SearchResultMergingRequest",
535
595
  "SearchResultRequest",
596
+ "SearchResultsEnum",
597
+ "SearchResultsVariableValue",
536
598
  "SearchWeightsRequest",
537
599
  "SlimDeploymentRead",
538
600
  "SlimDocument",
@@ -597,6 +659,15 @@ __all__ = [
597
659
  "TestSuiteTestCase",
598
660
  "UploadDocumentErrorResponse",
599
661
  "UploadDocumentResponse",
662
+ "VariableValue",
663
+ "VariableValue_Array",
664
+ "VariableValue_ChatHistory",
665
+ "VariableValue_Error",
666
+ "VariableValue_FunctionCall",
667
+ "VariableValue_Json",
668
+ "VariableValue_Number",
669
+ "VariableValue_SearchResults",
670
+ "VariableValue_String",
600
671
  "VellumEnvironment",
601
672
  "VellumError",
602
673
  "VellumErrorCodeEnum",
@@ -624,6 +695,25 @@ __all__ = [
624
695
  "WorkflowNodeResultData_Terminal",
625
696
  "WorkflowNodeResultEvent",
626
697
  "WorkflowNodeResultEventState",
698
+ "WorkflowOutput",
699
+ "WorkflowOutputArray",
700
+ "WorkflowOutputChatHistory",
701
+ "WorkflowOutputError",
702
+ "WorkflowOutputFunctionCall",
703
+ "WorkflowOutputImage",
704
+ "WorkflowOutputJson",
705
+ "WorkflowOutputNumber",
706
+ "WorkflowOutputSearchResults",
707
+ "WorkflowOutputString",
708
+ "WorkflowOutput_Array",
709
+ "WorkflowOutput_ChatHistory",
710
+ "WorkflowOutput_Error",
711
+ "WorkflowOutput_FunctionCall",
712
+ "WorkflowOutput_Image",
713
+ "WorkflowOutput_Json",
714
+ "WorkflowOutput_Number",
715
+ "WorkflowOutput_SearchResults",
716
+ "WorkflowOutput_String",
627
717
  "WorkflowRequestChatHistoryInputRequest",
628
718
  "WorkflowRequestInputRequest",
629
719
  "WorkflowRequestInputRequest_ChatHistory",
vellum/client.py CHANGED
@@ -25,6 +25,7 @@ from .resources.test_suites.client import AsyncTestSuitesClient, TestSuitesClien
25
25
  from .resources.workflow_deployments.client import AsyncWorkflowDeploymentsClient, WorkflowDeploymentsClient
26
26
  from .types.execute_prompt_event import ExecutePromptEvent
27
27
  from .types.execute_prompt_response import ExecutePromptResponse
28
+ from .types.execute_workflow_response import ExecuteWorkflowResponse
28
29
  from .types.generate_options_request import GenerateOptionsRequest
29
30
  from .types.generate_request import GenerateRequest
30
31
  from .types.generate_response import GenerateResponse
@@ -233,6 +234,59 @@ class Vellum:
233
234
  raise ApiError(status_code=_response.status_code, body=_response.text)
234
235
  raise ApiError(status_code=_response.status_code, body=_response_json)
235
236
 
237
+ def execute_workflow(
238
+ self,
239
+ *,
240
+ workflow_deployment_id: typing.Optional[str] = OMIT,
241
+ workflow_deployment_name: typing.Optional[str] = OMIT,
242
+ release_tag: typing.Optional[str] = OMIT,
243
+ inputs: typing.List[WorkflowRequestInputRequest],
244
+ external_id: typing.Optional[str] = OMIT,
245
+ ) -> ExecuteWorkflowResponse:
246
+ """
247
+ Executes a deployed Workflow and returns its outputs.
248
+
249
+ Parameters:
250
+ - workflow_deployment_id: typing.Optional[str]. The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
251
+
252
+ - workflow_deployment_name: typing.Optional[str]. The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
253
+
254
+ - release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
255
+
256
+ - inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's Deployment with their corresponding values.
257
+
258
+ - external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes.
259
+ """
260
+ _request: typing.Dict[str, typing.Any] = {"inputs": inputs}
261
+ if workflow_deployment_id is not OMIT:
262
+ _request["workflow_deployment_id"] = workflow_deployment_id
263
+ if workflow_deployment_name is not OMIT:
264
+ _request["workflow_deployment_name"] = workflow_deployment_name
265
+ if release_tag is not OMIT:
266
+ _request["release_tag"] = release_tag
267
+ if external_id is not OMIT:
268
+ _request["external_id"] = external_id
269
+ _response = self._client_wrapper.httpx_client.request(
270
+ "POST",
271
+ urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/execute-workflow"),
272
+ json=jsonable_encoder(_request),
273
+ headers=self._client_wrapper.get_headers(),
274
+ timeout=None,
275
+ )
276
+ if 200 <= _response.status_code < 300:
277
+ return pydantic.parse_obj_as(ExecuteWorkflowResponse, _response.json()) # type: ignore
278
+ if _response.status_code == 400:
279
+ raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
280
+ if _response.status_code == 404:
281
+ raise NotFoundError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
282
+ if _response.status_code == 500:
283
+ raise InternalServerError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
284
+ try:
285
+ _response_json = _response.json()
286
+ except JSONDecodeError:
287
+ raise ApiError(status_code=_response.status_code, body=_response.text)
288
+ raise ApiError(status_code=_response.status_code, body=_response_json)
289
+
236
290
  def execute_workflow_stream(
237
291
  self,
238
292
  *,
@@ -808,6 +862,59 @@ class AsyncVellum:
808
862
  raise ApiError(status_code=_response.status_code, body=_response.text)
809
863
  raise ApiError(status_code=_response.status_code, body=_response_json)
810
864
 
865
+ async def execute_workflow(
866
+ self,
867
+ *,
868
+ workflow_deployment_id: typing.Optional[str] = OMIT,
869
+ workflow_deployment_name: typing.Optional[str] = OMIT,
870
+ release_tag: typing.Optional[str] = OMIT,
871
+ inputs: typing.List[WorkflowRequestInputRequest],
872
+ external_id: typing.Optional[str] = OMIT,
873
+ ) -> ExecuteWorkflowResponse:
874
+ """
875
+ Executes a deployed Workflow and returns its outputs.
876
+
877
+ Parameters:
878
+ - workflow_deployment_id: typing.Optional[str]. The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
879
+
880
+ - workflow_deployment_name: typing.Optional[str]. The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
881
+
882
+ - release_tag: typing.Optional[str]. Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
883
+
884
+ - inputs: typing.List[WorkflowRequestInputRequest]. The list of inputs defined in the Workflow's Deployment with their corresponding values.
885
+
886
+ - external_id: typing.Optional[str]. Optionally include a unique identifier for monitoring purposes.
887
+ """
888
+ _request: typing.Dict[str, typing.Any] = {"inputs": inputs}
889
+ if workflow_deployment_id is not OMIT:
890
+ _request["workflow_deployment_id"] = workflow_deployment_id
891
+ if workflow_deployment_name is not OMIT:
892
+ _request["workflow_deployment_name"] = workflow_deployment_name
893
+ if release_tag is not OMIT:
894
+ _request["release_tag"] = release_tag
895
+ if external_id is not OMIT:
896
+ _request["external_id"] = external_id
897
+ _response = await self._client_wrapper.httpx_client.request(
898
+ "POST",
899
+ urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/execute-workflow"),
900
+ json=jsonable_encoder(_request),
901
+ headers=self._client_wrapper.get_headers(),
902
+ timeout=None,
903
+ )
904
+ if 200 <= _response.status_code < 300:
905
+ return pydantic.parse_obj_as(ExecuteWorkflowResponse, _response.json()) # type: ignore
906
+ if _response.status_code == 400:
907
+ raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
908
+ if _response.status_code == 404:
909
+ raise NotFoundError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
910
+ if _response.status_code == 500:
911
+ raise InternalServerError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
912
+ try:
913
+ _response_json = _response.json()
914
+ except JSONDecodeError:
915
+ raise ApiError(status_code=_response.status_code, body=_response.text)
916
+ raise ApiError(status_code=_response.status_code, body=_response_json)
917
+
811
918
  async def execute_workflow_stream(
812
919
  self,
813
920
  *,
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "vellum-ai",
19
- "X-Fern-SDK-Version": "v0.2.0",
19
+ "X-Fern-SDK-Version": "v0.2.1",
20
20
  }
21
21
  headers["X_API_KEY"] = self.api_key
22
22
  return headers
vellum/types/__init__.py CHANGED
@@ -16,8 +16,12 @@ from .array_chat_message_content_item_request import (
16
16
  ArrayChatMessageContentItemRequest_String,
17
17
  )
18
18
  from .array_chat_message_content_request import ArrayChatMessageContentRequest
19
+ from .array_enum import ArrayEnum
20
+ from .array_variable_value import ArrayVariableValue
19
21
  from .block_type_enum import BlockTypeEnum
22
+ from .chat_history_enum import ChatHistoryEnum
20
23
  from .chat_history_input_request import ChatHistoryInputRequest
24
+ from .chat_history_variable_value import ChatHistoryVariableValue
21
25
  from .chat_message import ChatMessage
22
26
  from .chat_message_content import (
23
27
  ChatMessageContent,
@@ -63,6 +67,7 @@ from .document_status import DocumentStatus
63
67
  from .enriched_normalized_completion import EnrichedNormalizedCompletion
64
68
  from .entity_status import EntityStatus
65
69
  from .environment_enum import EnvironmentEnum
70
+ from .error_enum import ErrorEnum
66
71
  from .error_variable_value import ErrorVariableValue
67
72
  from .evaluation_params import EvaluationParams
68
73
  from .evaluation_params_request import EvaluationParamsRequest
@@ -79,11 +84,19 @@ from .execute_prompt_response import (
79
84
  ExecutePromptResponse_Fulfilled,
80
85
  ExecutePromptResponse_Rejected,
81
86
  )
87
+ from .execute_workflow_error_response import ExecuteWorkflowErrorResponse
88
+ from .execute_workflow_response import ExecuteWorkflowResponse
82
89
  from .execute_workflow_stream_error_response import ExecuteWorkflowStreamErrorResponse
90
+ from .execute_workflow_workflow_result_event import (
91
+ ExecuteWorkflowWorkflowResultEvent,
92
+ ExecuteWorkflowWorkflowResultEvent_Fulfilled,
93
+ ExecuteWorkflowWorkflowResultEvent_Rejected,
94
+ )
83
95
  from .finish_reason_enum import FinishReasonEnum
84
96
  from .fulfilled_enum import FulfilledEnum
85
97
  from .fulfilled_execute_prompt_event import FulfilledExecutePromptEvent
86
98
  from .fulfilled_execute_prompt_response import FulfilledExecutePromptResponse
99
+ from .fulfilled_execute_workflow_workflow_result_event import FulfilledExecuteWorkflowWorkflowResultEvent
87
100
  from .fulfilled_function_call import FulfilledFunctionCall
88
101
  from .fulfilled_prompt_execution_meta import FulfilledPromptExecutionMeta
89
102
  from .function_call import FunctionCall, FunctionCall_Fulfilled, FunctionCall_Rejected
@@ -110,6 +123,7 @@ from .indexing_state_enum import IndexingStateEnum
110
123
  from .initiated_enum import InitiatedEnum
111
124
  from .initiated_execute_prompt_event import InitiatedExecutePromptEvent
112
125
  from .initiated_prompt_execution_meta import InitiatedPromptExecutionMeta
126
+ from .json_enum import JsonEnum
113
127
  from .json_input_request import JsonInputRequest
114
128
  from .json_variable_value import JsonVariableValue
115
129
  from .logical_operator import LogicalOperator
@@ -155,6 +169,8 @@ from .node_input_variable_compiled_value import (
155
169
  )
156
170
  from .normalized_log_probs import NormalizedLogProbs
157
171
  from .normalized_token_log_probs import NormalizedTokenLogProbs
172
+ from .number_enum import NumberEnum
173
+ from .number_variable_value import NumberVariableValue
158
174
  from .paginated_slim_deployment_read_list import PaginatedSlimDeploymentReadList
159
175
  from .paginated_slim_document_list import PaginatedSlimDocumentList
160
176
  from .paginated_slim_workflow_deployment_list import PaginatedSlimWorkflowDeploymentList
@@ -198,6 +214,7 @@ from .registered_prompt_sandbox_snapshot import RegisteredPromptSandboxSnapshot
198
214
  from .rejected_enum import RejectedEnum
199
215
  from .rejected_execute_prompt_event import RejectedExecutePromptEvent
200
216
  from .rejected_execute_prompt_response import RejectedExecutePromptResponse
217
+ from .rejected_execute_workflow_workflow_result_event import RejectedExecuteWorkflowWorkflowResultEvent
201
218
  from .rejected_function_call import RejectedFunctionCall
202
219
  from .rejected_prompt_execution_meta import RejectedPromptExecutionMeta
203
220
  from .sandbox_metric_input_params import SandboxMetricInputParams
@@ -217,6 +234,8 @@ from .search_result_document import SearchResultDocument
217
234
  from .search_result_document_request import SearchResultDocumentRequest
218
235
  from .search_result_merging_request import SearchResultMergingRequest
219
236
  from .search_result_request import SearchResultRequest
237
+ from .search_results_enum import SearchResultsEnum
238
+ from .search_results_variable_value import SearchResultsVariableValue
220
239
  from .search_weights_request import SearchWeightsRequest
221
240
  from .slim_deployment_read import SlimDeploymentRead
222
241
  from .slim_document import SlimDocument
@@ -289,6 +308,17 @@ from .test_case_variable_value import (
289
308
  from .test_suite_test_case import TestSuiteTestCase
290
309
  from .upload_document_error_response import UploadDocumentErrorResponse
291
310
  from .upload_document_response import UploadDocumentResponse
311
+ from .variable_value import (
312
+ VariableValue,
313
+ VariableValue_Array,
314
+ VariableValue_ChatHistory,
315
+ VariableValue_Error,
316
+ VariableValue_FunctionCall,
317
+ VariableValue_Json,
318
+ VariableValue_Number,
319
+ VariableValue_SearchResults,
320
+ VariableValue_String,
321
+ )
292
322
  from .vellum_error import VellumError
293
323
  from .vellum_error_code_enum import VellumErrorCodeEnum
294
324
  from .vellum_error_request import VellumErrorRequest
@@ -316,6 +346,27 @@ from .workflow_node_result_data import (
316
346
  )
317
347
  from .workflow_node_result_event import WorkflowNodeResultEvent
318
348
  from .workflow_node_result_event_state import WorkflowNodeResultEventState
349
+ from .workflow_output import (
350
+ WorkflowOutput,
351
+ WorkflowOutput_Array,
352
+ WorkflowOutput_ChatHistory,
353
+ WorkflowOutput_Error,
354
+ WorkflowOutput_FunctionCall,
355
+ WorkflowOutput_Image,
356
+ WorkflowOutput_Json,
357
+ WorkflowOutput_Number,
358
+ WorkflowOutput_SearchResults,
359
+ WorkflowOutput_String,
360
+ )
361
+ from .workflow_output_array import WorkflowOutputArray
362
+ from .workflow_output_chat_history import WorkflowOutputChatHistory
363
+ from .workflow_output_error import WorkflowOutputError
364
+ from .workflow_output_function_call import WorkflowOutputFunctionCall
365
+ from .workflow_output_image import WorkflowOutputImage
366
+ from .workflow_output_json import WorkflowOutputJson
367
+ from .workflow_output_number import WorkflowOutputNumber
368
+ from .workflow_output_search_results import WorkflowOutputSearchResults
369
+ from .workflow_output_string import WorkflowOutputString
319
370
  from .workflow_request_chat_history_input_request import WorkflowRequestChatHistoryInputRequest
320
371
  from .workflow_request_input_request import (
321
372
  WorkflowRequestInputRequest,
@@ -358,8 +409,12 @@ __all__ = [
358
409
  "ArrayChatMessageContentItem_Image",
359
410
  "ArrayChatMessageContentItem_String",
360
411
  "ArrayChatMessageContentRequest",
412
+ "ArrayEnum",
413
+ "ArrayVariableValue",
361
414
  "BlockTypeEnum",
415
+ "ChatHistoryEnum",
362
416
  "ChatHistoryInputRequest",
417
+ "ChatHistoryVariableValue",
363
418
  "ChatMessage",
364
419
  "ChatMessageContent",
365
420
  "ChatMessageContentRequest",
@@ -399,6 +454,7 @@ __all__ = [
399
454
  "EnrichedNormalizedCompletion",
400
455
  "EntityStatus",
401
456
  "EnvironmentEnum",
457
+ "ErrorEnum",
402
458
  "ErrorVariableValue",
403
459
  "EvaluationParams",
404
460
  "EvaluationParamsRequest",
@@ -411,11 +467,17 @@ __all__ = [
411
467
  "ExecutePromptResponse",
412
468
  "ExecutePromptResponse_Fulfilled",
413
469
  "ExecutePromptResponse_Rejected",
470
+ "ExecuteWorkflowErrorResponse",
471
+ "ExecuteWorkflowResponse",
414
472
  "ExecuteWorkflowStreamErrorResponse",
473
+ "ExecuteWorkflowWorkflowResultEvent",
474
+ "ExecuteWorkflowWorkflowResultEvent_Fulfilled",
475
+ "ExecuteWorkflowWorkflowResultEvent_Rejected",
415
476
  "FinishReasonEnum",
416
477
  "FulfilledEnum",
417
478
  "FulfilledExecutePromptEvent",
418
479
  "FulfilledExecutePromptResponse",
480
+ "FulfilledExecuteWorkflowWorkflowResultEvent",
419
481
  "FulfilledFunctionCall",
420
482
  "FulfilledPromptExecutionMeta",
421
483
  "FunctionCall",
@@ -444,6 +506,7 @@ __all__ = [
444
506
  "InitiatedEnum",
445
507
  "InitiatedExecutePromptEvent",
446
508
  "InitiatedPromptExecutionMeta",
509
+ "JsonEnum",
447
510
  "JsonInputRequest",
448
511
  "JsonVariableValue",
449
512
  "LogicalOperator",
@@ -485,6 +548,8 @@ __all__ = [
485
548
  "NodeInputVariableCompiledValue_String",
486
549
  "NormalizedLogProbs",
487
550
  "NormalizedTokenLogProbs",
551
+ "NumberEnum",
552
+ "NumberVariableValue",
488
553
  "PaginatedSlimDeploymentReadList",
489
554
  "PaginatedSlimDocumentList",
490
555
  "PaginatedSlimWorkflowDeploymentList",
@@ -524,6 +589,7 @@ __all__ = [
524
589
  "RejectedEnum",
525
590
  "RejectedExecutePromptEvent",
526
591
  "RejectedExecutePromptResponse",
592
+ "RejectedExecuteWorkflowWorkflowResultEvent",
527
593
  "RejectedFunctionCall",
528
594
  "RejectedPromptExecutionMeta",
529
595
  "SandboxMetricInputParams",
@@ -543,6 +609,8 @@ __all__ = [
543
609
  "SearchResultDocumentRequest",
544
610
  "SearchResultMergingRequest",
545
611
  "SearchResultRequest",
612
+ "SearchResultsEnum",
613
+ "SearchResultsVariableValue",
546
614
  "SearchWeightsRequest",
547
615
  "SlimDeploymentRead",
548
616
  "SlimDocument",
@@ -607,6 +675,15 @@ __all__ = [
607
675
  "TestSuiteTestCase",
608
676
  "UploadDocumentErrorResponse",
609
677
  "UploadDocumentResponse",
678
+ "VariableValue",
679
+ "VariableValue_Array",
680
+ "VariableValue_ChatHistory",
681
+ "VariableValue_Error",
682
+ "VariableValue_FunctionCall",
683
+ "VariableValue_Json",
684
+ "VariableValue_Number",
685
+ "VariableValue_SearchResults",
686
+ "VariableValue_String",
610
687
  "VellumError",
611
688
  "VellumErrorCodeEnum",
612
689
  "VellumErrorRequest",
@@ -632,6 +709,25 @@ __all__ = [
632
709
  "WorkflowNodeResultData_Terminal",
633
710
  "WorkflowNodeResultEvent",
634
711
  "WorkflowNodeResultEventState",
712
+ "WorkflowOutput",
713
+ "WorkflowOutputArray",
714
+ "WorkflowOutputChatHistory",
715
+ "WorkflowOutputError",
716
+ "WorkflowOutputFunctionCall",
717
+ "WorkflowOutputImage",
718
+ "WorkflowOutputJson",
719
+ "WorkflowOutputNumber",
720
+ "WorkflowOutputSearchResults",
721
+ "WorkflowOutputString",
722
+ "WorkflowOutput_Array",
723
+ "WorkflowOutput_ChatHistory",
724
+ "WorkflowOutput_Error",
725
+ "WorkflowOutput_FunctionCall",
726
+ "WorkflowOutput_Image",
727
+ "WorkflowOutput_Json",
728
+ "WorkflowOutput_Number",
729
+ "WorkflowOutput_SearchResults",
730
+ "WorkflowOutput_String",
635
731
  "WorkflowRequestChatHistoryInputRequest",
636
732
  "WorkflowRequestInputRequest",
637
733
  "WorkflowRequestInputRequest_ChatHistory",
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+ ArrayEnum = typing_extensions.Literal["ARRAY"]
@@ -0,0 +1,35 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+
5
+ import datetime as dt
6
+ import typing
7
+
8
+ from ..core.datetime_utils import serialize_datetime
9
+
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
15
+
16
+ class ArrayVariableValue(pydantic.BaseModel):
17
+ value: typing.List[VariableValue]
18
+
19
+ def json(self, **kwargs: typing.Any) -> str:
20
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
+ return super().json(**kwargs_with_defaults)
22
+
23
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().dict(**kwargs_with_defaults)
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ json_encoders = {dt.datetime: serialize_datetime}
31
+
32
+
33
+ from .variable_value import VariableValue # noqa: E402
34
+
35
+ ArrayVariableValue.update_forward_refs()
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+ ChatHistoryEnum = typing_extensions.Literal["CHAT_HISTORY"]
@@ -0,0 +1,29 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from .chat_message import ChatMessage
8
+
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
14
+
15
+ class ChatHistoryVariableValue(pydantic.BaseModel):
16
+ value: typing.Optional[typing.List[ChatMessage]]
17
+
18
+ def json(self, **kwargs: typing.Any) -> str:
19
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
+ return super().json(**kwargs_with_defaults)
21
+
22
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
23
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
24
+ return super().dict(**kwargs_with_defaults)
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing_extensions
4
+
5
+ ErrorEnum = typing_extensions.Literal["ERROR"]