vellum-ai 0.0.42__py3-none-any.whl → 0.0.44__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +20 -2
- vellum/client.py +5 -1
- vellum/core/client_wrapper.py +1 -1
- vellum/core/jsonable_encoder.py +8 -6
- vellum/resources/deployments/client.py +5 -2
- vellum/resources/document_indexes/client.py +5 -2
- vellum/resources/documents/client.py +5 -2
- vellum/resources/model_versions/client.py +5 -2
- vellum/resources/registered_prompts/client.py +19 -4
- vellum/resources/sandboxes/client.py +5 -2
- vellum/resources/test_suites/client.py +5 -2
- vellum/types/__init__.py +20 -2
- vellum/types/api_node_result.py +5 -2
- vellum/types/api_node_result_data.py +5 -2
- vellum/types/chat_message.py +5 -2
- vellum/types/chat_message_request.py +5 -2
- vellum/types/conditional_node_result.py +5 -2
- vellum/types/conditional_node_result_data.py +5 -2
- vellum/types/deployment_read.py +5 -4
- vellum/types/document_document_to_document_index.py +5 -2
- vellum/types/document_index_read.py +5 -2
- vellum/types/document_read.py +5 -2
- vellum/types/enriched_normalized_completion.py +6 -2
- vellum/types/evaluation_params.py +5 -2
- vellum/types/evaluation_params_request.py +5 -2
- vellum/types/execute_workflow_stream_error_response.py +5 -2
- vellum/types/generate_error_response.py +5 -2
- vellum/types/generate_options_request.py +5 -2
- vellum/types/generate_request.py +5 -2
- vellum/types/generate_result.py +5 -2
- vellum/types/generate_result_data.py +5 -2
- vellum/types/generate_result_error.py +5 -2
- vellum/types/generate_stream_response.py +5 -2
- vellum/types/generate_stream_result.py +5 -2
- vellum/types/generate_stream_result_data.py +5 -2
- vellum/types/metadata_filter_config_request.py +5 -2
- vellum/types/metadata_filter_rule_request.py +5 -2
- vellum/types/model_version_build_config.py +6 -2
- vellum/types/model_version_compile_prompt_response.py +5 -2
- vellum/types/model_version_compiled_prompt.py +5 -2
- vellum/types/model_version_exec_config.py +5 -2
- vellum/types/model_version_exec_config_parameters.py +5 -2
- vellum/types/model_version_read.py +7 -5
- vellum/types/model_version_sandbox_snapshot.py +5 -2
- vellum/types/node_input_compiled_chat_history_value.py +5 -2
- vellum/types/node_input_compiled_error_value.py +31 -0
- vellum/types/node_input_compiled_json_value.py +5 -2
- vellum/types/node_input_compiled_number_value.py +5 -2
- vellum/types/node_input_compiled_search_results_value.py +5 -2
- vellum/types/node_input_compiled_string_value.py +5 -2
- vellum/types/node_input_variable_compiled_value.py +11 -0
- vellum/types/normalized_log_probs.py +5 -2
- vellum/types/normalized_token_log_probs.py +5 -2
- vellum/types/paginated_slim_document_list.py +5 -2
- vellum/types/prompt_node_result.py +5 -2
- vellum/types/prompt_node_result_data.py +5 -2
- vellum/types/prompt_template_block.py +5 -2
- vellum/types/prompt_template_block_data.py +5 -2
- vellum/types/prompt_template_block_data_request.py +5 -2
- vellum/types/prompt_template_block_properties.py +5 -2
- vellum/types/prompt_template_block_properties_request.py +5 -2
- vellum/types/prompt_template_block_request.py +5 -2
- vellum/types/provider_enum.py +10 -5
- vellum/types/register_prompt_error_response.py +5 -2
- vellum/types/register_prompt_model_parameters_request.py +5 -2
- vellum/types/register_prompt_prompt.py +5 -2
- vellum/types/register_prompt_prompt_info_request.py +5 -2
- vellum/types/register_prompt_response.py +5 -2
- vellum/types/registered_prompt_deployment.py +5 -2
- vellum/types/registered_prompt_input_variable_request.py +5 -2
- vellum/types/registered_prompt_model_version.py +5 -2
- vellum/types/registered_prompt_sandbox.py +5 -2
- vellum/types/registered_prompt_sandbox_snapshot.py +5 -2
- vellum/types/sandbox_metric_input_params.py +5 -2
- vellum/types/sandbox_metric_input_params_request.py +5 -2
- vellum/types/sandbox_scenario.py +5 -2
- vellum/types/scenario_input.py +5 -2
- vellum/types/scenario_input_request.py +5 -2
- vellum/types/search_error_response.py +5 -2
- vellum/types/search_filters_request.py +5 -2
- vellum/types/search_node_result.py +5 -2
- vellum/types/search_node_result_data.py +5 -2
- vellum/types/search_request_options_request.py +5 -2
- vellum/types/search_response.py +5 -2
- vellum/types/search_result.py +5 -2
- vellum/types/search_result_document.py +5 -2
- vellum/types/search_result_merging_request.py +5 -2
- vellum/types/search_weights_request.py +5 -2
- vellum/types/slim_document.py +5 -2
- vellum/types/submit_completion_actual_request.py +5 -2
- vellum/types/submit_completion_actuals_error_response.py +5 -2
- vellum/types/templating_node_chat_history_result.py +5 -2
- vellum/types/templating_node_error_result.py +30 -0
- vellum/types/templating_node_json_result.py +5 -2
- vellum/types/templating_node_number_result.py +5 -2
- vellum/types/templating_node_result.py +5 -2
- vellum/types/templating_node_result_data.py +5 -2
- vellum/types/templating_node_result_output.py +11 -0
- vellum/types/templating_node_search_results_result.py +5 -2
- vellum/types/templating_node_string_result.py +5 -2
- vellum/types/terminal_node_chat_history_result.py +5 -2
- vellum/types/terminal_node_error_result.py +31 -0
- vellum/types/terminal_node_json_result.py +5 -2
- vellum/types/terminal_node_number_result.py +5 -2
- vellum/types/terminal_node_result.py +5 -2
- vellum/types/terminal_node_result_data.py +5 -2
- vellum/types/terminal_node_result_output.py +11 -0
- vellum/types/terminal_node_search_results_result.py +5 -2
- vellum/types/terminal_node_string_result.py +5 -2
- vellum/types/test_suite_test_case.py +5 -2
- vellum/types/upload_document_error_response.py +5 -2
- vellum/types/upload_document_response.py +5 -2
- vellum/types/vellum_error.py +30 -0
- vellum/types/vellum_error_code_enum.py +31 -0
- vellum/types/vellum_variable.py +5 -2
- vellum/types/vellum_variable_type.py +5 -0
- vellum/types/workflow_event_error.py +5 -2
- vellum/types/workflow_execution_actual_chat_history_request.py +5 -2
- vellum/types/workflow_execution_actual_json_request.py +5 -2
- vellum/types/workflow_execution_actual_string_request.py +5 -2
- vellum/types/workflow_execution_node_result_event.py +5 -2
- vellum/types/workflow_execution_workflow_result_event.py +5 -2
- vellum/types/workflow_node_result_event.py +5 -2
- vellum/types/workflow_request_chat_history_input_request.py +5 -2
- vellum/types/workflow_request_json_input_request.py +5 -2
- vellum/types/workflow_request_string_input_request.py +5 -2
- vellum/types/workflow_result_event.py +5 -2
- vellum/types/workflow_result_event_output_data.py +11 -0
- vellum/types/workflow_result_event_output_data_chat_history.py +5 -2
- vellum/types/workflow_result_event_output_data_error.py +37 -0
- vellum/types/workflow_result_event_output_data_json.py +5 -2
- vellum/types/workflow_result_event_output_data_number.py +5 -2
- vellum/types/workflow_result_event_output_data_search_results.py +5 -2
- vellum/types/workflow_result_event_output_data_string.py +5 -2
- {vellum_ai-0.0.42.dist-info → vellum_ai-0.0.44.dist-info}/METADATA +2 -2
- vellum_ai-0.0.44.dist-info/RECORD +180 -0
- vellum/types/model_type_deprecated.py +0 -22
- vellum_ai-0.0.42.dist-info/RECORD +0 -175
- {vellum_ai-0.0.42.dist-info → vellum_ai-0.0.44.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -38,7 +38,6 @@ from .types import (
|
|
38
38
|
MetadataFilterConfigRequest,
|
39
39
|
MetadataFilterRuleCombinator,
|
40
40
|
MetadataFilterRuleRequest,
|
41
|
-
ModelTypeDeprecated,
|
42
41
|
ModelVersionBuildConfig,
|
43
42
|
ModelVersionCompilePromptResponse,
|
44
43
|
ModelVersionCompiledPrompt,
|
@@ -48,12 +47,14 @@ from .types import (
|
|
48
47
|
ModelVersionReadStatusEnum,
|
49
48
|
ModelVersionSandboxSnapshot,
|
50
49
|
NodeInputCompiledChatHistoryValue,
|
50
|
+
NodeInputCompiledErrorValue,
|
51
51
|
NodeInputCompiledJsonValue,
|
52
52
|
NodeInputCompiledNumberValue,
|
53
53
|
NodeInputCompiledSearchResultsValue,
|
54
54
|
NodeInputCompiledStringValue,
|
55
55
|
NodeInputVariableCompiledValue,
|
56
56
|
NodeInputVariableCompiledValue_ChatHistory,
|
57
|
+
NodeInputVariableCompiledValue_Error,
|
57
58
|
NodeInputVariableCompiledValue_Json,
|
58
59
|
NodeInputVariableCompiledValue_Number,
|
59
60
|
NodeInputVariableCompiledValue_SearchResults,
|
@@ -106,12 +107,14 @@ from .types import (
|
|
106
107
|
SubmitWorkflowExecutionActualRequest_Json,
|
107
108
|
SubmitWorkflowExecutionActualRequest_String,
|
108
109
|
TemplatingNodeChatHistoryResult,
|
110
|
+
TemplatingNodeErrorResult,
|
109
111
|
TemplatingNodeJsonResult,
|
110
112
|
TemplatingNodeNumberResult,
|
111
113
|
TemplatingNodeResult,
|
112
114
|
TemplatingNodeResultData,
|
113
115
|
TemplatingNodeResultOutput,
|
114
116
|
TemplatingNodeResultOutput_ChatHistory,
|
117
|
+
TemplatingNodeResultOutput_Error,
|
115
118
|
TemplatingNodeResultOutput_Json,
|
116
119
|
TemplatingNodeResultOutput_Number,
|
117
120
|
TemplatingNodeResultOutput_SearchResults,
|
@@ -119,12 +122,14 @@ from .types import (
|
|
119
122
|
TemplatingNodeSearchResultsResult,
|
120
123
|
TemplatingNodeStringResult,
|
121
124
|
TerminalNodeChatHistoryResult,
|
125
|
+
TerminalNodeErrorResult,
|
122
126
|
TerminalNodeJsonResult,
|
123
127
|
TerminalNodeNumberResult,
|
124
128
|
TerminalNodeResult,
|
125
129
|
TerminalNodeResultData,
|
126
130
|
TerminalNodeResultOutput,
|
127
131
|
TerminalNodeResultOutput_ChatHistory,
|
132
|
+
TerminalNodeResultOutput_Error,
|
128
133
|
TerminalNodeResultOutput_Json,
|
129
134
|
TerminalNodeResultOutput_Number,
|
130
135
|
TerminalNodeResultOutput_SearchResults,
|
@@ -134,6 +139,8 @@ from .types import (
|
|
134
139
|
TestSuiteTestCase,
|
135
140
|
UploadDocumentErrorResponse,
|
136
141
|
UploadDocumentResponse,
|
142
|
+
VellumError,
|
143
|
+
VellumErrorCodeEnum,
|
137
144
|
VellumVariable,
|
138
145
|
VellumVariableType,
|
139
146
|
WorkflowEventError,
|
@@ -163,11 +170,13 @@ from .types import (
|
|
163
170
|
WorkflowResultEvent,
|
164
171
|
WorkflowResultEventOutputData,
|
165
172
|
WorkflowResultEventOutputDataChatHistory,
|
173
|
+
WorkflowResultEventOutputDataError,
|
166
174
|
WorkflowResultEventOutputDataJson,
|
167
175
|
WorkflowResultEventOutputDataNumber,
|
168
176
|
WorkflowResultEventOutputDataSearchResults,
|
169
177
|
WorkflowResultEventOutputDataString,
|
170
178
|
WorkflowResultEventOutputData_ChatHistory,
|
179
|
+
WorkflowResultEventOutputData_Error,
|
171
180
|
WorkflowResultEventOutputData_Json,
|
172
181
|
WorkflowResultEventOutputData_Number,
|
173
182
|
WorkflowResultEventOutputData_SearchResults,
|
@@ -230,7 +239,6 @@ __all__ = [
|
|
230
239
|
"MetadataFilterConfigRequest",
|
231
240
|
"MetadataFilterRuleCombinator",
|
232
241
|
"MetadataFilterRuleRequest",
|
233
|
-
"ModelTypeDeprecated",
|
234
242
|
"ModelVersionBuildConfig",
|
235
243
|
"ModelVersionCompilePromptResponse",
|
236
244
|
"ModelVersionCompiledPrompt",
|
@@ -240,12 +248,14 @@ __all__ = [
|
|
240
248
|
"ModelVersionReadStatusEnum",
|
241
249
|
"ModelVersionSandboxSnapshot",
|
242
250
|
"NodeInputCompiledChatHistoryValue",
|
251
|
+
"NodeInputCompiledErrorValue",
|
243
252
|
"NodeInputCompiledJsonValue",
|
244
253
|
"NodeInputCompiledNumberValue",
|
245
254
|
"NodeInputCompiledSearchResultsValue",
|
246
255
|
"NodeInputCompiledStringValue",
|
247
256
|
"NodeInputVariableCompiledValue",
|
248
257
|
"NodeInputVariableCompiledValue_ChatHistory",
|
258
|
+
"NodeInputVariableCompiledValue_Error",
|
249
259
|
"NodeInputVariableCompiledValue_Json",
|
250
260
|
"NodeInputVariableCompiledValue_Number",
|
251
261
|
"NodeInputVariableCompiledValue_SearchResults",
|
@@ -299,12 +309,14 @@ __all__ = [
|
|
299
309
|
"SubmitWorkflowExecutionActualRequest_Json",
|
300
310
|
"SubmitWorkflowExecutionActualRequest_String",
|
301
311
|
"TemplatingNodeChatHistoryResult",
|
312
|
+
"TemplatingNodeErrorResult",
|
302
313
|
"TemplatingNodeJsonResult",
|
303
314
|
"TemplatingNodeNumberResult",
|
304
315
|
"TemplatingNodeResult",
|
305
316
|
"TemplatingNodeResultData",
|
306
317
|
"TemplatingNodeResultOutput",
|
307
318
|
"TemplatingNodeResultOutput_ChatHistory",
|
319
|
+
"TemplatingNodeResultOutput_Error",
|
308
320
|
"TemplatingNodeResultOutput_Json",
|
309
321
|
"TemplatingNodeResultOutput_Number",
|
310
322
|
"TemplatingNodeResultOutput_SearchResults",
|
@@ -312,12 +324,14 @@ __all__ = [
|
|
312
324
|
"TemplatingNodeSearchResultsResult",
|
313
325
|
"TemplatingNodeStringResult",
|
314
326
|
"TerminalNodeChatHistoryResult",
|
327
|
+
"TerminalNodeErrorResult",
|
315
328
|
"TerminalNodeJsonResult",
|
316
329
|
"TerminalNodeNumberResult",
|
317
330
|
"TerminalNodeResult",
|
318
331
|
"TerminalNodeResultData",
|
319
332
|
"TerminalNodeResultOutput",
|
320
333
|
"TerminalNodeResultOutput_ChatHistory",
|
334
|
+
"TerminalNodeResultOutput_Error",
|
321
335
|
"TerminalNodeResultOutput_Json",
|
322
336
|
"TerminalNodeResultOutput_Number",
|
323
337
|
"TerminalNodeResultOutput_SearchResults",
|
@@ -328,6 +342,8 @@ __all__ = [
|
|
328
342
|
"UploadDocumentErrorResponse",
|
329
343
|
"UploadDocumentResponse",
|
330
344
|
"VellumEnvironment",
|
345
|
+
"VellumError",
|
346
|
+
"VellumErrorCodeEnum",
|
331
347
|
"VellumVariable",
|
332
348
|
"VellumVariableType",
|
333
349
|
"WorkflowEventError",
|
@@ -357,11 +373,13 @@ __all__ = [
|
|
357
373
|
"WorkflowResultEvent",
|
358
374
|
"WorkflowResultEventOutputData",
|
359
375
|
"WorkflowResultEventOutputDataChatHistory",
|
376
|
+
"WorkflowResultEventOutputDataError",
|
360
377
|
"WorkflowResultEventOutputDataJson",
|
361
378
|
"WorkflowResultEventOutputDataNumber",
|
362
379
|
"WorkflowResultEventOutputDataSearchResults",
|
363
380
|
"WorkflowResultEventOutputDataString",
|
364
381
|
"WorkflowResultEventOutputData_ChatHistory",
|
382
|
+
"WorkflowResultEventOutputData_Error",
|
365
383
|
"WorkflowResultEventOutputData_Json",
|
366
384
|
"WorkflowResultEventOutputData_Number",
|
367
385
|
"WorkflowResultEventOutputData_SearchResults",
|
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
|
|
vellum/core/client_wrapper.py
CHANGED
@@ -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.
|
19
|
+
"X-Fern-SDK-Version": "v0.0.44",
|
20
20
|
}
|
21
21
|
headers["X_API_KEY"] = self.api_key
|
22
22
|
return headers
|
vellum/core/jsonable_encoder.py
CHANGED
@@ -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
|
-
|
20
|
-
|
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,18 +4,23 @@ 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
|
10
|
+
from ...errors.bad_request_error import BadRequestError
|
12
11
|
from ...errors.conflict_error import ConflictError
|
12
|
+
from ...errors.not_found_error import NotFoundError
|
13
13
|
from ...types.provider_enum import ProviderEnum
|
14
14
|
from ...types.register_prompt_error_response import RegisterPromptErrorResponse
|
15
15
|
from ...types.register_prompt_model_parameters_request import RegisterPromptModelParametersRequest
|
16
16
|
from ...types.register_prompt_prompt_info_request import RegisterPromptPromptInfoRequest
|
17
17
|
from ...types.register_prompt_response import RegisterPromptResponse
|
18
18
|
|
19
|
+
try:
|
20
|
+
import pydantic.v1 as pydantic # type: ignore
|
21
|
+
except ImportError:
|
22
|
+
import pydantic # type: ignore
|
23
|
+
|
19
24
|
# this is used as the default value for optional parameters
|
20
25
|
OMIT = typing.cast(typing.Any, ...)
|
21
26
|
|
@@ -55,8 +60,9 @@ class RegisteredPromptsClient:
|
|
55
60
|
* `GOOGLE` - Google
|
56
61
|
* `HOSTED` - Hosted
|
57
62
|
* `MOSAICML` - MosaicML
|
58
|
-
* `MYSTIC` - Mystic
|
59
63
|
* `OPENAI` - OpenAI
|
64
|
+
* `HUGGINGFACE` - HuggingFace
|
65
|
+
* `MYSTIC` - Mystic
|
60
66
|
* `PYQ` - Pyq
|
61
67
|
- model: str. The initial model to use for this prompt
|
62
68
|
|
@@ -85,6 +91,10 @@ class RegisteredPromptsClient:
|
|
85
91
|
)
|
86
92
|
if 200 <= _response.status_code < 300:
|
87
93
|
return pydantic.parse_obj_as(RegisterPromptResponse, _response.json()) # type: ignore
|
94
|
+
if _response.status_code == 400:
|
95
|
+
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
96
|
+
if _response.status_code == 404:
|
97
|
+
raise NotFoundError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
88
98
|
if _response.status_code == 409:
|
89
99
|
raise ConflictError(pydantic.parse_obj_as(RegisterPromptErrorResponse, _response.json())) # type: ignore
|
90
100
|
try:
|
@@ -129,8 +139,9 @@ class AsyncRegisteredPromptsClient:
|
|
129
139
|
* `GOOGLE` - Google
|
130
140
|
* `HOSTED` - Hosted
|
131
141
|
* `MOSAICML` - MosaicML
|
132
|
-
* `MYSTIC` - Mystic
|
133
142
|
* `OPENAI` - OpenAI
|
143
|
+
* `HUGGINGFACE` - HuggingFace
|
144
|
+
* `MYSTIC` - Mystic
|
134
145
|
* `PYQ` - Pyq
|
135
146
|
- model: str. The initial model to use for this prompt
|
136
147
|
|
@@ -159,6 +170,10 @@ class AsyncRegisteredPromptsClient:
|
|
159
170
|
)
|
160
171
|
if 200 <= _response.status_code < 300:
|
161
172
|
return pydantic.parse_obj_as(RegisterPromptResponse, _response.json()) # type: ignore
|
173
|
+
if _response.status_code == 400:
|
174
|
+
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
175
|
+
if _response.status_code == 404:
|
176
|
+
raise NotFoundError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
|
162
177
|
if _response.status_code == 409:
|
163
178
|
raise ConflictError(pydantic.parse_obj_as(RegisterPromptErrorResponse, _response.json())) # type: ignore
|
164
179
|
try:
|
@@ -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
|
|
vellum/types/__init__.py
CHANGED
@@ -37,7 +37,6 @@ from .logprobs_enum import LogprobsEnum
|
|
37
37
|
from .metadata_filter_config_request import MetadataFilterConfigRequest
|
38
38
|
from .metadata_filter_rule_combinator import MetadataFilterRuleCombinator
|
39
39
|
from .metadata_filter_rule_request import MetadataFilterRuleRequest
|
40
|
-
from .model_type_deprecated import ModelTypeDeprecated
|
41
40
|
from .model_version_build_config import ModelVersionBuildConfig
|
42
41
|
from .model_version_compile_prompt_response import ModelVersionCompilePromptResponse
|
43
42
|
from .model_version_compiled_prompt import ModelVersionCompiledPrompt
|
@@ -47,6 +46,7 @@ from .model_version_read import ModelVersionRead
|
|
47
46
|
from .model_version_read_status_enum import ModelVersionReadStatusEnum
|
48
47
|
from .model_version_sandbox_snapshot import ModelVersionSandboxSnapshot
|
49
48
|
from .node_input_compiled_chat_history_value import NodeInputCompiledChatHistoryValue
|
49
|
+
from .node_input_compiled_error_value import NodeInputCompiledErrorValue
|
50
50
|
from .node_input_compiled_json_value import NodeInputCompiledJsonValue
|
51
51
|
from .node_input_compiled_number_value import NodeInputCompiledNumberValue
|
52
52
|
from .node_input_compiled_search_results_value import NodeInputCompiledSearchResultsValue
|
@@ -54,6 +54,7 @@ from .node_input_compiled_string_value import NodeInputCompiledStringValue
|
|
54
54
|
from .node_input_variable_compiled_value import (
|
55
55
|
NodeInputVariableCompiledValue,
|
56
56
|
NodeInputVariableCompiledValue_ChatHistory,
|
57
|
+
NodeInputVariableCompiledValue_Error,
|
57
58
|
NodeInputVariableCompiledValue_Json,
|
58
59
|
NodeInputVariableCompiledValue_Number,
|
59
60
|
NodeInputVariableCompiledValue_SearchResults,
|
@@ -109,6 +110,7 @@ from .submit_workflow_execution_actual_request import (
|
|
109
110
|
SubmitWorkflowExecutionActualRequest_String,
|
110
111
|
)
|
111
112
|
from .templating_node_chat_history_result import TemplatingNodeChatHistoryResult
|
113
|
+
from .templating_node_error_result import TemplatingNodeErrorResult
|
112
114
|
from .templating_node_json_result import TemplatingNodeJsonResult
|
113
115
|
from .templating_node_number_result import TemplatingNodeNumberResult
|
114
116
|
from .templating_node_result import TemplatingNodeResult
|
@@ -116,6 +118,7 @@ from .templating_node_result_data import TemplatingNodeResultData
|
|
116
118
|
from .templating_node_result_output import (
|
117
119
|
TemplatingNodeResultOutput,
|
118
120
|
TemplatingNodeResultOutput_ChatHistory,
|
121
|
+
TemplatingNodeResultOutput_Error,
|
119
122
|
TemplatingNodeResultOutput_Json,
|
120
123
|
TemplatingNodeResultOutput_Number,
|
121
124
|
TemplatingNodeResultOutput_SearchResults,
|
@@ -124,6 +127,7 @@ from .templating_node_result_output import (
|
|
124
127
|
from .templating_node_search_results_result import TemplatingNodeSearchResultsResult
|
125
128
|
from .templating_node_string_result import TemplatingNodeStringResult
|
126
129
|
from .terminal_node_chat_history_result import TerminalNodeChatHistoryResult
|
130
|
+
from .terminal_node_error_result import TerminalNodeErrorResult
|
127
131
|
from .terminal_node_json_result import TerminalNodeJsonResult
|
128
132
|
from .terminal_node_number_result import TerminalNodeNumberResult
|
129
133
|
from .terminal_node_result import TerminalNodeResult
|
@@ -131,6 +135,7 @@ from .terminal_node_result_data import TerminalNodeResultData
|
|
131
135
|
from .terminal_node_result_output import (
|
132
136
|
TerminalNodeResultOutput,
|
133
137
|
TerminalNodeResultOutput_ChatHistory,
|
138
|
+
TerminalNodeResultOutput_Error,
|
134
139
|
TerminalNodeResultOutput_Json,
|
135
140
|
TerminalNodeResultOutput_Number,
|
136
141
|
TerminalNodeResultOutput_SearchResults,
|
@@ -141,6 +146,8 @@ from .terminal_node_string_result import TerminalNodeStringResult
|
|
141
146
|
from .test_suite_test_case import TestSuiteTestCase
|
142
147
|
from .upload_document_error_response import UploadDocumentErrorResponse
|
143
148
|
from .upload_document_response import UploadDocumentResponse
|
149
|
+
from .vellum_error import VellumError
|
150
|
+
from .vellum_error_code_enum import VellumErrorCodeEnum
|
144
151
|
from .vellum_variable import VellumVariable
|
145
152
|
from .vellum_variable_type import VellumVariableType
|
146
153
|
from .workflow_event_error import WorkflowEventError
|
@@ -175,12 +182,14 @@ from .workflow_result_event import WorkflowResultEvent
|
|
175
182
|
from .workflow_result_event_output_data import (
|
176
183
|
WorkflowResultEventOutputData,
|
177
184
|
WorkflowResultEventOutputData_ChatHistory,
|
185
|
+
WorkflowResultEventOutputData_Error,
|
178
186
|
WorkflowResultEventOutputData_Json,
|
179
187
|
WorkflowResultEventOutputData_Number,
|
180
188
|
WorkflowResultEventOutputData_SearchResults,
|
181
189
|
WorkflowResultEventOutputData_String,
|
182
190
|
)
|
183
191
|
from .workflow_result_event_output_data_chat_history import WorkflowResultEventOutputDataChatHistory
|
192
|
+
from .workflow_result_event_output_data_error import WorkflowResultEventOutputDataError
|
184
193
|
from .workflow_result_event_output_data_json import WorkflowResultEventOutputDataJson
|
185
194
|
from .workflow_result_event_output_data_number import WorkflowResultEventOutputDataNumber
|
186
195
|
from .workflow_result_event_output_data_search_results import WorkflowResultEventOutputDataSearchResults
|
@@ -225,7 +234,6 @@ __all__ = [
|
|
225
234
|
"MetadataFilterConfigRequest",
|
226
235
|
"MetadataFilterRuleCombinator",
|
227
236
|
"MetadataFilterRuleRequest",
|
228
|
-
"ModelTypeDeprecated",
|
229
237
|
"ModelVersionBuildConfig",
|
230
238
|
"ModelVersionCompilePromptResponse",
|
231
239
|
"ModelVersionCompiledPrompt",
|
@@ -235,12 +243,14 @@ __all__ = [
|
|
235
243
|
"ModelVersionReadStatusEnum",
|
236
244
|
"ModelVersionSandboxSnapshot",
|
237
245
|
"NodeInputCompiledChatHistoryValue",
|
246
|
+
"NodeInputCompiledErrorValue",
|
238
247
|
"NodeInputCompiledJsonValue",
|
239
248
|
"NodeInputCompiledNumberValue",
|
240
249
|
"NodeInputCompiledSearchResultsValue",
|
241
250
|
"NodeInputCompiledStringValue",
|
242
251
|
"NodeInputVariableCompiledValue",
|
243
252
|
"NodeInputVariableCompiledValue_ChatHistory",
|
253
|
+
"NodeInputVariableCompiledValue_Error",
|
244
254
|
"NodeInputVariableCompiledValue_Json",
|
245
255
|
"NodeInputVariableCompiledValue_Number",
|
246
256
|
"NodeInputVariableCompiledValue_SearchResults",
|
@@ -293,12 +303,14 @@ __all__ = [
|
|
293
303
|
"SubmitWorkflowExecutionActualRequest_Json",
|
294
304
|
"SubmitWorkflowExecutionActualRequest_String",
|
295
305
|
"TemplatingNodeChatHistoryResult",
|
306
|
+
"TemplatingNodeErrorResult",
|
296
307
|
"TemplatingNodeJsonResult",
|
297
308
|
"TemplatingNodeNumberResult",
|
298
309
|
"TemplatingNodeResult",
|
299
310
|
"TemplatingNodeResultData",
|
300
311
|
"TemplatingNodeResultOutput",
|
301
312
|
"TemplatingNodeResultOutput_ChatHistory",
|
313
|
+
"TemplatingNodeResultOutput_Error",
|
302
314
|
"TemplatingNodeResultOutput_Json",
|
303
315
|
"TemplatingNodeResultOutput_Number",
|
304
316
|
"TemplatingNodeResultOutput_SearchResults",
|
@@ -306,12 +318,14 @@ __all__ = [
|
|
306
318
|
"TemplatingNodeSearchResultsResult",
|
307
319
|
"TemplatingNodeStringResult",
|
308
320
|
"TerminalNodeChatHistoryResult",
|
321
|
+
"TerminalNodeErrorResult",
|
309
322
|
"TerminalNodeJsonResult",
|
310
323
|
"TerminalNodeNumberResult",
|
311
324
|
"TerminalNodeResult",
|
312
325
|
"TerminalNodeResultData",
|
313
326
|
"TerminalNodeResultOutput",
|
314
327
|
"TerminalNodeResultOutput_ChatHistory",
|
328
|
+
"TerminalNodeResultOutput_Error",
|
315
329
|
"TerminalNodeResultOutput_Json",
|
316
330
|
"TerminalNodeResultOutput_Number",
|
317
331
|
"TerminalNodeResultOutput_SearchResults",
|
@@ -321,6 +335,8 @@ __all__ = [
|
|
321
335
|
"TestSuiteTestCase",
|
322
336
|
"UploadDocumentErrorResponse",
|
323
337
|
"UploadDocumentResponse",
|
338
|
+
"VellumError",
|
339
|
+
"VellumErrorCodeEnum",
|
324
340
|
"VellumVariable",
|
325
341
|
"VellumVariableType",
|
326
342
|
"WorkflowEventError",
|
@@ -350,11 +366,13 @@ __all__ = [
|
|
350
366
|
"WorkflowResultEvent",
|
351
367
|
"WorkflowResultEventOutputData",
|
352
368
|
"WorkflowResultEventOutputDataChatHistory",
|
369
|
+
"WorkflowResultEventOutputDataError",
|
353
370
|
"WorkflowResultEventOutputDataJson",
|
354
371
|
"WorkflowResultEventOutputDataNumber",
|
355
372
|
"WorkflowResultEventOutputDataSearchResults",
|
356
373
|
"WorkflowResultEventOutputDataString",
|
357
374
|
"WorkflowResultEventOutputData_ChatHistory",
|
375
|
+
"WorkflowResultEventOutputData_Error",
|
358
376
|
"WorkflowResultEventOutputData_Json",
|
359
377
|
"WorkflowResultEventOutputData_Number",
|
360
378
|
"WorkflowResultEventOutputData_SearchResults",
|
vellum/types/api_node_result.py
CHANGED
@@ -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
|
vellum/types/chat_message.py
CHANGED
@@ -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]
|