vellum-ai 0.1.13__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.
- vellum/__init__.py +172 -4
- vellum/client.py +214 -10
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/__init__.py +15 -1
- vellum/resources/deployments/__init__.py +3 -0
- vellum/resources/deployments/client.py +113 -2
- vellum/resources/deployments/types/__init__.py +5 -0
- vellum/resources/deployments/types/deployments_list_request_status.py +17 -0
- vellum/resources/document_indexes/client.py +55 -9
- vellum/resources/documents/client.py +22 -2
- vellum/resources/model_versions/client.py +18 -0
- vellum/resources/registered_prompts/client.py +104 -0
- vellum/resources/sandboxes/client.py +66 -4
- vellum/resources/test_suites/client.py +6 -6
- vellum/resources/workflow_deployments/__init__.py +5 -0
- vellum/resources/workflow_deployments/client.py +116 -0
- vellum/resources/workflow_deployments/types/__init__.py +5 -0
- vellum/resources/workflow_deployments/types/workflow_deployments_list_request_status.py +17 -0
- vellum/types/__init__.py +180 -4
- vellum/types/array_chat_message_content.py +33 -0
- vellum/types/array_chat_message_content_item.py +43 -0
- vellum/types/array_chat_message_content_item_request.py +45 -0
- vellum/types/array_chat_message_content_request.py +33 -0
- vellum/types/array_enum.py +5 -0
- vellum/types/array_variable_value.py +35 -0
- vellum/types/chat_history_enum.py +5 -0
- vellum/types/chat_history_input_request.py +4 -0
- vellum/types/chat_history_variable_value.py +29 -0
- vellum/types/chat_message.py +3 -1
- vellum/types/chat_message_content.py +53 -0
- vellum/types/chat_message_content_request.py +56 -0
- vellum/types/chat_message_request.py +3 -1
- vellum/types/deployment_read.py +5 -11
- vellum/types/document_index_read.py +2 -2
- vellum/types/{document_index_status.py → entity_status.py} +3 -3
- vellum/types/error_enum.py +5 -0
- vellum/types/execute_workflow_error_response.py +28 -0
- vellum/types/execute_workflow_response.py +32 -0
- vellum/types/execute_workflow_workflow_result_event.py +33 -0
- vellum/types/fulfilled_execute_workflow_workflow_result_event.py +35 -0
- vellum/types/function_call_chat_message_content.py +33 -0
- vellum/types/function_call_chat_message_content_request.py +33 -0
- vellum/types/function_call_chat_message_content_value.py +34 -0
- vellum/types/function_call_chat_message_content_value_request.py +34 -0
- vellum/types/function_call_enum.py +5 -0
- vellum/types/image_chat_message_content.py +33 -0
- vellum/types/image_chat_message_content_request.py +33 -0
- vellum/types/image_enum.py +5 -0
- vellum/types/json_enum.py +5 -0
- vellum/types/json_input_request.py +4 -0
- vellum/types/model_version_exec_config_parameters.py +1 -0
- vellum/types/number_enum.py +5 -0
- vellum/types/number_variable_value.py +28 -0
- vellum/types/paginated_slim_deployment_read_list.py +32 -0
- vellum/types/paginated_slim_workflow_deployment_list.py +32 -0
- vellum/types/register_prompt_model_parameters_request.py +1 -0
- vellum/types/rejected_execute_workflow_workflow_result_event.py +35 -0
- vellum/types/scenario_input_type_enum.py +2 -2
- vellum/types/search_results_enum.py +5 -0
- vellum/types/search_results_variable_value.py +29 -0
- vellum/types/slim_deployment_read.py +48 -0
- vellum/types/slim_workflow_deployment.py +57 -0
- vellum/types/string_chat_message_content.py +32 -0
- vellum/types/string_chat_message_content_request.py +32 -0
- vellum/types/string_enum.py +5 -0
- vellum/types/string_input_request.py +4 -0
- vellum/types/variable_value.py +102 -0
- vellum/types/vellum_image.py +29 -0
- vellum/types/vellum_image_request.py +29 -0
- vellum/types/vellum_variable_type.py +5 -0
- vellum/types/workflow_output.py +111 -0
- vellum/types/workflow_output_array.py +35 -0
- vellum/types/workflow_output_chat_history.py +35 -0
- vellum/types/workflow_output_error.py +35 -0
- vellum/types/workflow_output_function_call.py +35 -0
- vellum/types/workflow_output_image.py +35 -0
- vellum/types/workflow_output_json.py +34 -0
- vellum/types/workflow_output_number.py +34 -0
- vellum/types/workflow_output_search_results.py +35 -0
- vellum/types/workflow_output_string.py +34 -0
- vellum/types/workflow_result_event.py +2 -0
- {vellum_ai-0.1.13.dist-info → vellum_ai-0.2.1.dist-info}/METADATA +1 -1
- {vellum_ai-0.1.13.dist-info → vellum_ai-0.2.1.dist-info}/RECORD +85 -31
- vellum/types/deployment_status.py +0 -31
- {vellum_ai-0.1.13.dist-info → vellum_ai-0.2.1.dist-info}/LICENSE +0 -0
- {vellum_ai-0.1.13.dist-info → vellum_ai-0.2.1.dist-info}/WHEEL +0 -0
@@ -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 .workflow_event_error import WorkflowEventError
|
8
|
+
|
9
|
+
try:
|
10
|
+
import pydantic.v1 as pydantic # type: ignore
|
11
|
+
except ImportError:
|
12
|
+
import pydantic # type: ignore
|
13
|
+
|
14
|
+
|
15
|
+
class RejectedExecuteWorkflowWorkflowResultEvent(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
The unsuccessful response from the Workflow execution containing an error specifying what went wrong.
|
18
|
+
"""
|
19
|
+
|
20
|
+
id: str
|
21
|
+
ts: dt.datetime
|
22
|
+
error: WorkflowEventError
|
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}
|
@@ -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 .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 SearchResultsVariableValue(pydantic.BaseModel):
|
16
|
+
value: typing.Optional[typing.List[SearchResult]]
|
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,48 @@
|
|
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 SlimDeploymentRead(pydantic.BaseModel):
|
18
|
+
id: str
|
19
|
+
created: dt.datetime
|
20
|
+
label: str = pydantic.Field(description="A human-readable label for the deployment")
|
21
|
+
name: str = pydantic.Field(description="A name that uniquely identifies this deployment within its workspace")
|
22
|
+
status: typing.Optional[EntityStatus] = pydantic.Field(
|
23
|
+
description=("The current status of the deployment\n" "\n" "- `ACTIVE` - Active\n" "- `ARCHIVED` - Archived\n")
|
24
|
+
)
|
25
|
+
environment: typing.Optional[EnvironmentEnum] = pydantic.Field(
|
26
|
+
description=(
|
27
|
+
"The environment this deployment is used in\n"
|
28
|
+
"\n"
|
29
|
+
"- `DEVELOPMENT` - Development\n"
|
30
|
+
"- `STAGING` - Staging\n"
|
31
|
+
"- `PRODUCTION` - Production\n"
|
32
|
+
)
|
33
|
+
)
|
34
|
+
last_deployed_on: dt.datetime
|
35
|
+
input_variables: typing.List[VellumVariable]
|
36
|
+
|
37
|
+
def json(self, **kwargs: typing.Any) -> str:
|
38
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
39
|
+
return super().json(**kwargs_with_defaults)
|
40
|
+
|
41
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
42
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
43
|
+
return super().dict(**kwargs_with_defaults)
|
44
|
+
|
45
|
+
class Config:
|
46
|
+
frozen = True
|
47
|
+
smart_union = True
|
48
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -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 SlimWorkflowDeployment(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 will produce when it is 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}
|
@@ -0,0 +1,32 @@
|
|
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 StringChatMessageContent(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
A string value that is used in a chat message.
|
17
|
+
"""
|
18
|
+
|
19
|
+
value: str
|
20
|
+
|
21
|
+
def json(self, **kwargs: typing.Any) -> str:
|
22
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
+
return super().json(**kwargs_with_defaults)
|
24
|
+
|
25
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
26
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
27
|
+
return super().dict(**kwargs_with_defaults)
|
28
|
+
|
29
|
+
class Config:
|
30
|
+
frozen = True
|
31
|
+
smart_union = True
|
32
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,32 @@
|
|
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 StringChatMessageContentRequest(pydantic.BaseModel):
|
15
|
+
"""
|
16
|
+
A string value that is used in a chat message.
|
17
|
+
"""
|
18
|
+
|
19
|
+
value: str
|
20
|
+
|
21
|
+
def json(self, **kwargs: typing.Any) -> str:
|
22
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
+
return super().json(**kwargs_with_defaults)
|
24
|
+
|
25
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
26
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
27
|
+
return super().dict(**kwargs_with_defaults)
|
28
|
+
|
29
|
+
class Config:
|
30
|
+
frozen = True
|
31
|
+
smart_union = True
|
32
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,102 @@
|
|
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 .array_variable_value import ArrayVariableValue
|
10
|
+
from .chat_history_variable_value import ChatHistoryVariableValue
|
11
|
+
from .error_variable_value import ErrorVariableValue
|
12
|
+
from .function_call_variable_value import FunctionCallVariableValue
|
13
|
+
from .json_variable_value import JsonVariableValue
|
14
|
+
from .number_variable_value import NumberVariableValue
|
15
|
+
from .search_results_variable_value import SearchResultsVariableValue
|
16
|
+
from .string_variable_value import StringVariableValue
|
17
|
+
|
18
|
+
|
19
|
+
class VariableValue_String(StringVariableValue):
|
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 VariableValue_Number(NumberVariableValue):
|
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 VariableValue_Json(JsonVariableValue):
|
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 VariableValue_ChatHistory(ChatHistoryVariableValue):
|
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 VariableValue_SearchResults(SearchResultsVariableValue):
|
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 VariableValue_Error(ErrorVariableValue):
|
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 VariableValue_Array(ArrayVariableValue):
|
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 VariableValue_FunctionCall(FunctionCallVariableValue):
|
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
|
+
VariableValue = typing.Union[
|
92
|
+
VariableValue_String,
|
93
|
+
VariableValue_Number,
|
94
|
+
VariableValue_Json,
|
95
|
+
VariableValue_ChatHistory,
|
96
|
+
VariableValue_SearchResults,
|
97
|
+
VariableValue_Error,
|
98
|
+
VariableValue_Array,
|
99
|
+
VariableValue_FunctionCall,
|
100
|
+
]
|
101
|
+
|
102
|
+
VariableValue_Array.update_forward_refs()
|
@@ -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
|
+
|
8
|
+
try:
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
10
|
+
except ImportError:
|
11
|
+
import pydantic # type: ignore
|
12
|
+
|
13
|
+
|
14
|
+
class VellumImage(pydantic.BaseModel):
|
15
|
+
src: str
|
16
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]]
|
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,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
|
+
|
8
|
+
try:
|
9
|
+
import pydantic.v1 as pydantic # type: ignore
|
10
|
+
except ImportError:
|
11
|
+
import pydantic # type: ignore
|
12
|
+
|
13
|
+
|
14
|
+
class VellumImageRequest(pydantic.BaseModel):
|
15
|
+
src: str
|
16
|
+
metadata: typing.Optional[typing.Dict[str, typing.Any]]
|
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}
|
@@ -16,6 +16,7 @@ class VellumVariableType(str, enum.Enum):
|
|
16
16
|
- `ERROR` - ERROR
|
17
17
|
- `ARRAY` - ARRAY
|
18
18
|
- `FUNCTION_CALL` - FUNCTION_CALL
|
19
|
+
- `IMAGE` - IMAGE
|
19
20
|
"""
|
20
21
|
|
21
22
|
STRING = "STRING"
|
@@ -26,6 +27,7 @@ class VellumVariableType(str, enum.Enum):
|
|
26
27
|
ERROR = "ERROR"
|
27
28
|
ARRAY = "ARRAY"
|
28
29
|
FUNCTION_CALL = "FUNCTION_CALL"
|
30
|
+
IMAGE = "IMAGE"
|
29
31
|
|
30
32
|
def visit(
|
31
33
|
self,
|
@@ -37,6 +39,7 @@ class VellumVariableType(str, enum.Enum):
|
|
37
39
|
error: typing.Callable[[], T_Result],
|
38
40
|
array: typing.Callable[[], T_Result],
|
39
41
|
function_call: typing.Callable[[], T_Result],
|
42
|
+
image: typing.Callable[[], T_Result],
|
40
43
|
) -> T_Result:
|
41
44
|
if self is VellumVariableType.STRING:
|
42
45
|
return string()
|
@@ -54,3 +57,5 @@ class VellumVariableType(str, enum.Enum):
|
|
54
57
|
return array()
|
55
58
|
if self is VellumVariableType.FUNCTION_CALL:
|
56
59
|
return function_call()
|
60
|
+
if self is VellumVariableType.IMAGE:
|
61
|
+
return image()
|
@@ -0,0 +1,111 @@
|
|
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 .workflow_output_array import WorkflowOutputArray
|
10
|
+
from .workflow_output_chat_history import WorkflowOutputChatHistory
|
11
|
+
from .workflow_output_error import WorkflowOutputError
|
12
|
+
from .workflow_output_function_call import WorkflowOutputFunctionCall
|
13
|
+
from .workflow_output_image import WorkflowOutputImage
|
14
|
+
from .workflow_output_json import WorkflowOutputJson
|
15
|
+
from .workflow_output_number import WorkflowOutputNumber
|
16
|
+
from .workflow_output_search_results import WorkflowOutputSearchResults
|
17
|
+
from .workflow_output_string import WorkflowOutputString
|
18
|
+
|
19
|
+
|
20
|
+
class WorkflowOutput_String(WorkflowOutputString):
|
21
|
+
type: typing_extensions.Literal["STRING"]
|
22
|
+
|
23
|
+
class Config:
|
24
|
+
frozen = True
|
25
|
+
smart_union = True
|
26
|
+
allow_population_by_field_name = True
|
27
|
+
|
28
|
+
|
29
|
+
class WorkflowOutput_Number(WorkflowOutputNumber):
|
30
|
+
type: typing_extensions.Literal["NUMBER"]
|
31
|
+
|
32
|
+
class Config:
|
33
|
+
frozen = True
|
34
|
+
smart_union = True
|
35
|
+
allow_population_by_field_name = True
|
36
|
+
|
37
|
+
|
38
|
+
class WorkflowOutput_Json(WorkflowOutputJson):
|
39
|
+
type: typing_extensions.Literal["JSON"]
|
40
|
+
|
41
|
+
class Config:
|
42
|
+
frozen = True
|
43
|
+
smart_union = True
|
44
|
+
allow_population_by_field_name = True
|
45
|
+
|
46
|
+
|
47
|
+
class WorkflowOutput_ChatHistory(WorkflowOutputChatHistory):
|
48
|
+
type: typing_extensions.Literal["CHAT_HISTORY"]
|
49
|
+
|
50
|
+
class Config:
|
51
|
+
frozen = True
|
52
|
+
smart_union = True
|
53
|
+
allow_population_by_field_name = True
|
54
|
+
|
55
|
+
|
56
|
+
class WorkflowOutput_SearchResults(WorkflowOutputSearchResults):
|
57
|
+
type: typing_extensions.Literal["SEARCH_RESULTS"]
|
58
|
+
|
59
|
+
class Config:
|
60
|
+
frozen = True
|
61
|
+
smart_union = True
|
62
|
+
allow_population_by_field_name = True
|
63
|
+
|
64
|
+
|
65
|
+
class WorkflowOutput_Error(WorkflowOutputError):
|
66
|
+
type: typing_extensions.Literal["ERROR"]
|
67
|
+
|
68
|
+
class Config:
|
69
|
+
frozen = True
|
70
|
+
smart_union = True
|
71
|
+
allow_population_by_field_name = True
|
72
|
+
|
73
|
+
|
74
|
+
class WorkflowOutput_Array(WorkflowOutputArray):
|
75
|
+
type: typing_extensions.Literal["ARRAY"]
|
76
|
+
|
77
|
+
class Config:
|
78
|
+
frozen = True
|
79
|
+
smart_union = True
|
80
|
+
allow_population_by_field_name = True
|
81
|
+
|
82
|
+
|
83
|
+
class WorkflowOutput_FunctionCall(WorkflowOutputFunctionCall):
|
84
|
+
type: typing_extensions.Literal["FUNCTION_CALL"]
|
85
|
+
|
86
|
+
class Config:
|
87
|
+
frozen = True
|
88
|
+
smart_union = True
|
89
|
+
allow_population_by_field_name = True
|
90
|
+
|
91
|
+
|
92
|
+
class WorkflowOutput_Image(WorkflowOutputImage):
|
93
|
+
type: typing_extensions.Literal["IMAGE"]
|
94
|
+
|
95
|
+
class Config:
|
96
|
+
frozen = True
|
97
|
+
smart_union = True
|
98
|
+
allow_population_by_field_name = True
|
99
|
+
|
100
|
+
|
101
|
+
WorkflowOutput = typing.Union[
|
102
|
+
WorkflowOutput_String,
|
103
|
+
WorkflowOutput_Number,
|
104
|
+
WorkflowOutput_Json,
|
105
|
+
WorkflowOutput_ChatHistory,
|
106
|
+
WorkflowOutput_SearchResults,
|
107
|
+
WorkflowOutput_Error,
|
108
|
+
WorkflowOutput_Array,
|
109
|
+
WorkflowOutput_FunctionCall,
|
110
|
+
WorkflowOutput_Image,
|
111
|
+
]
|
@@ -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 .variable_value import VariableValue
|
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 of outputs 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[VariableValue]
|
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}
|
@@ -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 .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 WorkflowOutputChatHistory(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
A chat history 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[ChatMessage]
|
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}
|
@@ -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 .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 WorkflowOutputError(pydantic.BaseModel):
|
16
|
+
"""
|
17
|
+
An error 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: VellumError
|
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}
|