vellum-ai 0.0.42__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 (124) hide show
  1. vellum/client.py +5 -1
  2. vellum/core/client_wrapper.py +1 -1
  3. vellum/core/jsonable_encoder.py +8 -6
  4. vellum/resources/deployments/client.py +5 -2
  5. vellum/resources/document_indexes/client.py +5 -2
  6. vellum/resources/documents/client.py +5 -2
  7. vellum/resources/model_versions/client.py +5 -2
  8. vellum/resources/registered_prompts/client.py +5 -2
  9. vellum/resources/sandboxes/client.py +5 -2
  10. vellum/resources/test_suites/client.py +5 -2
  11. vellum/types/api_node_result.py +5 -2
  12. vellum/types/api_node_result_data.py +5 -2
  13. vellum/types/chat_message.py +5 -2
  14. vellum/types/chat_message_request.py +5 -2
  15. vellum/types/conditional_node_result.py +5 -2
  16. vellum/types/conditional_node_result_data.py +5 -2
  17. vellum/types/deployment_read.py +5 -2
  18. vellum/types/document_document_to_document_index.py +5 -2
  19. vellum/types/document_index_read.py +5 -2
  20. vellum/types/document_read.py +5 -2
  21. vellum/types/enriched_normalized_completion.py +5 -2
  22. vellum/types/evaluation_params.py +5 -2
  23. vellum/types/evaluation_params_request.py +5 -2
  24. vellum/types/execute_workflow_stream_error_response.py +5 -2
  25. vellum/types/generate_error_response.py +5 -2
  26. vellum/types/generate_options_request.py +5 -2
  27. vellum/types/generate_request.py +5 -2
  28. vellum/types/generate_result.py +5 -2
  29. vellum/types/generate_result_data.py +5 -2
  30. vellum/types/generate_result_error.py +5 -2
  31. vellum/types/generate_stream_response.py +5 -2
  32. vellum/types/generate_stream_result.py +5 -2
  33. vellum/types/generate_stream_result_data.py +5 -2
  34. vellum/types/metadata_filter_config_request.py +5 -2
  35. vellum/types/metadata_filter_rule_request.py +5 -2
  36. vellum/types/model_version_build_config.py +5 -2
  37. vellum/types/model_version_compile_prompt_response.py +5 -2
  38. vellum/types/model_version_compiled_prompt.py +5 -2
  39. vellum/types/model_version_exec_config.py +5 -2
  40. vellum/types/model_version_exec_config_parameters.py +5 -2
  41. vellum/types/model_version_read.py +5 -2
  42. vellum/types/model_version_sandbox_snapshot.py +5 -2
  43. vellum/types/node_input_compiled_chat_history_value.py +5 -2
  44. vellum/types/node_input_compiled_json_value.py +5 -2
  45. vellum/types/node_input_compiled_number_value.py +5 -2
  46. vellum/types/node_input_compiled_search_results_value.py +5 -2
  47. vellum/types/node_input_compiled_string_value.py +5 -2
  48. vellum/types/normalized_log_probs.py +5 -2
  49. vellum/types/normalized_token_log_probs.py +5 -2
  50. vellum/types/paginated_slim_document_list.py +5 -2
  51. vellum/types/prompt_node_result.py +5 -2
  52. vellum/types/prompt_node_result_data.py +5 -2
  53. vellum/types/prompt_template_block.py +5 -2
  54. vellum/types/prompt_template_block_data.py +5 -2
  55. vellum/types/prompt_template_block_data_request.py +5 -2
  56. vellum/types/prompt_template_block_properties.py +5 -2
  57. vellum/types/prompt_template_block_properties_request.py +5 -2
  58. vellum/types/prompt_template_block_request.py +5 -2
  59. vellum/types/register_prompt_error_response.py +5 -2
  60. vellum/types/register_prompt_model_parameters_request.py +5 -2
  61. vellum/types/register_prompt_prompt.py +5 -2
  62. vellum/types/register_prompt_prompt_info_request.py +5 -2
  63. vellum/types/register_prompt_response.py +5 -2
  64. vellum/types/registered_prompt_deployment.py +5 -2
  65. vellum/types/registered_prompt_input_variable_request.py +5 -2
  66. vellum/types/registered_prompt_model_version.py +5 -2
  67. vellum/types/registered_prompt_sandbox.py +5 -2
  68. vellum/types/registered_prompt_sandbox_snapshot.py +5 -2
  69. vellum/types/sandbox_metric_input_params.py +5 -2
  70. vellum/types/sandbox_metric_input_params_request.py +5 -2
  71. vellum/types/sandbox_scenario.py +5 -2
  72. vellum/types/scenario_input.py +5 -2
  73. vellum/types/scenario_input_request.py +5 -2
  74. vellum/types/search_error_response.py +5 -2
  75. vellum/types/search_filters_request.py +5 -2
  76. vellum/types/search_node_result.py +5 -2
  77. vellum/types/search_node_result_data.py +5 -2
  78. vellum/types/search_request_options_request.py +5 -2
  79. vellum/types/search_response.py +5 -2
  80. vellum/types/search_result.py +5 -2
  81. vellum/types/search_result_document.py +5 -2
  82. vellum/types/search_result_merging_request.py +5 -2
  83. vellum/types/search_weights_request.py +5 -2
  84. vellum/types/slim_document.py +5 -2
  85. vellum/types/submit_completion_actual_request.py +5 -2
  86. vellum/types/submit_completion_actuals_error_response.py +5 -2
  87. vellum/types/templating_node_chat_history_result.py +5 -2
  88. vellum/types/templating_node_json_result.py +5 -2
  89. vellum/types/templating_node_number_result.py +5 -2
  90. vellum/types/templating_node_result.py +5 -2
  91. vellum/types/templating_node_result_data.py +5 -2
  92. vellum/types/templating_node_search_results_result.py +5 -2
  93. vellum/types/templating_node_string_result.py +5 -2
  94. vellum/types/terminal_node_chat_history_result.py +5 -2
  95. vellum/types/terminal_node_json_result.py +5 -2
  96. vellum/types/terminal_node_number_result.py +5 -2
  97. vellum/types/terminal_node_result.py +5 -2
  98. vellum/types/terminal_node_result_data.py +5 -2
  99. vellum/types/terminal_node_search_results_result.py +5 -2
  100. vellum/types/terminal_node_string_result.py +5 -2
  101. vellum/types/test_suite_test_case.py +5 -2
  102. vellum/types/upload_document_error_response.py +5 -2
  103. vellum/types/upload_document_response.py +5 -2
  104. vellum/types/vellum_variable.py +5 -2
  105. vellum/types/workflow_event_error.py +5 -2
  106. vellum/types/workflow_execution_actual_chat_history_request.py +5 -2
  107. vellum/types/workflow_execution_actual_json_request.py +5 -2
  108. vellum/types/workflow_execution_actual_string_request.py +5 -2
  109. vellum/types/workflow_execution_node_result_event.py +5 -2
  110. vellum/types/workflow_execution_workflow_result_event.py +5 -2
  111. vellum/types/workflow_node_result_event.py +5 -2
  112. vellum/types/workflow_request_chat_history_input_request.py +5 -2
  113. vellum/types/workflow_request_json_input_request.py +5 -2
  114. vellum/types/workflow_request_string_input_request.py +5 -2
  115. vellum/types/workflow_result_event.py +5 -2
  116. vellum/types/workflow_result_event_output_data_chat_history.py +5 -2
  117. vellum/types/workflow_result_event_output_data_json.py +5 -2
  118. vellum/types/workflow_result_event_output_data_number.py +5 -2
  119. vellum/types/workflow_result_event_output_data_search_results.py +5 -2
  120. vellum/types/workflow_result_event_output_data_string.py +5 -2
  121. {vellum_ai-0.0.42.dist-info → vellum_ai-0.0.43.dist-info}/METADATA +2 -2
  122. vellum_ai-0.0.43.dist-info/RECORD +175 -0
  123. vellum_ai-0.0.42.dist-info/RECORD +0 -175
  124. {vellum_ai-0.0.42.dist-info → vellum_ai-0.0.43.dist-info}/WHEEL +0 -0
