vellum-ai 0.0.41__py3-none-any.whl → 0.0.43__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. vellum/__init__.py +22 -2
  2. vellum/client.py +9 -5
  3. vellum/core/client_wrapper.py +1 -1
  4. vellum/core/jsonable_encoder.py +8 -6
  5. vellum/resources/deployments/client.py +5 -2
  6. vellum/resources/document_indexes/client.py +47 -2
  7. vellum/resources/documents/client.py +5 -2
  8. vellum/resources/model_versions/client.py +5 -2
  9. vellum/resources/registered_prompts/client.py +5 -2
  10. vellum/resources/sandboxes/client.py +5 -2
  11. vellum/resources/test_suites/client.py +5 -2
  12. vellum/types/__init__.py +22 -2
  13. vellum/types/api_node_result.py +29 -0
  14. vellum/types/api_node_result_data.py +34 -0
  15. vellum/types/chat_message.py +5 -2
  16. vellum/types/chat_message_request.py +5 -2
  17. vellum/types/conditional_node_result.py +5 -2
  18. vellum/types/conditional_node_result_data.py +5 -2
  19. vellum/types/deployment_read.py +5 -2
  20. vellum/types/document_document_to_document_index.py +5 -2
  21. vellum/types/document_index_read.py +5 -2
  22. vellum/types/document_read.py +5 -2
  23. vellum/types/enriched_normalized_completion.py +7 -4
  24. vellum/types/evaluation_params.py +5 -2
  25. vellum/types/evaluation_params_request.py +5 -2
  26. vellum/types/execute_workflow_stream_error_response.py +5 -2
  27. vellum/types/generate_error_response.py +5 -2
  28. vellum/types/generate_options_request.py +5 -2
  29. vellum/types/generate_request.py +5 -2
  30. vellum/types/generate_result.py +5 -2
  31. vellum/types/generate_result_data.py +5 -2
  32. vellum/types/generate_result_error.py +5 -2
  33. vellum/types/generate_stream_response.py +5 -2
  34. vellum/types/generate_stream_result.py +5 -2
  35. vellum/types/generate_stream_result_data.py +5 -2
  36. vellum/types/metadata_filter_config_request.py +5 -2
  37. vellum/types/metadata_filter_rule_request.py +5 -2
  38. vellum/types/model_version_build_config.py +5 -2
  39. vellum/types/model_version_compile_prompt_response.py +5 -2
  40. vellum/types/model_version_compiled_prompt.py +5 -2
  41. vellum/types/model_version_exec_config.py +5 -2
  42. vellum/types/model_version_exec_config_parameters.py +7 -4
  43. vellum/types/model_version_read.py +5 -2
  44. vellum/types/model_version_sandbox_snapshot.py +5 -2
  45. vellum/types/node_input_compiled_chat_history_value.py +5 -2
  46. vellum/types/node_input_compiled_json_value.py +5 -2
  47. vellum/types/node_input_compiled_number_value.py +30 -0
  48. vellum/types/node_input_compiled_search_results_value.py +5 -2
  49. vellum/types/node_input_compiled_string_value.py +5 -2
  50. vellum/types/node_input_variable_compiled_value.py +11 -0
  51. vellum/types/normalized_log_probs.py +5 -2
  52. vellum/types/normalized_token_log_probs.py +5 -2
  53. vellum/types/paginated_slim_document_list.py +5 -2
  54. vellum/types/prompt_node_result.py +5 -2
  55. vellum/types/prompt_node_result_data.py +5 -2
  56. vellum/types/prompt_template_block.py +5 -2
  57. vellum/types/prompt_template_block_data.py +5 -2
  58. vellum/types/prompt_template_block_data_request.py +5 -2
  59. vellum/types/prompt_template_block_properties.py +7 -4
  60. vellum/types/prompt_template_block_properties_request.py +7 -4
  61. vellum/types/prompt_template_block_request.py +5 -2
  62. vellum/types/register_prompt_error_response.py +5 -2
  63. vellum/types/register_prompt_model_parameters_request.py +5 -2
  64. vellum/types/register_prompt_prompt.py +5 -2
  65. vellum/types/register_prompt_prompt_info_request.py +5 -2
  66. vellum/types/register_prompt_response.py +5 -2
  67. vellum/types/registered_prompt_deployment.py +5 -2
  68. vellum/types/registered_prompt_input_variable_request.py +5 -2
  69. vellum/types/registered_prompt_model_version.py +5 -2
  70. vellum/types/registered_prompt_sandbox.py +5 -2
  71. vellum/types/registered_prompt_sandbox_snapshot.py +5 -2
  72. vellum/types/sandbox_metric_input_params.py +5 -2
  73. vellum/types/sandbox_metric_input_params_request.py +5 -2
  74. vellum/types/sandbox_scenario.py +5 -2
  75. vellum/types/scenario_input.py +5 -2
  76. vellum/types/scenario_input_request.py +5 -2
  77. vellum/types/search_error_response.py +5 -2
  78. vellum/types/search_filters_request.py +5 -2
  79. vellum/types/search_node_result.py +5 -2
  80. vellum/types/search_node_result_data.py +5 -2
  81. vellum/types/search_request_options_request.py +5 -2
  82. vellum/types/search_response.py +5 -2
  83. vellum/types/search_result.py +5 -2
  84. vellum/types/search_result_document.py +5 -2
  85. vellum/types/search_result_merging_request.py +6 -3
  86. vellum/types/search_weights_request.py +9 -4
  87. vellum/types/slim_document.py +5 -2
  88. vellum/types/submit_completion_actual_request.py +5 -2
  89. vellum/types/submit_completion_actuals_error_response.py +5 -2
  90. vellum/types/templating_node_chat_history_result.py +5 -2
  91. vellum/types/templating_node_json_result.py +5 -2
  92. vellum/types/templating_node_number_result.py +29 -0
  93. vellum/types/templating_node_result.py +5 -2
  94. vellum/types/templating_node_result_data.py +5 -2
  95. vellum/types/templating_node_result_output.py +11 -0
  96. vellum/types/templating_node_search_results_result.py +5 -2
  97. vellum/types/templating_node_string_result.py +5 -2
  98. vellum/types/terminal_node_chat_history_result.py +5 -2
  99. vellum/types/terminal_node_json_result.py +5 -2
  100. vellum/types/terminal_node_number_result.py +30 -0
  101. vellum/types/terminal_node_result.py +5 -2
  102. vellum/types/terminal_node_result_data.py +5 -2
  103. vellum/types/terminal_node_result_output.py +11 -0
  104. vellum/types/terminal_node_search_results_result.py +5 -2
  105. vellum/types/terminal_node_string_result.py +5 -2
  106. vellum/types/test_suite_test_case.py +5 -2
  107. vellum/types/upload_document_error_response.py +5 -2
  108. vellum/types/upload_document_response.py +5 -2
  109. vellum/types/vellum_variable.py +5 -2
  110. vellum/types/vellum_variable_type.py +8 -3
  111. vellum/types/workflow_event_error.py +5 -2
  112. vellum/types/workflow_execution_actual_chat_history_request.py +5 -2
  113. vellum/types/workflow_execution_actual_json_request.py +5 -2
  114. vellum/types/workflow_execution_actual_string_request.py +5 -2
  115. vellum/types/workflow_execution_node_result_event.py +5 -2
  116. vellum/types/workflow_execution_workflow_result_event.py +5 -2
  117. vellum/types/workflow_node_result_data.py +11 -0
  118. vellum/types/workflow_node_result_event.py +5 -2
  119. vellum/types/workflow_request_chat_history_input_request.py +5 -2
  120. vellum/types/workflow_request_json_input_request.py +5 -2
  121. vellum/types/workflow_request_string_input_request.py +5 -2
  122. vellum/types/workflow_result_event.py +5 -2
  123. vellum/types/workflow_result_event_output_data.py +11 -0
  124. vellum/types/workflow_result_event_output_data_chat_history.py +5 -2
  125. vellum/types/workflow_result_event_output_data_json.py +5 -2
  126. vellum/types/workflow_result_event_output_data_number.py +36 -0
  127. vellum/types/workflow_result_event_output_data_search_results.py +5 -2
  128. vellum/types/workflow_result_event_output_data_string.py +5 -2
  129. {vellum_ai-0.0.41.dist-info → vellum_ai-0.0.43.dist-info}/METADATA +2 -2
  130. vellum_ai-0.0.43.dist-info/RECORD +175 -0
  131. vellum/types/content_type.py +0 -22
  132. vellum_ai-0.0.41.dist-info/RECORD +0 -170
  133. {vellum_ai-0.0.41.dist-info → vellum_ai-0.0.43.dist-info}/WHEEL +0 -0
