vellum-ai 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +64 -0
- vellum/client.py +8 -8
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/deployments/client.py +2 -2
- vellum/resources/workflow_deployments/client.py +65 -8
- vellum/types/__init__.py +66 -0
- vellum/types/array_enum.py +5 -0
- vellum/types/array_variable_value_item.py +89 -0
- vellum/types/chat_history_variable_value.py +29 -0
- vellum/types/code_execution_node_result_data.py +1 -0
- vellum/types/node_input_compiled_array_value.py +31 -0
- vellum/types/node_input_variable_compiled_value.py +11 -0
- vellum/types/node_output_compiled_array_value.py +30 -0
- vellum/types/node_output_compiled_function_value.py +30 -0
- vellum/types/node_output_compiled_value.py +22 -0
- vellum/types/number_variable_value.py +28 -0
- vellum/types/prompt_node_result_data.py +1 -0
- vellum/types/search_results_variable_value.py +29 -0
- vellum/types/subworkflow_enum.py +5 -0
- vellum/types/subworkflow_node_result.py +30 -0
- vellum/types/terminal_node_array_result.py +31 -0
- vellum/types/terminal_node_function_call_result.py +31 -0
- vellum/types/terminal_node_result_output.py +22 -0
- vellum/types/vellum_error_code_enum.py +5 -0
- vellum/types/workflow_deployment_read.py +57 -0
- vellum/types/workflow_execution_event_error_code.py +5 -0
- vellum/types/workflow_node_result_data.py +11 -0
- vellum/types/workflow_output.py +11 -0
- vellum/types/workflow_output_array.py +35 -0
- vellum/types/workflow_request_chat_history_input_request.py +4 -0
- vellum/types/workflow_request_json_input_request.py +4 -0
- vellum/types/workflow_request_number_input_request.py +4 -0
- vellum/types/workflow_request_string_input_request.py +4 -0
- vellum/types/workflow_result_event_output_data.py +22 -0
- vellum/types/workflow_result_event_output_data_array.py +41 -0
- vellum/types/workflow_result_event_output_data_function_call.py +41 -0
- {vellum_ai-0.3.7.dist-info → vellum_ai-0.3.9.dist-info}/METADATA +1 -1
- {vellum_ai-0.3.7.dist-info → vellum_ai-0.3.9.dist-info}/RECORD +40 -24
- {vellum_ai-0.3.7.dist-info → vellum_ai-0.3.9.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.7.dist-info → vellum_ai-0.3.9.dist-info}/WHEEL +0 -0
@@ -0,0 +1,30 @@
|
|
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
|
+
|
8
|
+
try:
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
10
|
+
except ImportError:
|
11
|
+
import pydantic # type: ignore
|
12
|
+
|
13
|
+
|
14
|
+
class SubworkflowNodeResult(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
A Node Result Event emitted from a Subworkflow Node.
|
17
|
+
"""
|
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}
|
@@ -0,0 +1,31 @@
|
|
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 .array_variable_value_item import ArrayVariableValueItem
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class TerminalNodeArrayResult(pydantic.BaseModel):
|
16
|
+
id: typing.Optional[str]
|
17
|
+
name: str = pydantic.Field(description="The unique name given to the terminal node that produced this output.")
|
18
|
+
value: typing.Optional[typing.List[ArrayVariableValueItem]]
|
19
|
+
|
20
|
+
def json(self, **kwargs: typing.Any) -> str:
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
+
return super().json(**kwargs_with_defaults)
|
23
|
+
|
24
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
+
return super().dict(**kwargs_with_defaults)
|
27
|
+
|
28
|
+
class Config:
|
29
|
+
frozen = True
|
30
|
+
smart_union = True
|
31
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,31 @@
|
|
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 .function_call import FunctionCall
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class TerminalNodeFunctionCallResult(pydantic.BaseModel):
|
16
|
+
id: typing.Optional[str]
|
17
|
+
name: str = pydantic.Field(description="The unique name given to the terminal node that produced this output.")
|
18
|
+
value: typing.Optional[FunctionCall]
|
19
|
+
|
20
|
+
def json(self, **kwargs: typing.Any) -> str:
|
21
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
+
return super().json(**kwargs_with_defaults)
|
23
|
+
|
24
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
+
return super().dict(**kwargs_with_defaults)
|
27
|
+
|
28
|
+
class Config:
|
29
|
+
frozen = True
|
30
|
+
smart_union = True
|
31
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -6,8 +6,10 @@ import typing
|
|
6
6
|
|
7
7
|
import typing_extensions
|
8
8
|
|
9
|
+
from .terminal_node_array_result import TerminalNodeArrayResult
|
9
10
|
from .terminal_node_chat_history_result import TerminalNodeChatHistoryResult
|
10
11
|
from .terminal_node_error_result import TerminalNodeErrorResult
|
12
|
+
from .terminal_node_function_call_result import TerminalNodeFunctionCallResult
|
11
13
|
from .terminal_node_json_result import TerminalNodeJsonResult
|
12
14
|
from .terminal_node_number_result import TerminalNodeNumberResult
|
13
15
|
from .terminal_node_search_results_result import TerminalNodeSearchResultsResult
|
@@ -59,6 +61,24 @@ class TerminalNodeResultOutput_SearchResults(TerminalNodeSearchResultsResult):
|
|
59
61
|
allow_population_by_field_name = True
|
60
62
|
|
61
63
|
|
64
|
+
class TerminalNodeResultOutput_Array(TerminalNodeArrayResult):
|
65
|
+
type: typing_extensions.Literal["ARRAY"]
|
66
|
+
|
67
|
+
class Config:
|
68
|
+
frozen = True
|
69
|
+
smart_union = True
|
70
|
+
allow_population_by_field_name = True
|
71
|
+
|
72
|
+
|
73
|
+
class TerminalNodeResultOutput_FunctionCall(TerminalNodeFunctionCallResult):
|
74
|
+
type: typing_extensions.Literal["FUNCTION_CALL"]
|
75
|
+
|
76
|
+
class Config:
|
77
|
+
frozen = True
|
78
|
+
smart_union = True
|
79
|
+
allow_population_by_field_name = True
|
80
|
+
|
81
|
+
|
62
82
|
class TerminalNodeResultOutput_Error(TerminalNodeErrorResult):
|
63
83
|
type: typing_extensions.Literal["ERROR"]
|
64
84
|
|
@@ -74,5 +94,7 @@ TerminalNodeResultOutput = typing.Union[
|
|
74
94
|
TerminalNodeResultOutput_Json,
|
75
95
|
TerminalNodeResultOutput_ChatHistory,
|
76
96
|
TerminalNodeResultOutput_SearchResults,
|
97
|
+
TerminalNodeResultOutput_Array,
|
98
|
+
TerminalNodeResultOutput_FunctionCall,
|
77
99
|
TerminalNodeResultOutput_Error,
|
78
100
|
]
|
@@ -11,17 +11,20 @@ class VellumErrorCodeEnum(str, enum.Enum):
|
|
11
11
|
- `INVALID_REQUEST` - INVALID_REQUEST
|
12
12
|
- `PROVIDER_ERROR` - PROVIDER_ERROR
|
13
13
|
- `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
|
14
|
+
- `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
|
14
15
|
"""
|
15
16
|
|
16
17
|
INVALID_REQUEST = "INVALID_REQUEST"
|
17
18
|
PROVIDER_ERROR = "PROVIDER_ERROR"
|
18
19
|
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
|
20
|
+
USER_DEFINED_ERROR = "USER_DEFINED_ERROR"
|
19
21
|
|
20
22
|
def visit(
|
21
23
|
self,
|
22
24
|
invalid_request: typing.Callable[[], T_Result],
|
23
25
|
provider_error: typing.Callable[[], T_Result],
|
24
26
|
internal_server_error: typing.Callable[[], T_Result],
|
27
|
+
user_defined_error: typing.Callable[[], T_Result],
|
25
28
|
) -> T_Result:
|
26
29
|
if self is VellumErrorCodeEnum.INVALID_REQUEST:
|
27
30
|
return invalid_request()
|
@@ -29,3 +32,5 @@ class VellumErrorCodeEnum(str, enum.Enum):
|
|
29
32
|
return provider_error()
|
30
33
|
if self is VellumErrorCodeEnum.INTERNAL_SERVER_ERROR:
|
31
34
|
return internal_server_error()
|
35
|
+
if self is VellumErrorCodeEnum.USER_DEFINED_ERROR:
|
36
|
+
return user_defined_error()
|
@@ -0,0 +1,57 @@
|
|
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 .entity_status import EntityStatus
|
8
|
+
from .environment_enum import EnvironmentEnum
|
9
|
+
from .vellum_variable import VellumVariable
|
10
|
+
|
11
|
+
try:
|
12
|
+
import pydantic.v1 as pydantic # type: ignore
|
13
|
+
except ImportError:
|
14
|
+
import pydantic # type: ignore
|
15
|
+
|
16
|
+
|
17
|
+
class WorkflowDeploymentRead(pydantic.BaseModel):
|
18
|
+
id: str
|
19
|
+
name: str = pydantic.Field(
|
20
|
+
description="A name that uniquely identifies this workflow deployment within its workspace"
|
21
|
+
)
|
22
|
+
label: str = pydantic.Field(description="A human-readable label for the workflow deployment")
|
23
|
+
status: typing.Optional[EntityStatus] = pydantic.Field(
|
24
|
+
description=(
|
25
|
+
"The current status of the workflow deployment\n" "\n" "- `ACTIVE` - Active\n" "- `ARCHIVED` - Archived\n"
|
26
|
+
)
|
27
|
+
)
|
28
|
+
environment: typing.Optional[EnvironmentEnum] = pydantic.Field(
|
29
|
+
description=(
|
30
|
+
"The environment this workflow deployment is used in\n"
|
31
|
+
"\n"
|
32
|
+
"- `DEVELOPMENT` - Development\n"
|
33
|
+
"- `STAGING` - Staging\n"
|
34
|
+
"- `PRODUCTION` - Production\n"
|
35
|
+
)
|
36
|
+
)
|
37
|
+
created: dt.datetime
|
38
|
+
last_deployed_on: dt.datetime
|
39
|
+
input_variables: typing.List[VellumVariable] = pydantic.Field(
|
40
|
+
description="The input variables this Workflow Deployment expects to receive values for when it is executed."
|
41
|
+
)
|
42
|
+
output_variables: typing.List[VellumVariable] = pydantic.Field(
|
43
|
+
description="The output variables this Workflow Deployment produces values for when it's executed."
|
44
|
+
)
|
45
|
+
|
46
|
+
def json(self, **kwargs: typing.Any) -> str:
|
47
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
48
|
+
return super().json(**kwargs_with_defaults)
|
49
|
+
|
50
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
51
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
52
|
+
return super().dict(**kwargs_with_defaults)
|
53
|
+
|
54
|
+
class Config:
|
55
|
+
frozen = True
|
56
|
+
smart_union = True
|
57
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -14,6 +14,7 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
14
14
|
- `NODE_EXECUTION` - NODE_EXECUTION
|
15
15
|
- `LLM_PROVIDER` - LLM_PROVIDER
|
16
16
|
- `INVALID_TEMPLATE` - INVALID_TEMPLATE
|
17
|
+
- `USER_DEFINED_ERROR` - USER_DEFINED_ERROR
|
17
18
|
"""
|
18
19
|
|
19
20
|
WORKFLOW_INITIALIZATION = "WORKFLOW_INITIALIZATION"
|
@@ -22,6 +23,7 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
22
23
|
NODE_EXECUTION = "NODE_EXECUTION"
|
23
24
|
LLM_PROVIDER = "LLM_PROVIDER"
|
24
25
|
INVALID_TEMPLATE = "INVALID_TEMPLATE"
|
26
|
+
USER_DEFINED_ERROR = "USER_DEFINED_ERROR"
|
25
27
|
|
26
28
|
def visit(
|
27
29
|
self,
|
@@ -31,6 +33,7 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
31
33
|
node_execution: typing.Callable[[], T_Result],
|
32
34
|
llm_provider: typing.Callable[[], T_Result],
|
33
35
|
invalid_template: typing.Callable[[], T_Result],
|
36
|
+
user_defined_error: typing.Callable[[], T_Result],
|
34
37
|
) -> T_Result:
|
35
38
|
if self is WorkflowExecutionEventErrorCode.WORKFLOW_INITIALIZATION:
|
36
39
|
return workflow_initialization()
|
@@ -44,3 +47,5 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
44
47
|
return llm_provider()
|
45
48
|
if self is WorkflowExecutionEventErrorCode.INVALID_TEMPLATE:
|
46
49
|
return invalid_template()
|
50
|
+
if self is WorkflowExecutionEventErrorCode.USER_DEFINED_ERROR:
|
51
|
+
return user_defined_error()
|
@@ -11,6 +11,7 @@ from .code_execution_node_result import CodeExecutionNodeResult
|
|
11
11
|
from .conditional_node_result import ConditionalNodeResult
|
12
12
|
from .prompt_node_result import PromptNodeResult
|
13
13
|
from .search_node_result import SearchNodeResult
|
14
|
+
from .subworkflow_node_result import SubworkflowNodeResult
|
14
15
|
from .templating_node_result import TemplatingNodeResult
|
15
16
|
from .terminal_node_result import TerminalNodeResult
|
16
17
|
|
@@ -78,6 +79,15 @@ class WorkflowNodeResultData_Terminal(TerminalNodeResult):
|
|
78
79
|
allow_population_by_field_name = True
|
79
80
|
|
80
81
|
|
82
|
+
class WorkflowNodeResultData_Subworkflow(SubworkflowNodeResult):
|
83
|
+
type: typing_extensions.Literal["SUBWORKFLOW"]
|
84
|
+
|
85
|
+
class Config:
|
86
|
+
frozen = True
|
87
|
+
smart_union = True
|
88
|
+
allow_population_by_field_name = True
|
89
|
+
|
90
|
+
|
81
91
|
WorkflowNodeResultData = typing.Union[
|
82
92
|
WorkflowNodeResultData_Prompt,
|
83
93
|
WorkflowNodeResultData_Search,
|
@@ -86,4 +96,5 @@ WorkflowNodeResultData = typing.Union[
|
|
86
96
|
WorkflowNodeResultData_Conditional,
|
87
97
|
WorkflowNodeResultData_Api,
|
88
98
|
WorkflowNodeResultData_Terminal,
|
99
|
+
WorkflowNodeResultData_Subworkflow,
|
89
100
|
]
|
vellum/types/workflow_output.py
CHANGED
@@ -6,6 +6,7 @@ import typing
|
|
6
6
|
|
7
7
|
import typing_extensions
|
8
8
|
|
9
|
+
from .workflow_output_array import WorkflowOutputArray
|
9
10
|
from .workflow_output_chat_history import WorkflowOutputChatHistory
|
10
11
|
from .workflow_output_error import WorkflowOutputError
|
11
12
|
from .workflow_output_function_call import WorkflowOutputFunctionCall
|
@@ -61,6 +62,15 @@ class WorkflowOutput_SearchResults(WorkflowOutputSearchResults):
|
|
61
62
|
allow_population_by_field_name = True
|
62
63
|
|
63
64
|
|
65
|
+
class WorkflowOutput_Array(WorkflowOutputArray):
|
66
|
+
type: typing_extensions.Literal["ARRAY"]
|
67
|
+
|
68
|
+
class Config:
|
69
|
+
frozen = True
|
70
|
+
smart_union = True
|
71
|
+
allow_population_by_field_name = True
|
72
|
+
|
73
|
+
|
64
74
|
class WorkflowOutput_Error(WorkflowOutputError):
|
65
75
|
type: typing_extensions.Literal["ERROR"]
|
66
76
|
|
@@ -94,6 +104,7 @@ WorkflowOutput = typing.Union[
|
|
94
104
|
WorkflowOutput_Json,
|
95
105
|
WorkflowOutput_ChatHistory,
|
96
106
|
WorkflowOutput_SearchResults,
|
107
|
+
WorkflowOutput_Array,
|
97
108
|
WorkflowOutput_Error,
|
98
109
|
WorkflowOutput_FunctionCall,
|
99
110
|
WorkflowOutput_Image,
|
@@ -0,0 +1,35 @@
|
|
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 .array_variable_value_item import ArrayVariableValueItem
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class WorkflowOutputArray(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
An array output from a Workflow execution.
|
18
|
+
"""
|
19
|
+
|
20
|
+
id: str
|
21
|
+
name: str = pydantic.Field(description="The output's name, as defined in the workflow")
|
22
|
+
value: typing.List[ArrayVariableValueItem]
|
23
|
+
|
24
|
+
def json(self, **kwargs: typing.Any) -> str:
|
25
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
+
return super().json(**kwargs_with_defaults)
|
27
|
+
|
28
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
29
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
30
|
+
return super().dict(**kwargs_with_defaults)
|
31
|
+
|
32
|
+
class Config:
|
33
|
+
frozen = True
|
34
|
+
smart_union = True
|
35
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -13,6 +13,10 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class WorkflowRequestChatHistoryInputRequest(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
The input for a chat history variable in a Workflow.
|
18
|
+
"""
|
19
|
+
|
16
20
|
name: str = pydantic.Field(description="The variable's name, as defined in the Workflow.")
|
17
21
|
value: typing.List[ChatMessageRequest]
|
18
22
|
|
@@ -12,6 +12,10 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class WorkflowRequestJsonInputRequest(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
The input for a JSON variable in a Workflow.
|
17
|
+
"""
|
18
|
+
|
15
19
|
name: str = pydantic.Field(description="The variable's name, as defined in the Workflow.")
|
16
20
|
value: typing.Dict[str, typing.Any]
|
17
21
|
|
@@ -12,6 +12,10 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class WorkflowRequestNumberInputRequest(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
The input for a number variable in a Workflow.
|
17
|
+
"""
|
18
|
+
|
15
19
|
name: str = pydantic.Field(description="The variable's name, as defined in the Workflow.")
|
16
20
|
value: float
|
17
21
|
|
@@ -12,6 +12,10 @@ except ImportError:
|
|
12
12
|
|
13
13
|
|
14
14
|
class WorkflowRequestStringInputRequest(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
The input for a string variable in a Workflow.
|
17
|
+
"""
|
18
|
+
|
15
19
|
name: str = pydantic.Field(description="The variable's name, as defined in the Workflow.")
|
16
20
|
value: str
|
17
21
|
|
@@ -6,8 +6,10 @@ import typing
|
|
6
6
|
|
7
7
|
import typing_extensions
|
8
8
|
|
9
|
+
from .workflow_result_event_output_data_array import WorkflowResultEventOutputDataArray
|
9
10
|
from .workflow_result_event_output_data_chat_history import WorkflowResultEventOutputDataChatHistory
|
10
11
|
from .workflow_result_event_output_data_error import WorkflowResultEventOutputDataError
|
12
|
+
from .workflow_result_event_output_data_function_call import WorkflowResultEventOutputDataFunctionCall
|
11
13
|
from .workflow_result_event_output_data_json import WorkflowResultEventOutputDataJson
|
12
14
|
from .workflow_result_event_output_data_number import WorkflowResultEventOutputDataNumber
|
13
15
|
from .workflow_result_event_output_data_search_results import WorkflowResultEventOutputDataSearchResults
|
@@ -59,6 +61,24 @@ class WorkflowResultEventOutputData_SearchResults(WorkflowResultEventOutputDataS
|
|
59
61
|
allow_population_by_field_name = True
|
60
62
|
|
61
63
|
|
64
|
+
class WorkflowResultEventOutputData_Array(WorkflowResultEventOutputDataArray):
|
65
|
+
type: typing_extensions.Literal["ARRAY"]
|
66
|
+
|
67
|
+
class Config:
|
68
|
+
frozen = True
|
69
|
+
smart_union = True
|
70
|
+
allow_population_by_field_name = True
|
71
|
+
|
72
|
+
|
73
|
+
class WorkflowResultEventOutputData_FunctionCall(WorkflowResultEventOutputDataFunctionCall):
|
74
|
+
type: typing_extensions.Literal["FUNCTION_CALL"]
|
75
|
+
|
76
|
+
class Config:
|
77
|
+
frozen = True
|
78
|
+
smart_union = True
|
79
|
+
allow_population_by_field_name = True
|
80
|
+
|
81
|
+
|
62
82
|
class WorkflowResultEventOutputData_Error(WorkflowResultEventOutputDataError):
|
63
83
|
type: typing_extensions.Literal["ERROR"]
|
64
84
|
|
@@ -74,5 +94,7 @@ WorkflowResultEventOutputData = typing.Union[
|
|
74
94
|
WorkflowResultEventOutputData_Json,
|
75
95
|
WorkflowResultEventOutputData_ChatHistory,
|
76
96
|
WorkflowResultEventOutputData_SearchResults,
|
97
|
+
WorkflowResultEventOutputData_Array,
|
98
|
+
WorkflowResultEventOutputData_FunctionCall,
|
77
99
|
WorkflowResultEventOutputData_Error,
|
78
100
|
]
|
@@ -0,0 +1,41 @@
|
|
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 .array_variable_value_item import ArrayVariableValueItem
|
8
|
+
from .workflow_node_result_event_state import WorkflowNodeResultEventState
|
9
|
+
|
10
|
+
try:
|
11
|
+
import pydantic.v1 as pydantic # type: ignore
|
12
|
+
except ImportError:
|
13
|
+
import pydantic # type: ignore
|
14
|
+
|
15
|
+
|
16
|
+
class WorkflowResultEventOutputDataArray(pydantic.BaseModel):
|
17
|
+
"""
|
18
|
+
An Array output returned from a Workflow execution.
|
19
|
+
"""
|
20
|
+
|
21
|
+
id: typing.Optional[str]
|
22
|
+
name: str
|
23
|
+
state: WorkflowNodeResultEventState
|
24
|
+
node_id: str
|
25
|
+
delta: typing.Optional[str] = pydantic.Field(
|
26
|
+
description="The newly output string value. Only relevant for string outputs with a state of STREAMING."
|
27
|
+
)
|
28
|
+
value: typing.Optional[typing.List[ArrayVariableValueItem]]
|
29
|
+
|
30
|
+
def json(self, **kwargs: typing.Any) -> str:
|
31
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
32
|
+
return super().json(**kwargs_with_defaults)
|
33
|
+
|
34
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
35
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
36
|
+
return super().dict(**kwargs_with_defaults)
|
37
|
+
|
38
|
+
class Config:
|
39
|
+
frozen = True
|
40
|
+
smart_union = True
|
41
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,41 @@
|
|
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 .function_call import FunctionCall
|
8
|
+
from .workflow_node_result_event_state import WorkflowNodeResultEventState
|
9
|
+
|
10
|
+
try:
|
11
|
+
import pydantic.v1 as pydantic # type: ignore
|
12
|
+
except ImportError:
|
13
|
+
import pydantic # type: ignore
|
14
|
+
|
15
|
+
|
16
|
+
class WorkflowResultEventOutputDataFunctionCall(pydantic.BaseModel):
|
17
|
+
"""
|
18
|
+
A Function Call output returned from a Workflow execution.
|
19
|
+
"""
|
20
|
+
|
21
|
+
id: typing.Optional[str]
|
22
|
+
name: str
|
23
|
+
state: WorkflowNodeResultEventState
|
24
|
+
node_id: str
|
25
|
+
delta: typing.Optional[str] = pydantic.Field(
|
26
|
+
description="The newly output string value. Only relevant for string outputs with a state of STREAMING."
|
27
|
+
)
|
28
|
+
value: typing.Optional[FunctionCall]
|
29
|
+
|
30
|
+
def json(self, **kwargs: typing.Any) -> str:
|
31
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
32
|
+
return super().json(**kwargs_with_defaults)
|
33
|
+
|
34
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
35
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
36
|
+
return super().dict(**kwargs_with_defaults)
|
37
|
+
|
38
|
+
class Config:
|
39
|
+
frozen = True
|
40
|
+
smart_union = True
|
41
|
+
json_encoders = {dt.datetime: serialize_datetime}
|