vellum/client.py CHANGED
@@ -6,7 +6,6 @@ import urllib.parse
6
6
  from json.decoder import JSONDecodeError
7
7
 
8
8
  import httpx
9
- import pydantic
10
9
 
11
10
  from .core.api_error import ApiError
12
11
  from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
@@ -36,6 +35,11 @@ from .types.workflow_execution_event_type import WorkflowExecutionEventType
36
35
  from .types.workflow_request_input_request import WorkflowRequestInputRequest
37
36
  from .types.workflow_stream_event import WorkflowStreamEvent
38
37
 
38
+ try:
39
+ import pydantic.v1 as pydantic # type: ignore
40
+ except ImportError:
41
+ import pydantic # type: ignore
42
+
39
43
  # this is used as the default value for optional parameters
40
44
  OMIT = typing.cast(typing.Any, ...)
41
45
 
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "vellum-ai",
19
- "X-Fern-SDK-Version": "v0.0.42",
19
+ "X-Fern-SDK-Version": "v0.0.43",
20
20
  }
21
21
  headers["X_API_KEY"] = self.api_key
22
22
  return headers
@@ -16,8 +16,10 @@ from pathlib import PurePath
16
16
  from types import GeneratorType
17
17
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
18
18
 
19
- from pydantic import BaseModel
20
- from pydantic.json import ENCODERS_BY_TYPE
19
+ try:
20
+ import pydantic.v1 as pydantic # type: ignore
21
+ except ImportError:
22
+ import pydantic # type: ignore
21
23
 