@@ -3,13 +3,16 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class SearchResultMergingRequest(pydantic.BaseModel):
12
- enabled: bool = pydantic.Field(description="Whether to enable merging results")
15
+ enabled: typing.Optional[bool] = pydantic.Field(description="Whether to enable merging results")
13
16
 
14
17
  def json(self, **kwargs: typing.Any) -> str:
15
18
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -3,14 +3,19 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class SearchWeightsRequest(pydantic.BaseModel):
12
- semantic_similarity: float = pydantic.Field(description="The relative weight to give to semantic similarity")
13
- keywords: float = pydantic.Field(description="The relative weight to give to keyword matches")
15
+ semantic_similarity: typing.Optional[float] = pydantic.Field(
16
+ description="The relative weight to give to semantic similarity"
17
+ )
18
+ keywords: typing.Optional[float] = pydantic.Field(description="The relative weight to give to keywords")
14
19
 
15
20
  def json(self, **kwargs: typing.Any) -> str:
16
21
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -3,14 +3,17 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .document_document_to_document_index import DocumentDocumentToDocumentIndex
10
8
  from .document_status import DocumentStatus
11
9
  from .processing_failure_reason_enum import ProcessingFailureReasonEnum
12
10
  from .processing_state_enum import ProcessingStateEnum
