vellum-ai 0.3.10__py3-none-any.whl → 0.3.12__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 +38 -0
- vellum/client.py +14 -14
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/deployments/client.py +30 -0
- vellum/resources/document_indexes/client.py +282 -0
- vellum/types/__init__.py +40 -0
- vellum/types/array_variable_value_item.py +11 -0
- vellum/types/chat_message.py +3 -0
- vellum/types/chat_message_request.py +3 -0
- vellum/types/execution_array_vellum_value.py +31 -0
- vellum/types/execution_chat_history_vellum_value.py +31 -0
- vellum/types/execution_error_vellum_value.py +31 -0
- vellum/types/execution_function_call_vellum_value.py +31 -0
- vellum/types/execution_json_vellum_value.py +30 -0
- vellum/types/execution_number_vellum_value.py +30 -0
- vellum/types/execution_search_results_vellum_value.py +31 -0
- vellum/types/execution_string_vellum_value.py +30 -0
- vellum/types/execution_vellum_value.py +100 -0
- vellum/types/fulfilled_workflow_node_result_event.py +2 -0
- vellum/types/generate_request.py +1 -1
- vellum/types/image_variable_value.py +33 -0
- vellum/types/initiated_workflow_node_result_event.py +1 -0
- vellum/types/prompt_template_block_properties.py +1 -0
- vellum/types/prompt_template_block_properties_request.py +1 -0
- vellum/types/rejected_workflow_node_result_event.py +1 -0
- vellum/types/streaming_workflow_node_result_event.py +1 -0
- vellum/types/workflow_execution_event_error_code.py +5 -0
- vellum/types/workflow_execution_event_type.py +2 -2
- vellum/types/workflow_result_event.py +2 -0
- {vellum_ai-0.3.10.dist-info → vellum_ai-0.3.12.dist-info}/METADATA +1 -1
- {vellum_ai-0.3.10.dist-info → vellum_ai-0.3.12.dist-info}/RECORD +33 -23
- {vellum_ai-0.3.10.dist-info → vellum_ai-0.3.12.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.10.dist-info → vellum_ai-0.3.12.dist-info}/WHEEL +0 -0
@@ -9,6 +9,7 @@ import typing_extensions
|
|
9
9
|
from .chat_history_variable_value import ChatHistoryVariableValue
|
10
10
|
from .error_variable_value import ErrorVariableValue
|
11
11
|
from .function_call_variable_value import FunctionCallVariableValue
|
12
|
+
from .image_variable_value import ImageVariableValue
|
12
13
|
from .json_variable_value import JsonVariableValue
|
13
14
|
from .number_variable_value import NumberVariableValue
|
14
15
|
from .search_results_variable_value import SearchResultsVariableValue
|
@@ -78,6 +79,15 @@ class ArrayVariableValueItem_FunctionCall(FunctionCallVariableValue):
|
|
78
79
|
allow_population_by_field_name = True
|
79
80
|
|
80
81
|
|
82
|
+
class ArrayVariableValueItem_Image(ImageVariableValue):
|
83
|
+
type: typing_extensions.Literal["IMAGE"]
|
84
|
+
|
85
|
+
class Config:
|
86
|
+
frozen = True
|
87
|
+
smart_union = True
|
88
|
+
allow_population_by_field_name = True
|
89
|
+
|
90
|
+
|
81
91
|
ArrayVariableValueItem = typing.Union[
|
82
92
|
ArrayVariableValueItem_String,
|
83
93
|
ArrayVariableValueItem_Number,
|
@@ -86,4 +96,5 @@ ArrayVariableValueItem = typing.Union[
|
|
86
96
|
ArrayVariableValueItem_SearchResults,
|
87
97
|
ArrayVariableValueItem_Error,
|
88
98
|
ArrayVariableValueItem_FunctionCall,
|
99
|
+
ArrayVariableValueItem_Image,
|
89
100
|
]
|
vellum/types/chat_message.py
CHANGED
@@ -17,6 +17,9 @@ class ChatMessage(pydantic.BaseModel):
|
|
17
17
|
text: typing.Optional[str]
|
18
18
|
role: ChatMessageRole
|
19
19
|
content: typing.Optional[ChatMessageContent]
|
20
|
+
source: typing.Optional[str] = pydantic.Field(
|
21
|
+
description="An optional identifier representing who or what generated this message."
|
22
|
+
)
|
20
23
|
|
21
24
|
def json(self, **kwargs: typing.Any) -> str:
|
22
25
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -17,6 +17,9 @@ class ChatMessageRequest(pydantic.BaseModel):
|
|
17
17
|
text: typing.Optional[str]
|
18
18
|
role: ChatMessageRole
|
19
19
|
content: typing.Optional[ChatMessageContentRequest]
|
20
|
+
source: typing.Optional[str] = pydantic.Field(
|
21
|
+
description="An optional identifier representing who or what generated this message."
|
22
|
+
)
|
20
23
|
|
21
24
|
def json(self, **kwargs: typing.Any) -> str:
|
22
25
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -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 ExecutionArrayVellumValue(pydantic.BaseModel):
|
16
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
17
|
+
name: str
|
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 .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 ExecutionChatHistoryVellumValue(pydantic.BaseModel):
|
16
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
17
|
+
name: str
|
18
|
+
value: typing.Optional[typing.List[ChatMessage]]
|
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 .vellum_error import VellumError
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class ExecutionErrorVellumValue(pydantic.BaseModel):
|
16
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
17
|
+
name: str
|
18
|
+
value: typing.Optional[VellumError]
|
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 ExecutionFunctionCallVellumValue(pydantic.BaseModel):
|
16
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
17
|
+
name: str
|
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}
|
@@ -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 ExecutionJsonVellumValue(pydantic.BaseModel):
|
15
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
16
|
+
name: str
|
17
|
+
value: typing.Optional[typing.Dict[str, typing.Any]]
|
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,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 ExecutionNumberVellumValue(pydantic.BaseModel):
|
15
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
16
|
+
name: str
|
17
|
+
value: typing.Optional[float]
|
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 .search_result import SearchResult
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class ExecutionSearchResultsVellumValue(pydantic.BaseModel):
|
16
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
17
|
+
name: str
|
18
|
+
value: typing.Optional[typing.List[SearchResult]]
|
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,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 ExecutionStringVellumValue(pydantic.BaseModel):
|
15
|
+
id: str = pydantic.Field(description="The variable's uniquely identifying internal id.")
|
16
|
+
name: str
|
17
|
+
value: typing.Optional[str]
|
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,100 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import typing
|
6
|
+
|
7
|
+
import typing_extensions
|
8
|
+
|
9
|
+
from .execution_array_vellum_value import ExecutionArrayVellumValue
|
10
|
+
from .execution_chat_history_vellum_value import ExecutionChatHistoryVellumValue
|
11
|
+
from .execution_error_vellum_value import ExecutionErrorVellumValue
|
12
|
+
from .execution_function_call_vellum_value import ExecutionFunctionCallVellumValue
|
13
|
+
from .execution_json_vellum_value import ExecutionJsonVellumValue
|
14
|
+
from .execution_number_vellum_value import ExecutionNumberVellumValue
|
15
|
+
from .execution_search_results_vellum_value import ExecutionSearchResultsVellumValue
|
16
|
+
from .execution_string_vellum_value import ExecutionStringVellumValue
|
17
|
+
|
18
|
+
|
19
|
+
class ExecutionVellumValue_String(ExecutionStringVellumValue):
|
20
|
+
type: typing_extensions.Literal["STRING"]
|
21
|
+
|
22
|
+
class Config:
|
23
|
+
frozen = True
|
24
|
+
smart_union = True
|
25
|
+
allow_population_by_field_name = True
|
26
|
+
|
27
|
+
|
28
|
+
class ExecutionVellumValue_Number(ExecutionNumberVellumValue):
|
29
|
+
type: typing_extensions.Literal["NUMBER"]
|
30
|
+
|
31
|
+
class Config:
|
32
|
+
frozen = True
|
33
|
+
smart_union = True
|
34
|
+
allow_population_by_field_name = True
|
35
|
+
|
36
|
+
|
37
|
+
class ExecutionVellumValue_Json(ExecutionJsonVellumValue):
|
38
|
+
type: typing_extensions.Literal["JSON"]
|
39
|
+
|
40
|
+
class Config:
|
41
|
+
frozen = True
|
42
|
+
smart_union = True
|
43
|
+
allow_population_by_field_name = True
|
44
|
+
|
45
|
+
|
46
|
+
class ExecutionVellumValue_ChatHistory(ExecutionChatHistoryVellumValue):
|
47
|
+
type: typing_extensions.Literal["CHAT_HISTORY"]
|
48
|
+
|
49
|
+
class Config:
|
50
|
+
frozen = True
|
51
|
+
smart_union = True
|
52
|
+
allow_population_by_field_name = True
|
53
|
+
|
54
|
+
|
55
|
+
class ExecutionVellumValue_SearchResults(ExecutionSearchResultsVellumValue):
|
56
|
+
type: typing_extensions.Literal["SEARCH_RESULTS"]
|
57
|
+
|
58
|
+
class Config:
|
59
|
+
frozen = True
|
60
|
+
smart_union = True
|
61
|
+
allow_population_by_field_name = True
|
62
|
+
|
63
|
+
|
64
|
+
class ExecutionVellumValue_Error(ExecutionErrorVellumValue):
|
65
|
+
type: typing_extensions.Literal["ERROR"]
|
66
|
+
|
67
|
+
class Config:
|
68
|
+
frozen = True
|
69
|
+
smart_union = True
|
70
|
+
allow_population_by_field_name = True
|
71
|
+
|
72
|
+
|
73
|
+
class ExecutionVellumValue_Array(ExecutionArrayVellumValue):
|
74
|
+
type: typing_extensions.Literal["ARRAY"]
|
75
|
+
|
76
|
+
class Config:
|
77
|
+
frozen = True
|
78
|
+
smart_union = True
|
79
|
+
allow_population_by_field_name = True
|
80
|
+
|
81
|
+
|
82
|
+
class ExecutionVellumValue_FunctionCall(ExecutionFunctionCallVellumValue):
|
83
|
+
type: typing_extensions.Literal["FUNCTION_CALL"]
|
84
|
+
|
85
|
+
class Config:
|
86
|
+
frozen = True
|
87
|
+
smart_union = True
|
88
|
+
allow_population_by_field_name = True
|
89
|
+
|
90
|
+
|
91
|
+
ExecutionVellumValue = typing.Union[
|
92
|
+
ExecutionVellumValue_String,
|
93
|
+
ExecutionVellumValue_Number,
|
94
|
+
ExecutionVellumValue_Json,
|
95
|
+
ExecutionVellumValue_ChatHistory,
|
96
|
+
ExecutionVellumValue_SearchResults,
|
97
|
+
ExecutionVellumValue_Error,
|
98
|
+
ExecutionVellumValue_Array,
|
99
|
+
ExecutionVellumValue_FunctionCall,
|
100
|
+
]
|
@@ -23,7 +23,9 @@ class FulfilledWorkflowNodeResultEvent(pydantic.BaseModel):
|
|
23
23
|
node_result_id: str
|
24
24
|
ts: typing.Optional[dt.datetime]
|
25
25
|
data: typing.Optional[WorkflowNodeResultData]
|
26
|
+
source_execution_id: typing.Optional[str]
|
26
27
|
output_values: typing.Optional[typing.List[NodeOutputCompiledValue]]
|
28
|
+
mocked: typing.Optional[bool]
|
27
29
|
|
28
30
|
def json(self, **kwargs: typing.Any) -> str:
|
29
31
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
vellum/types/generate_request.py
CHANGED
@@ -17,7 +17,7 @@ class GenerateRequest(pydantic.BaseModel):
|
|
17
17
|
description="Key/value pairs for each template variable defined in the deployment's prompt."
|
18
18
|
)
|
19
19
|
chat_history: typing.Optional[typing.List[ChatMessageRequest]] = pydantic.Field(
|
20
|
-
description="Optionally provide a list of chat messages that'll be used in place of the special
|
20
|
+
description="Optionally provide a list of chat messages that'll be used in place of the special chat_history variable, if included in the prompt."
|
21
21
|
)
|
22
22
|
external_ids: typing.Optional[typing.List[str]] = pydantic.Field(
|
23
23
|
description="Optionally include a unique identifier for each generation, as represented outside of Vellum. Note that this should generally be a list of length one."
|
@@ -0,0 +1,33 @@
|
|
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 .vellum_image import VellumImage
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class ImageVariableValue(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
A base Vellum primitive value representing an image.
|
18
|
+
"""
|
19
|
+
|
20
|
+
value: typing.Optional[VellumImage]
|
21
|
+
|
22
|
+
def json(self, **kwargs: typing.Any) -> str:
|
23
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
24
|
+
return super().json(**kwargs_with_defaults)
|
25
|
+
|
26
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
27
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
28
|
+
return super().dict(**kwargs_with_defaults)
|
29
|
+
|
30
|
+
class Config:
|
31
|
+
frozen = True
|
32
|
+
smart_union = True
|
33
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -23,6 +23,7 @@ class InitiatedWorkflowNodeResultEvent(pydantic.BaseModel):
|
|
23
23
|
node_result_id: str
|
24
24
|
ts: typing.Optional[dt.datetime]
|
25
25
|
data: typing.Optional[WorkflowNodeResultData]
|
26
|
+
source_execution_id: typing.Optional[str]
|
26
27
|
input_values: typing.Optional[typing.List[NodeInputVariableCompiledValue]]
|
27
28
|
|
28
29
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -18,6 +18,7 @@ except ImportError:
|
|
18
18
|
class PromptTemplateBlockProperties(pydantic.BaseModel):
|
19
19
|
chat_role: typing.Optional[ChatMessageRole]
|
20
20
|
chat_message_unterminated: typing.Optional[bool]
|
21
|
+
chat_source: typing.Optional[str]
|
21
22
|
template: typing.Optional[str]
|
22
23
|
template_type: typing.Optional[VellumVariableType]
|
23
24
|
function_name: typing.Optional[str]
|
@@ -18,6 +18,7 @@ except ImportError:
|
|
18
18
|
class PromptTemplateBlockPropertiesRequest(pydantic.BaseModel):
|
19
19
|
chat_role: typing.Optional[ChatMessageRole]
|
20
20
|
chat_message_unterminated: typing.Optional[bool]
|
21
|
+
chat_source: typing.Optional[str]
|
21
22
|
template: typing.Optional[str]
|
22
23
|
template_type: typing.Optional[VellumVariableType]
|
23
24
|
function_name: typing.Optional[str]
|
@@ -23,6 +23,7 @@ class RejectedWorkflowNodeResultEvent(pydantic.BaseModel):
|
|
23
23
|
node_result_id: str
|
24
24
|
ts: typing.Optional[dt.datetime]
|
25
25
|
data: typing.Optional[WorkflowNodeResultData]
|
26
|
+
source_execution_id: typing.Optional[str]
|
26
27
|
error: WorkflowEventError
|
27
28
|
|
28
29
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -23,6 +23,7 @@ class StreamingWorkflowNodeResultEvent(pydantic.BaseModel):
|
|
23
23
|
node_result_id: str
|
24
24
|
ts: typing.Optional[dt.datetime]
|
25
25
|
data: typing.Optional[WorkflowNodeResultData]
|
26
|
+
source_execution_id: typing.Optional[str]
|
26
27
|
output: typing.Optional[NodeOutputCompiledValue]
|
27
28
|
output_index: typing.Optional[int]
|
28
29
|
|
@@ -9,6 +9,7 @@ T_Result = typing.TypeVar("T_Result")
|
|
9
9
|
class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
10
10
|
"""
|
11
11
|
- `WORKFLOW_INITIALIZATION` - WORKFLOW_INITIALIZATION
|
12
|
+
- `WORKFLOW_CANCELLED` - WORKFLOW_CANCELLED
|
12
13
|
- `NODE_EXECUTION_COUNT_LIMIT_REACHED` - NODE_EXECUTION_COUNT_LIMIT_REACHED
|
13
14
|
- `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR
|
14
15
|
- `NODE_EXECUTION` - NODE_EXECUTION
|
@@ -18,6 +19,7 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
18
19
|
"""
|
19
20
|
|
20
21
|
WORKFLOW_INITIALIZATION = "WORKFLOW_INITIALIZATION"
|
22
|
+
WORKFLOW_CANCELLED = "WORKFLOW_CANCELLED"
|
21
23
|
NODE_EXECUTION_COUNT_LIMIT_REACHED = "NODE_EXECUTION_COUNT_LIMIT_REACHED"
|
22
24
|
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
|
23
25
|
NODE_EXECUTION = "NODE_EXECUTION"
|
@@ -28,6 +30,7 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
28
30
|
def visit(
|
29
31
|
self,
|
30
32
|
workflow_initialization: typing.Callable[[], T_Result],
|
33
|
+
workflow_cancelled: typing.Callable[[], T_Result],
|
31
34
|
node_execution_count_limit_reached: typing.Callable[[], T_Result],
|
32
35
|
internal_server_error: typing.Callable[[], T_Result],
|
33
36
|
node_execution: typing.Callable[[], T_Result],
|
@@ -37,6 +40,8 @@ class WorkflowExecutionEventErrorCode(str, enum.Enum):
|
|
37
40
|
) -> T_Result:
|
38
41
|
if self is WorkflowExecutionEventErrorCode.WORKFLOW_INITIALIZATION:
|
39
42
|
return workflow_initialization()
|
43
|
+
if self is WorkflowExecutionEventErrorCode.WORKFLOW_CANCELLED:
|
44
|
+
return workflow_cancelled()
|
40
45
|
if self is WorkflowExecutionEventErrorCode.NODE_EXECUTION_COUNT_LIMIT_REACHED:
|
41
46
|
return node_execution_count_limit_reached()
|
42
47
|
if self is WorkflowExecutionEventErrorCode.INTERNAL_SERVER_ERROR:
|
@@ -4,6 +4,7 @@ import datetime as dt
|
|
4
4
|
import typing
|
5
5
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from .execution_vellum_value import ExecutionVellumValue
|
7
8
|
from .workflow_event_error import WorkflowEventError
|
8
9
|
from .workflow_node_result_event_state import WorkflowNodeResultEventState
|
9
10
|
from .workflow_output import WorkflowOutput
|
@@ -22,6 +23,7 @@ class WorkflowResultEvent(pydantic.BaseModel):
|
|
22
23
|
output: typing.Optional[WorkflowResultEventOutputData]
|
23
24
|
error: typing.Optional[WorkflowEventError]
|
24
25
|
outputs: typing.Optional[typing.List[WorkflowOutput]]
|
26
|
+
inputs: typing.Optional[typing.List[ExecutionVellumValue]]
|
25
27
|
|
26
28
|
def json(self, **kwargs: typing.Any) -> str:
|
27
29
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|