22
24
  from .datetime_utils import serialize_datetime
23
25
 
@@ -34,7 +36,7 @@ def generate_encoders_by_class_tuples(
34
36
  return encoders_by_class_tuples
35
37
 
36
38
 
37
- encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
39
+ encoders_by_class_tuples = generate_encoders_by_class_tuples(pydantic.json.ENCODERS_BY_TYPE)
38
40
 
39
41
 
40
42
  def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any:
@@ -46,7 +48,7 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any]
46
48
  for encoder_type, encoder_instance in custom_encoder.items():
47
49
  if isinstance(obj, encoder_type):
48
50
  return encoder_instance(obj)
49
- if isinstance(obj, BaseModel):
51
+ if isinstance(obj, pydantic.BaseModel):
50
52
  encoder = getattr(obj.__config__, "json_encoders", {})
51
53
  if custom_encoder:
52
54
  encoder.update(custom_encoder)
@@ -82,8 +84,8 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any]
82
84
  encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder))
83
85
  return encoded_list
84
86
 
85
- if type(obj) in ENCODERS_BY_TYPE:
86
- return ENCODERS_BY_TYPE[type(obj)](obj)
87
+ if type(obj) in pydantic.json.ENCODERS_BY_TYPE:
88
+ return pydantic.json.ENCODERS_BY_TYPE[type(obj)](obj)
87
89
  for encoder, classes_tuple in encoders_by_class_tuples.items():
88
90
  if isinstance(obj, classes_tuple):
89
91
  return encoder(obj)
@@ -3,12 +3,15 @@
3
3
  import urllib.parse
4
4
  from json.decoder import JSONDecodeError
5
5
 
6
- import pydantic
7
-
8
6
  from ...core.api_error import ApiError
9
7
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
10
8
  from ...types.deployment_read import DeploymentRead
11
9
 
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
12
15
 
13
16
  class DeploymentsClient:
14
17
  def __init__(self, *, client_wrapper: SyncClientWrapper):
@@ -4,8 +4,6 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
@@ -13,6 +11,11 @@ from ...types.document_index_read import DocumentIndexRead
13
11
  from ...types.document_index_status import DocumentIndexStatus
14
12
  from ...types.environment_enum import EnvironmentEnum
15
13
 
14
+ try:
15
+ import pydantic.v1 as pydantic # type: ignore
16
+ except ImportError:
17
+ import pydantic # type: ignore
18
+
16
19
  # this is used as the default value for optional parameters
17
20
  OMIT = typing.cast(typing.Any, ...)
18
21
 
@@ -4,8 +4,6 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
@@ -18,6 +16,11 @@ from ...types.document_status import DocumentStatus
18
16
  from ...types.paginated_slim_document_list import PaginatedSlimDocumentList
19
17
  from ...types.upload_document_response import UploadDocumentResponse
20
18
 
19
+ try:
20
+ import pydantic.v1 as pydantic # type: ignore
21
+ except ImportError:
22
+ import pydantic # type: ignore
23
+
21
24
  # this is used as the default value for optional parameters