13
11
 
12
+ try:
13
+ import pydantic.v1 as pydantic # type: ignore
14
+ except ImportError:
15
+ import pydantic # type: ignore
16
+
14
17
 
15
18
  class SlimDocument(pydantic.BaseModel):
16
19
  id: str = pydantic.Field(description="Vellum-generated ID that uniquely identifies this document.")
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class SubmitCompletionActualRequest(pydantic.BaseModel):
12
15
  id: typing.Optional[str] = pydantic.Field(
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class SubmitCompletionActualsErrorResponse(pydantic.BaseModel):
12
15
  detail: str
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .chat_message import ChatMessage
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TemplatingNodeChatHistoryResult(pydantic.BaseModel):
13
16
  id: str
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class TemplatingNodeJsonResult(pydantic.BaseModel):
12
15
  id: str
@@ -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 TemplatingNodeNumberResult(pydantic.BaseModel):
15
+ id: str
16
+ value: typing.Optional[int]
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}
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .templating_node_result_data import TemplatingNodeResultData
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TemplatingNodeResult(pydantic.BaseModel):
13
16
  data: TemplatingNodeResultData
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .templating_node_result_output import TemplatingNodeResultOutput
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TemplatingNodeResultData(pydantic.BaseModel):
13
16
  output: TemplatingNodeResultOutput
@@ -8,6 +8,7 @@ import typing_extensions
8
8
 
9
9
  from .templating_node_chat_history_result import TemplatingNodeChatHistoryResult
10
10
  from .templating_node_json_result import TemplatingNodeJsonResult
11
+ from .templating_node_number_result import TemplatingNodeNumberResult
11
12
  from .templating_node_search_results_result import TemplatingNodeSearchResultsResult
12
13
  from .templating_node_string_result import TemplatingNodeStringResult
13
14
 
@@ -21,6 +22,15 @@ class TemplatingNodeResultOutput_String(TemplatingNodeStringResult):
21
22
  allow_population_by_field_name = True
22
23
 
23
24
 
25
+ class TemplatingNodeResultOutput_Number(TemplatingNodeNumberResult):
26
+ type: typing_extensions.Literal["NUMBER"]
27
+
28
+ class Config:
29
+ frozen = True
30
+ smart_union = True
31
+ allow_population_by_field_name = True
32
+
33
+
24
34
  class TemplatingNodeResultOutput_Json(TemplatingNodeJsonResult):
25
35
  type: typing_extensions.Literal["JSON"]
26
36
 