22
25
  OMIT = typing.cast(typing.Any, ...)
23
26
 
@@ -4,14 +4,17 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
12
10
  from ...types.model_version_compile_prompt_response import ModelVersionCompilePromptResponse
13
11
  from ...types.model_version_read import ModelVersionRead
14
12
 
13
+ try:
14
+ import pydantic.v1 as pydantic # type: ignore
15
+ except ImportError:
16
+ import pydantic # type: ignore
17
+
15
18
  # this is used as the default value for optional parameters
16
19
  OMIT = typing.cast(typing.Any, ...)
17
20
 
@@ -4,8 +4,6 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
@@ -16,6 +14,11 @@ from ...types.register_prompt_model_parameters_request import RegisterPromptMode
16
14
  from ...types.register_prompt_prompt_info_request import RegisterPromptPromptInfoRequest
17
15
  from ...types.register_prompt_response import RegisterPromptResponse
18
16
 
17
+ try:
18
+ import pydantic.v1 as pydantic # type: ignore
19
+ except ImportError:
20
+ import pydantic # type: ignore
21
+
19
22
  # this is used as the default value for optional parameters
20
23
  OMIT = typing.cast(typing.Any, ...)
21
24
 
@@ -4,8 +4,6 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
@@ -13,6 +11,11 @@ from ...types.sandbox_metric_input_params_request import SandboxMetricInputParam
13
11
  from ...types.sandbox_scenario import SandboxScenario
14
12
  from ...types.scenario_input_request import ScenarioInputRequest
15
13
 
14
+ try:
15
+ import pydantic.v1 as pydantic # type: ignore
16
+ except ImportError:
17
+ import pydantic # type: ignore
18
+
16
19
  # this is used as the default value for optional parameters
17
20
  OMIT = typing.cast(typing.Any, ...)
18
21
 
@@ -4,14 +4,17 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
- import pydantic
8
-
9
7
  from ...core.api_error import ApiError
10
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
11
9
  from ...core.jsonable_encoder import jsonable_encoder
12
10
  from ...types.evaluation_params_request import EvaluationParamsRequest
13
11
  from ...types.test_suite_test_case import TestSuiteTestCase
14
12
 
13
+ try:
14
+ import pydantic.v1 as pydantic # type: ignore
15
+ except ImportError:
16
+ import pydantic # type: ignore
17
+
15
18
  # this is used as the default value for optional parameters
16
19
  OMIT = typing.cast(typing.Any, ...)
17
20
 
@@ -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 .api_node_result_data import ApiNodeResultData
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 ApiNodeResult(pydantic.BaseModel):
13
16
  data: ApiNodeResultData
@@ -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 ApiNodeResultData(pydantic.BaseModel):
12
15
  text_output_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_role import ChatMessageRole
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 ChatMessage(pydantic.BaseModel):
13
16
  text: 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_role import ChatMessageRole
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 ChatMessageRequest(pydantic.BaseModel):
13
16
  text: 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 .conditional_node_result_data import ConditionalNodeResultData
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 ConditionalNodeResult(pydantic.BaseModel):
13
16
  data: ConditionalNodeResultData
@@ -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 ConditionalNodeResultData(pydantic.BaseModel):
12
15
  source_handle_id: typing.Optional[str]
@@ -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 .deployment_status import DeploymentStatus
10
8
  from .environment_enum import EnvironmentEnum
11
9
  from .model_type_deprecated import ModelTypeDeprecated
12
10
  from .vellum_variable import VellumVariable
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 DeploymentRead(pydantic.BaseModel):
16
19
  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 .indexing_state_enum import IndexingStateEnum
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 DocumentDocumentToDocumentIndex(pydantic.BaseModel):
13
16
  id: str = pydantic.Field(description="Vellum-generated ID that uniquely identifies this link.")
@@ -3,12 +3,15 @@
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_index_status import DocumentIndexStatus
10
8
  from .environment_enum import EnvironmentEnum
11
9
 
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
12
15
 
13
16
  class DocumentIndexRead(pydantic.BaseModel):
14
17
  id: str
@@ -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
  from .document_document_to_document_index import DocumentDocumentToDocumentIndex
10
8
  from .document_status import DocumentStatus