@@ -50,6 +60,7 @@ class TemplatingNodeResultOutput_SearchResults(TemplatingNodeSearchResultsResult
50
60
 
51
61
  TemplatingNodeResultOutput = typing.Union[
52
62
  TemplatingNodeResultOutput_String,
63
+ TemplatingNodeResultOutput_Number,
53
64
  TemplatingNodeResultOutput_Json,
54
65
  TemplatingNodeResultOutput_ChatHistory,
55
66
  TemplatingNodeResultOutput_SearchResults,
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .search_result import SearchResult
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TemplatingNodeSearchResultsResult(pydantic.BaseModel):
13
16
  id: str
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class TemplatingNodeStringResult(pydantic.BaseModel):
12
15
  id: str
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .chat_message import ChatMessage
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TerminalNodeChatHistoryResult(pydantic.BaseModel):
13
16
  id: typing.Optional[str]
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class TerminalNodeJsonResult(pydantic.BaseModel):
12
15
  id: typing.Optional[str]
@@ -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 TerminalNodeNumberResult(pydantic.BaseModel):
15
+ id: typing.Optional[str]
16
+ name: str = pydantic.Field(description="The unique name given to the terminal node that produced this output.")
17
+ value: typing.Optional[int]
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}
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .terminal_node_result_data import TerminalNodeResultData
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TerminalNodeResult(pydantic.BaseModel):
13
16
  data: TerminalNodeResultData
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .terminal_node_result_output import TerminalNodeResultOutput
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TerminalNodeResultData(pydantic.BaseModel):
13
16
  output: TerminalNodeResultOutput
@@ -8,6 +8,7 @@ import typing_extensions
8
8
 
9
9
  from .terminal_node_chat_history_result import TerminalNodeChatHistoryResult
10
10
  from .terminal_node_json_result import TerminalNodeJsonResult
11
+ from .terminal_node_number_result import TerminalNodeNumberResult
11
12
  from .terminal_node_search_results_result import TerminalNodeSearchResultsResult
12
13
  from .terminal_node_string_result import TerminalNodeStringResult
13
14
 
@@ -21,6 +22,15 @@ class TerminalNodeResultOutput_String(TerminalNodeStringResult):
21
22
  allow_population_by_field_name = True
22
23
 
23
24
 
25
+ class TerminalNodeResultOutput_Number(TerminalNodeNumberResult):
26
+ type: typing_extensions.Literal["NUMBER"]
27
+
28
+ class Config:
29
+ frozen = True
30
+ smart_union = True
31
+ allow_population_by_field_name = True
32
+
33
+
24
34
  class TerminalNodeResultOutput_Json(TerminalNodeJsonResult):
25
35
  type: typing_extensions.Literal["JSON"]
26
36
 
@@ -50,6 +60,7 @@ class TerminalNodeResultOutput_SearchResults(TerminalNodeSearchResultsResult):
50
60
 
51
61
  TerminalNodeResultOutput = typing.Union[
52
62
  TerminalNodeResultOutput_String,
63
+ TerminalNodeResultOutput_Number,
53
64
  TerminalNodeResultOutput_Json,
54
65
  TerminalNodeResultOutput_ChatHistory,
55
66
  TerminalNodeResultOutput_SearchResults,
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .search_result import SearchResult
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TerminalNodeSearchResultsResult(pydantic.BaseModel):
13
16
  id: typing.Optional[str]
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class TerminalNodeStringResult(pydantic.BaseModel):
12
15
  id: typing.Optional[str]
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .evaluation_params import EvaluationParams
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class TestSuiteTestCase(pydantic.BaseModel):
13
16
  test_case_id: typing.Optional[str] = pydantic.Field(
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class UploadDocumentErrorResponse(pydantic.BaseModel):
12
15
  detail: str
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class UploadDocumentResponse(pydantic.BaseModel):
12
15
  document_id: str = pydantic.Field(description="The ID of the newly created document.")
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .vellum_variable_type import VellumVariableType
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class VellumVariable(pydantic.BaseModel):
13
16
  id: str
@@ -8,13 +8,15 @@ T_Result = typing.TypeVar("T_Result")
8
8
 
9
9
  class VellumVariableType(str, enum.Enum):
10
10
  """
11
- * `STRING` - String
11
+ * `STRING` - STRING
12
+ * `NUMBER` - NUMBER
12
13
  * `JSON` - JSON
13
- * `CHAT_HISTORY` - Chat History
14
- * `SEARCH_RESULTS` - Search Results
14
+ * `CHAT_HISTORY` - CHAT_HISTORY
15
+ * `SEARCH_RESULTS` - SEARCH_RESULTS
15
16
  """
16
17
 
17
18
  STRING = "STRING"
19
+ NUMBER = "NUMBER"
18
20
  JSON = "JSON"
19
21
  CHAT_HISTORY = "CHAT_HISTORY"
20
22
  SEARCH_RESULTS = "SEARCH_RESULTS"
@@ -22,12 +24,15 @@ class VellumVariableType(str, enum.Enum):
22
24
  def visit(
23
25
  self,
24
26
  string: typing.Callable[[], T_Result],
27
+ number: typing.Callable[[], T_Result],
25
28
  json: typing.Callable[[], T_Result],
26
29
  chat_history: typing.Callable[[], T_Result],
27
30
  search_results: typing.Callable[[], T_Result],
28
31
  ) -> T_Result:
29
32
  if self is VellumVariableType.STRING:
30
33
  return string()
34
+ if self is VellumVariableType.NUMBER:
35
+ return number()
31
36
  if self is VellumVariableType.JSON:
32
37
  return json()
33
38
  if self is VellumVariableType.CHAT_HISTORY:
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .workflow_execution_event_error_code import WorkflowExecutionEventErrorCode
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class WorkflowEventError(pydantic.BaseModel):
13
16
  message: str
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .chat_message_request import ChatMessageRequest
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class WorkflowExecutionActualChatHistoryRequest(pydantic.BaseModel):
13
16
  output_id: typing.Optional[str] = pydantic.Field(
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class WorkflowExecutionActualJsonRequest(pydantic.BaseModel):
12
15
  output_id: typing.Optional[str] = pydantic.Field(
@@ -3,10 +3,13 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
 
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
10
13
 
11
14
  class WorkflowExecutionActualStringRequest(pydantic.BaseModel):
12
15
  output_id: typing.Optional[str] = pydantic.Field(
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .workflow_node_result_event import WorkflowNodeResultEvent
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class WorkflowExecutionNodeResultEvent(pydantic.BaseModel):
13
16
  execution_id: str
@@ -3,11 +3,14 @@
3
3
  import datetime as dt
4
4
  import typing
5
5
 
6
- import pydantic
7
-
8
6
  from ..core.datetime_utils import serialize_datetime
9
7
  from .workflow_result_event import WorkflowResultEvent
10
8
 
9
+ try:
10
+ import pydantic.v1 as pydantic # type: ignore
11
+ except ImportError:
12
+ import pydantic # type: ignore
13
+
11
14
 
12
15
  class WorkflowExecutionWorkflowResultEvent(pydantic.BaseModel):
13
16
  execution_id: str
@@ -6,6 +6,7 @@ import typing
6
6
 
7
7
  import typing_extensions
8
8
 
9
+ from .api_node_result import ApiNodeResult
9
10
  from .conditional_node_result import ConditionalNodeResult
10
11
  from .prompt_node_result import PromptNodeResult
11
12
  from .search_node_result import SearchNodeResult
@@ -49,6 +50,15 @@ class WorkflowNodeResultData_Conditional(ConditionalNodeResult):
49
50
  allow_population_by_field_name = True
50
51
 
51
52
 
53
+ class WorkflowNodeResultData_Api(ApiNodeResult):
54
+ type: typing_extensions.Literal["API"]
55
+
56
+ class Config:
57
+ frozen = True
58
+ smart_union = True
59
+ allow_population_by_field_name = True
60
+
61
+
52
62
  class WorkflowNodeResultData_Terminal(TerminalNodeResult):
53
63
  type: typing_extensions.Literal["TERMINAL"]
54
64
 
@@ -63,5 +73,6 @@ WorkflowNodeResultData = typing.Union[
63
73
  WorkflowNodeResultData_Search,
64
74
  WorkflowNodeResultData_Templating,
65
75
  WorkflowNodeResultData_Conditional,
76
+ WorkflowNodeResultData_Api,
66
77
  WorkflowNodeResultData_Terminal,
67
78
  ]