11
9
  from .processing_state_enum import ProcessingStateEnum
12
10
 
11
+ try:
12
+ import pydantic.v1 as pydantic # type: ignore
13
+ except ImportError:
14
+ import pydantic # type: ignore
15
+
13
16
 
14
17
  class DocumentRead(pydantic.BaseModel):
15
18
  id: str
@@ -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
  from .finish_reason_enum import FinishReasonEnum
10
8
  from .normalized_log_probs import NormalizedLogProbs
11
9
  from .vellum_variable_type import VellumVariableType
12
10
 
11
+ try:
12
+ import pydantic.v1 as pydantic # type: ignore
13
+ except ImportError:
14
+ import pydantic # type: ignore
15
+
13
16
 
14
17
  class EnrichedNormalizedCompletion(pydantic.BaseModel):
15
18
  id: str = pydantic.Field(description="The Vellum-generated ID of the completion.")
@@ -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 EvaluationParams(pydantic.BaseModel):
12
15
  target: 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 EvaluationParamsRequest(pydantic.BaseModel):
12
15
  target: 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 ExecuteWorkflowStreamErrorResponse(pydantic.BaseModel):
12
15
  detail: str = pydantic.Field(description="Details about why the request failed.")
@@ -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 GenerateErrorResponse(pydantic.BaseModel):
12
15
  detail: str = pydantic.Field(description="Details about why the request failed.")
@@ -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 .logprobs_enum import LogprobsEnum
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 GenerateOptionsRequest(pydantic.BaseModel):
13
16
  logprobs: typing.Optional[LogprobsEnum] = 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 .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 GenerateRequest(pydantic.BaseModel):
13
16
  input_values: typing.Dict[str, typing.Any] = pydantic.Field(
@@ -3,12 +3,15 @@
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 .generate_result_data import GenerateResultData
10
8
  from .generate_result_error import GenerateResultError
11
9
 
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
12
15
 
13
16
  class GenerateResult(pydantic.BaseModel):
14
17
  data: typing.Optional[GenerateResultData] = 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 .enriched_normalized_completion import EnrichedNormalizedCompletion
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 GenerateResultData(pydantic.BaseModel):
13
16
  completions: typing.List[EnrichedNormalizedCompletion] = 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 GenerateResultError(pydantic.BaseModel):
12
15
  message: str = pydantic.Field(description="The error message returned by the LLM provider.")
@@ -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 .generate_stream_result import GenerateStreamResult
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 GenerateStreamResponse(pydantic.BaseModel):
13
16
  delta: GenerateStreamResult
@@ -3,12 +3,15 @@
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 .generate_result_error import GenerateResultError
10
8
  from .generate_stream_result_data import GenerateStreamResultData
11
9
 
10
+ try:
11
+ import pydantic.v1 as pydantic # type: ignore
12
+ except ImportError:
13
+ import pydantic # type: ignore
14
+
12
15
 
13
16
  class GenerateStreamResult(pydantic.BaseModel):
14
17
  request_index: int
@@ -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 .enriched_normalized_completion import EnrichedNormalizedCompletion
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 GenerateStreamResultData(pydantic.BaseModel):
13
16
  completion_index: int
@@ -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
  from .logical_operator import LogicalOperator
10
8
  from .metadata_filter_rule_combinator import MetadataFilterRuleCombinator
11
9
  from .metadata_filter_rule_request import MetadataFilterRuleRequest
12
10
 
11
+ try:
12
+ import pydantic.v1 as pydantic # type: ignore
13
+ except ImportError:
14
+ import pydantic # type: ignore
15
+
13
16
 
14
17
  class MetadataFilterConfigRequest(pydantic.BaseModel):
15
18
  combinator: typing.Optional[MetadataFilterRuleCombinator]
@@ -5,12 +5,15 @@ from __future__ import annotations
5
5
  import datetime as dt
6
6
  import typing
7
7
 
8
- import pydantic
9
-
10
8
  from ..core.datetime_utils import serialize_datetime
11
9
  from .logical_operator import LogicalOperator
12
10
  from .metadata_filter_rule_combinator import MetadataFilterRuleCombinator
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 MetadataFilterRuleRequest(pydantic.BaseModel):
16
19
  combinator: typing.Optional[MetadataFilterRuleCombinator]