vellum-ai 0.3.13__py3-none-any.whl → 0.3.15__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +22 -0
- vellum/client.py +846 -100
- vellum/core/__init__.py +8 -0
- vellum/core/client_wrapper.py +27 -8
- vellum/core/file.py +38 -0
- vellum/core/http_client.py +130 -0
- vellum/core/jsonable_encoder.py +2 -2
- vellum/core/request_options.py +32 -0
- vellum/resources/deployments/client.py +161 -24
- vellum/resources/document_indexes/client.py +337 -80
- vellum/resources/documents/client.py +278 -58
- vellum/resources/folder_entities/client.py +60 -10
- vellum/resources/model_versions/client.py +48 -8
- vellum/resources/registered_prompts/client.py +52 -6
- vellum/resources/sandboxes/client.py +108 -26
- vellum/resources/test_suite_runs/client.py +221 -38
- vellum/resources/test_suites/client.py +110 -24
- vellum/resources/workflow_deployments/client.py +110 -14
- vellum/types/__init__.py +20 -0
- vellum/types/api_node_result.py +1 -0
- vellum/types/api_node_result_data.py +4 -2
- vellum/types/array_chat_message_content.py +1 -0
- vellum/types/array_chat_message_content_item.py +6 -5
- vellum/types/array_chat_message_content_item_request.py +6 -5
- vellum/types/array_chat_message_content_request.py +1 -0
- vellum/types/array_enum.py +2 -2
- vellum/types/array_variable_value_item.py +16 -10
- vellum/types/chat_history_enum.py +2 -2
- vellum/types/chat_history_input_request.py +6 -1
- vellum/types/chat_history_variable_value.py +2 -1
- vellum/types/chat_message.py +7 -5
- vellum/types/chat_message_content.py +8 -6
- vellum/types/chat_message_content_request.py +8 -6
- vellum/types/chat_message_request.py +7 -5
- vellum/types/code_execution_node_array_result.py +31 -0
- vellum/types/code_execution_node_chat_history_result.py +2 -1
- vellum/types/code_execution_node_error_result.py +2 -1
- vellum/types/code_execution_node_function_call_result.py +31 -0
- vellum/types/code_execution_node_json_result.py +2 -1
- vellum/types/code_execution_node_number_result.py +2 -1
- vellum/types/code_execution_node_result.py +1 -0
- vellum/types/code_execution_node_result_data.py +2 -1
- vellum/types/code_execution_node_result_output.py +36 -8
- vellum/types/code_execution_node_search_results_result.py +2 -1
- vellum/types/code_execution_node_string_result.py +2 -1
- vellum/types/conditional_node_result.py +1 -0
- vellum/types/conditional_node_result_data.py +2 -1
- vellum/types/deployment_provider_payload_response.py +1 -0
- vellum/types/deployment_read.py +32 -17
- vellum/types/document_document_to_document_index.py +21 -15
- vellum/types/document_index_read.py +32 -19
- vellum/types/document_read.py +34 -24
- vellum/types/document_status.py +2 -2
- vellum/types/enriched_normalized_completion.py +36 -19
- vellum/types/error_enum.py +2 -2
- vellum/types/error_variable_value.py +2 -1
- vellum/types/execute_prompt_api_error_response.py +5 -1
- vellum/types/execute_prompt_event.py +8 -6
- vellum/types/execute_prompt_response.py +4 -4
- vellum/types/execute_workflow_error_response.py +5 -1
- vellum/types/execute_workflow_response.py +3 -2
- vellum/types/execute_workflow_stream_error_response.py +5 -1
- vellum/types/execute_workflow_workflow_result_event.py +4 -4
- vellum/types/execution_array_vellum_value.py +7 -2
- vellum/types/execution_chat_history_vellum_value.py +7 -2
- vellum/types/execution_error_vellum_value.py +7 -2
- vellum/types/execution_function_call_vellum_value.py +7 -2
- vellum/types/execution_json_vellum_value.py +7 -2
- vellum/types/execution_number_vellum_value.py +7 -2
- vellum/types/execution_search_results_vellum_value.py +7 -2
- vellum/types/execution_string_vellum_value.py +7 -2
- vellum/types/execution_vellum_value.py +16 -10
- vellum/types/fulfilled_enum.py +2 -2
- vellum/types/fulfilled_execute_prompt_event.py +2 -1
- vellum/types/fulfilled_execute_prompt_response.py +12 -5
- vellum/types/fulfilled_execute_workflow_workflow_result_event.py +1 -0
- vellum/types/fulfilled_function_call.py +2 -1
- vellum/types/fulfilled_prompt_execution_meta.py +3 -2
- vellum/types/fulfilled_workflow_node_result_event.py +6 -5
- vellum/types/function_call.py +4 -4
- vellum/types/function_call_chat_message_content.py +1 -0
- vellum/types/function_call_chat_message_content_request.py +1 -0
- vellum/types/function_call_chat_message_content_value.py +2 -1
- vellum/types/function_call_chat_message_content_value_request.py +2 -1
- vellum/types/function_call_enum.py +2 -2
- vellum/types/function_call_variable_value.py +1 -0
- vellum/types/generate_error_response.py +5 -1
- vellum/types/generate_options_request.py +8 -5
- vellum/types/generate_request.py +15 -9
- vellum/types/generate_result.py +10 -6
- vellum/types/generate_result_data.py +5 -3
- vellum/types/generate_result_error.py +5 -1
- vellum/types/generate_stream_response.py +1 -0
- vellum/types/generate_stream_result.py +3 -2
- vellum/types/generate_stream_result_data.py +1 -0
- vellum/types/image_chat_message_content.py +1 -0
- vellum/types/image_chat_message_content_request.py +1 -0
- vellum/types/image_enum.py +2 -2
- vellum/types/image_variable_value.py +2 -1
- vellum/types/initiated_enum.py +2 -2
- vellum/types/initiated_execute_prompt_event.py +2 -1
- vellum/types/initiated_prompt_execution_meta.py +5 -4
- vellum/types/initiated_workflow_node_result_event.py +5 -4
- vellum/types/json_enum.py +2 -2
- vellum/types/json_input_request.py +6 -1
- vellum/types/json_variable_value.py +2 -1
- vellum/types/logprobs_enum.py +2 -2
- vellum/types/metadata_filter_config_request.py +7 -6
- vellum/types/metadata_filter_rule_request.py +7 -6
- vellum/types/model_version_build_config.py +12 -7
- vellum/types/model_version_exec_config.py +18 -11
- vellum/types/model_version_exec_config_parameters.py +7 -6
- vellum/types/model_version_read.py +51 -32
- vellum/types/model_version_sandbox_snapshot.py +17 -4
- vellum/types/named_test_case_chat_history_variable_value_request.py +2 -1
- vellum/types/named_test_case_error_variable_value_request.py +2 -1
- vellum/types/named_test_case_json_variable_value_request.py +2 -1
- vellum/types/named_test_case_number_variable_value_request.py +2 -1
- vellum/types/named_test_case_search_results_variable_value_request.py +2 -1
- vellum/types/named_test_case_string_variable_value_request.py +2 -1
- vellum/types/named_test_case_variable_value_request.py +12 -8
- vellum/types/node_input_compiled_array_value.py +2 -1
- vellum/types/node_input_compiled_chat_history_value.py +2 -1
- vellum/types/node_input_compiled_error_value.py +2 -1
- vellum/types/node_input_compiled_function_call.py +32 -0
- vellum/types/node_input_compiled_json_value.py +2 -1
- vellum/types/node_input_compiled_number_value.py +2 -1
- vellum/types/node_input_compiled_search_results_value.py +2 -1
- vellum/types/node_input_compiled_string_value.py +2 -1
- vellum/types/node_input_variable_compiled_value.py +26 -9
- vellum/types/node_output_compiled_array_value.py +2 -1
- vellum/types/node_output_compiled_chat_history_value.py +2 -1
- vellum/types/node_output_compiled_error_value.py +2 -1
- vellum/types/node_output_compiled_function_value.py +2 -1
- vellum/types/node_output_compiled_json_value.py +2 -1
- vellum/types/node_output_compiled_number_value.py +2 -1
- vellum/types/node_output_compiled_search_results_value.py +2 -1
- vellum/types/node_output_compiled_string_value.py +2 -1
- vellum/types/node_output_compiled_value.py +16 -10
- vellum/types/normalized_log_probs.py +2 -1
- vellum/types/normalized_token_log_probs.py +3 -2
- vellum/types/number_enum.py +2 -2
- vellum/types/number_variable_value.py +2 -1
- vellum/types/paginated_document_index_read_list.py +5 -4
- vellum/types/paginated_slim_deployment_read_list.py +5 -4
- vellum/types/paginated_slim_document_list.py +5 -4
- vellum/types/paginated_slim_workflow_deployment_list.py +5 -4
- vellum/types/paginated_test_suite_run_execution_list.py +5 -4
- vellum/types/prompt_deployment_expand_meta_request_request.py +25 -15
- vellum/types/prompt_deployment_input_request.py +6 -5
- vellum/types/prompt_execution_meta.py +6 -5
- vellum/types/prompt_node_result.py +1 -0
- vellum/types/prompt_node_result_data.py +4 -3
- vellum/types/prompt_output.py +8 -6
- vellum/types/prompt_template_block.py +1 -0
- vellum/types/prompt_template_block_data.py +1 -0
- vellum/types/prompt_template_block_data_request.py +1 -0
- vellum/types/prompt_template_block_properties.py +11 -10
- vellum/types/prompt_template_block_properties_request.py +11 -10
- vellum/types/prompt_template_block_request.py +1 -0
- vellum/types/raw_prompt_execution_overrides_request.py +11 -5
- vellum/types/register_prompt_error_response.py +5 -1
- vellum/types/register_prompt_model_parameters_request.py +5 -4
- vellum/types/register_prompt_prompt.py +10 -2
- vellum/types/register_prompt_prompt_info_request.py +5 -3
- vellum/types/register_prompt_response.py +30 -10
- vellum/types/registered_prompt_deployment.py +15 -3
- vellum/types/registered_prompt_input_variable_request.py +3 -2
- vellum/types/registered_prompt_model_version.py +10 -2
- vellum/types/registered_prompt_sandbox.py +10 -2
- vellum/types/registered_prompt_sandbox_snapshot.py +5 -1
- vellum/types/rejected_enum.py +2 -2
- vellum/types/rejected_execute_prompt_event.py +2 -1
- vellum/types/rejected_execute_prompt_response.py +12 -5
- vellum/types/rejected_execute_workflow_workflow_result_event.py +1 -0
- vellum/types/rejected_function_call.py +2 -1
- vellum/types/rejected_prompt_execution_meta.py +3 -2
- vellum/types/rejected_workflow_node_result_event.py +4 -3
- vellum/types/sandbox_scenario.py +11 -3
- vellum/types/scenario_input.py +4 -3
- vellum/types/scenario_input_request.py +4 -3
- vellum/types/search_error_response.py +5 -1
- vellum/types/search_filters_request.py +10 -6
- vellum/types/search_node_result.py +1 -0
- vellum/types/search_node_result_data.py +7 -4
- vellum/types/search_request_options_request.py +20 -8
- vellum/types/search_response.py +5 -3
- vellum/types/search_result.py +15 -5
- vellum/types/search_result_document.py +20 -8
- vellum/types/search_result_document_request.py +15 -7
- vellum/types/search_result_merging_request.py +5 -1
- vellum/types/search_result_request.py +15 -5
- vellum/types/search_results_enum.py +2 -2
- vellum/types/search_results_variable_value.py +2 -1
- vellum/types/search_weights_request.py +10 -4
- vellum/types/slim_deployment_read.py +28 -14
- vellum/types/slim_document.py +56 -35
- vellum/types/slim_workflow_deployment.py +37 -24
- vellum/types/streaming_enum.py +2 -2
- vellum/types/streaming_execute_prompt_event.py +6 -4
- vellum/types/streaming_prompt_execution_meta.py +2 -1
- vellum/types/streaming_workflow_node_result_event.py +6 -5
- vellum/types/string_chat_message_content.py +1 -0
- vellum/types/string_chat_message_content_request.py +1 -0
- vellum/types/string_enum.py +2 -2
- vellum/types/string_input_request.py +6 -1
- vellum/types/string_variable_value.py +2 -1
- vellum/types/submit_completion_actual_request.py +25 -13
- vellum/types/submit_completion_actuals_error_response.py +1 -0
- vellum/types/submit_workflow_execution_actual_request.py +6 -5
- vellum/types/subworkflow_enum.py +2 -2
- vellum/types/subworkflow_node_result.py +1 -0
- vellum/types/templating_node_array_result.py +31 -0
- vellum/types/templating_node_chat_history_result.py +2 -1
- vellum/types/templating_node_error_result.py +2 -1
- vellum/types/templating_node_function_call_result.py +31 -0
- vellum/types/templating_node_json_result.py +2 -1
- vellum/types/templating_node_number_result.py +2 -1
- vellum/types/templating_node_result.py +1 -0
- vellum/types/templating_node_result_data.py +1 -0
- vellum/types/templating_node_result_output.py +36 -8
- vellum/types/templating_node_search_results_result.py +2 -1
- vellum/types/templating_node_string_result.py +2 -1
- vellum/types/terminal_node_array_result.py +8 -3
- vellum/types/terminal_node_chat_history_result.py +8 -3
- vellum/types/terminal_node_error_result.py +8 -3
- vellum/types/terminal_node_function_call_result.py +8 -3
- vellum/types/terminal_node_json_result.py +8 -3
- vellum/types/terminal_node_number_result.py +8 -3
- vellum/types/terminal_node_result.py +1 -0
- vellum/types/terminal_node_result_data.py +1 -0
- vellum/types/terminal_node_result_output.py +16 -10
- vellum/types/terminal_node_search_results_result.py +8 -3
- vellum/types/terminal_node_string_result.py +8 -3
- vellum/types/test_case_chat_history_variable_value.py +2 -1
- vellum/types/test_case_error_variable_value.py +2 -1
- vellum/types/test_case_json_variable_value.py +2 -1
- vellum/types/test_case_number_variable_value.py +2 -1
- vellum/types/test_case_search_results_variable_value.py +2 -1
- vellum/types/test_case_string_variable_value.py +2 -1
- vellum/types/test_case_variable_value.py +12 -8
- vellum/types/test_suite_run_deployment_release_tag_exec_config.py +5 -3
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +10 -4
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +10 -4
- vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +5 -3
- vellum/types/test_suite_run_deployment_release_tag_exec_config_type_enum.py +2 -2
- vellum/types/test_suite_run_exec_config.py +4 -4
- vellum/types/test_suite_run_exec_config_request.py +4 -4
- vellum/types/test_suite_run_execution.py +1 -0
- vellum/types/test_suite_run_execution_chat_history_output.py +2 -1
- vellum/types/test_suite_run_execution_error_output.py +2 -1
- vellum/types/test_suite_run_execution_json_output.py +2 -1
- vellum/types/test_suite_run_execution_metric_result.py +1 -0
- vellum/types/test_suite_run_execution_number_output.py +2 -1
- vellum/types/test_suite_run_execution_output.py +12 -8
- vellum/types/test_suite_run_execution_search_results_output.py +2 -1
- vellum/types/test_suite_run_execution_string_output.py +2 -1
- vellum/types/test_suite_run_metric_error_output.py +1 -0
- vellum/types/test_suite_run_metric_error_output_type_enum.py +2 -2
- vellum/types/test_suite_run_metric_number_output.py +1 -0
- vellum/types/test_suite_run_metric_number_output_type_enum.py +2 -2
- vellum/types/test_suite_run_metric_output.py +4 -4
- vellum/types/test_suite_run_read.py +16 -14
- vellum/types/test_suite_run_test_suite.py +1 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config.py +5 -3
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +10 -6
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +10 -6
- vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +5 -3
- vellum/types/test_suite_run_workflow_release_tag_exec_config_type_enum.py +2 -2
- vellum/types/test_suite_test_case.py +3 -2
- vellum/types/upload_document_error_response.py +1 -0
- vellum/types/upload_document_response.py +5 -1
- vellum/types/vellum_error.py +1 -0
- vellum/types/vellum_error_request.py +1 -0
- vellum/types/vellum_image.py +2 -1
- vellum/types/vellum_image_request.py +2 -1
- vellum/types/vellum_variable.py +1 -0
- vellum/types/workflow_deployment_read.py +37 -24
- vellum/types/workflow_event_error.py +1 -0
- vellum/types/workflow_execution_actual_chat_history_request.py +25 -15
- vellum/types/workflow_execution_actual_json_request.py +25 -15
- vellum/types/workflow_execution_actual_string_request.py +25 -15
- vellum/types/workflow_execution_node_result_event.py +3 -2
- vellum/types/workflow_execution_workflow_result_event.py +3 -2
- vellum/types/workflow_node_result_data.py +16 -10
- vellum/types/workflow_node_result_event.py +8 -6
- vellum/types/workflow_output.py +18 -11
- vellum/types/workflow_output_array.py +7 -2
- vellum/types/workflow_output_chat_history.py +7 -2
- vellum/types/workflow_output_error.py +7 -2
- vellum/types/workflow_output_function_call.py +7 -2
- vellum/types/workflow_output_image.py +7 -2
- vellum/types/workflow_output_json.py +7 -2
- vellum/types/workflow_output_number.py +7 -2
- vellum/types/workflow_output_search_results.py +7 -2
- vellum/types/workflow_output_string.py +7 -2
- vellum/types/workflow_request_chat_history_input_request.py +6 -1
- vellum/types/workflow_request_input_request.py +8 -6
- vellum/types/workflow_request_json_input_request.py +6 -1
- vellum/types/workflow_request_number_input_request.py +6 -1
- vellum/types/workflow_request_string_input_request.py +6 -1
- vellum/types/workflow_result_event.py +5 -4
- vellum/types/workflow_result_event_output_data.py +16 -10
- vellum/types/workflow_result_event_output_data_array.py +8 -5
- vellum/types/workflow_result_event_output_data_chat_history.py +8 -5
- vellum/types/workflow_result_event_output_data_error.py +8 -5
- vellum/types/workflow_result_event_output_data_function_call.py +8 -5
- vellum/types/workflow_result_event_output_data_json.py +8 -5
- vellum/types/workflow_result_event_output_data_number.py +8 -5
- vellum/types/workflow_result_event_output_data_search_results.py +8 -5
- vellum/types/workflow_result_event_output_data_string.py +11 -7
- vellum/types/workflow_stream_event.py +4 -4
- vellum/version.py +4 -0
- {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/METADATA +4 -4
- vellum_ai-0.3.15.dist-info/RECORD +365 -0
- vellum_ai-0.3.13.dist-info/RECORD +0 -356
- {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/WHEEL +0 -0
@@ -6,7 +6,9 @@ from json.decoder import JSONDecodeError
|
|
6
6
|
|
7
7
|
from ...core.api_error import ApiError
|
8
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
9
10
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ...core.request_options import RequestOptions
|
10
12
|
from ...types.paginated_slim_workflow_deployment_list import PaginatedSlimWorkflowDeploymentList
|
11
13
|
from ...types.workflow_deployment_read import WorkflowDeploymentRead
|
12
14
|
from .types.workflow_deployments_list_request_status import WorkflowDeploymentsListRequestStatus
|
@@ -28,6 +30,7 @@ class WorkflowDeploymentsClient:
|
|
28
30
|
offset: typing.Optional[int] = None,
|
29
31
|
ordering: typing.Optional[str] = None,
|
30
32
|
status: typing.Optional[WorkflowDeploymentsListRequestStatus] = None,
|
33
|
+
request_options: typing.Optional[RequestOptions] = None,
|
31
34
|
) -> PaginatedSlimWorkflowDeploymentList:
|
32
35
|
"""
|
33
36
|
Parameters:
|
@@ -38,6 +41,8 @@ class WorkflowDeploymentsClient:
|
|
38
41
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
39
42
|
|
40
43
|
- status: typing.Optional[WorkflowDeploymentsListRequestStatus]. status
|
44
|
+
|
45
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
41
46
|
---
|
42
47
|
from vellum.client import Vellum
|
43
48
|
|
@@ -49,9 +54,34 @@ class WorkflowDeploymentsClient:
|
|
49
54
|
_response = self._client_wrapper.httpx_client.request(
|
50
55
|
"GET",
|
51
56
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/workflow-deployments"),
|
52
|
-
params=
|
53
|
-
|
54
|
-
|
57
|
+
params=jsonable_encoder(
|
58
|
+
remove_none_from_dict(
|
59
|
+
{
|
60
|
+
"limit": limit,
|
61
|
+
"offset": offset,
|
62
|
+
"ordering": ordering,
|
63
|
+
"status": status,
|
64
|
+
**(
|
65
|
+
request_options.get("additional_query_parameters", {})
|
66
|
+
if request_options is not None
|
67
|
+
else {}
|
68
|
+
),
|
69
|
+
}
|
70
|
+
)
|
71
|
+
),
|
72
|
+
headers=jsonable_encoder(
|
73
|
+
remove_none_from_dict(
|
74
|
+
{
|
75
|
+
**self._client_wrapper.get_headers(),
|
76
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
77
|
+
}
|
78
|
+
)
|
79
|
+
),
|
80
|
+
timeout=request_options.get("timeout_in_seconds")
|
81
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
82
|
+
else self._client_wrapper.get_timeout(),
|
83
|
+
retries=0,
|
84
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
55
85
|
)
|
56
86
|
if 200 <= _response.status_code < 300:
|
57
87
|
return pydantic.parse_obj_as(PaginatedSlimWorkflowDeploymentList, _response.json()) # type: ignore
|
@@ -61,12 +91,14 @@ class WorkflowDeploymentsClient:
|
|
61
91
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
62
92
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
63
93
|
|
64
|
-
def retrieve(self, id: str) -> WorkflowDeploymentRead:
|
94
|
+
def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> WorkflowDeploymentRead:
|
65
95
|
"""
|
66
96
|
Used to retrieve a workflow deployment given its ID or name.
|
67
97
|
|
68
98
|
Parameters:
|
69
99
|
- id: str. Either the Workflow Deployment's ID or its unique name
|
100
|
+
|
101
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
70
102
|
---
|
71
103
|
from vellum.client import Vellum
|
72
104
|
|
@@ -79,9 +111,25 @@ class WorkflowDeploymentsClient:
|
|
79
111
|
"""
|
80
112
|
_response = self._client_wrapper.httpx_client.request(
|
81
113
|
"GET",
|
82
|
-
urllib.parse.urljoin(
|
83
|
-
|
84
|
-
|
114
|
+
urllib.parse.urljoin(
|
115
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/workflow-deployments/{jsonable_encoder(id)}"
|
116
|
+
),
|
117
|
+
params=jsonable_encoder(
|
118
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
119
|
+
),
|
120
|
+
headers=jsonable_encoder(
|
121
|
+
remove_none_from_dict(
|
122
|
+
{
|
123
|
+
**self._client_wrapper.get_headers(),
|
124
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
125
|
+
}
|
126
|
+
)
|
127
|
+
),
|
128
|
+
timeout=request_options.get("timeout_in_seconds")
|
129
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
130
|
+
else self._client_wrapper.get_timeout(),
|
131
|
+
retries=0,
|
132
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
85
133
|
)
|
86
134
|
if 200 <= _response.status_code < 300:
|
87
135
|
return pydantic.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
@@ -103,6 +151,7 @@ class AsyncWorkflowDeploymentsClient:
|
|
103
151
|
offset: typing.Optional[int] = None,
|
104
152
|
ordering: typing.Optional[str] = None,
|
105
153
|
status: typing.Optional[WorkflowDeploymentsListRequestStatus] = None,
|
154
|
+
request_options: typing.Optional[RequestOptions] = None,
|
106
155
|
) -> PaginatedSlimWorkflowDeploymentList:
|
107
156
|
"""
|
108
157
|
Parameters:
|
@@ -113,6 +162,8 @@ class AsyncWorkflowDeploymentsClient:
|
|
113
162
|
- ordering: typing.Optional[str]. Which field to use when ordering the results.
|
114
163
|
|
115
164
|
- status: typing.Optional[WorkflowDeploymentsListRequestStatus]. status
|
165
|
+
|
166
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
116
167
|
---
|
117
168
|
from vellum.client import AsyncVellum
|
118
169
|
|
@@ -124,9 +175,34 @@ class AsyncWorkflowDeploymentsClient:
|
|
124
175
|
_response = await self._client_wrapper.httpx_client.request(
|
125
176
|
"GET",
|
126
177
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/workflow-deployments"),
|
127
|
-
params=
|
128
|
-
|
129
|
-
|
178
|
+
params=jsonable_encoder(
|
179
|
+
remove_none_from_dict(
|
180
|
+
{
|
181
|
+
"limit": limit,
|
182
|
+
"offset": offset,
|
183
|
+
"ordering": ordering,
|
184
|
+
"status": status,
|
185
|
+
**(
|
186
|
+
request_options.get("additional_query_parameters", {})
|
187
|
+
if request_options is not None
|
188
|
+
else {}
|
189
|
+
),
|
190
|
+
}
|
191
|
+
)
|
192
|
+
),
|
193
|
+
headers=jsonable_encoder(
|
194
|
+
remove_none_from_dict(
|
195
|
+
{
|
196
|
+
**self._client_wrapper.get_headers(),
|
197
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
198
|
+
}
|
199
|
+
)
|
200
|
+
),
|
201
|
+
timeout=request_options.get("timeout_in_seconds")
|
202
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
203
|
+
else self._client_wrapper.get_timeout(),
|
204
|
+
retries=0,
|
205
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
130
206
|
)
|
131
207
|
if 200 <= _response.status_code < 300:
|
132
208
|
return pydantic.parse_obj_as(PaginatedSlimWorkflowDeploymentList, _response.json()) # type: ignore
|
@@ -136,12 +212,16 @@ class AsyncWorkflowDeploymentsClient:
|
|
136
212
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
137
213
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
138
214
|
|
139
|
-
async def retrieve(
|
215
|
+
async def retrieve(
|
216
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
217
|
+
) -> WorkflowDeploymentRead:
|
140
218
|
"""
|
141
219
|
Used to retrieve a workflow deployment given its ID or name.
|
142
220
|
|
143
221
|
Parameters:
|
144
222
|
- id: str. Either the Workflow Deployment's ID or its unique name
|
223
|
+
|
224
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
145
225
|
---
|
146
226
|
from vellum.client import AsyncVellum
|
147
227
|
|
@@ -154,9 +234,25 @@ class AsyncWorkflowDeploymentsClient:
|
|
154
234
|
"""
|
155
235
|
_response = await self._client_wrapper.httpx_client.request(
|
156
236
|
"GET",
|
157
|
-
urllib.parse.urljoin(
|
158
|
-
|
159
|
-
|
237
|
+
urllib.parse.urljoin(
|
238
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/workflow-deployments/{jsonable_encoder(id)}"
|
239
|
+
),
|
240
|
+
params=jsonable_encoder(
|
241
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
242
|
+
),
|
243
|
+
headers=jsonable_encoder(
|
244
|
+
remove_none_from_dict(
|
245
|
+
{
|
246
|
+
**self._client_wrapper.get_headers(),
|
247
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
248
|
+
}
|
249
|
+
)
|
250
|
+
),
|
251
|
+
timeout=request_options.get("timeout_in_seconds")
|
252
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
253
|
+
else self._client_wrapper.get_timeout(),
|
254
|
+
retries=0,
|
255
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
160
256
|
)
|
161
257
|
if 200 <= _response.status_code < 300:
|
162
258
|
return pydantic.parse_obj_as(WorkflowDeploymentRead, _response.json()) # type: ignore
|
vellum/types/__init__.py
CHANGED
@@ -49,16 +49,20 @@ from .chat_message_content_request import (
|
|
49
49
|
)
|
50
50
|
from .chat_message_request import ChatMessageRequest
|
51
51
|
from .chat_message_role import ChatMessageRole
|
52
|
+
from .code_execution_node_array_result import CodeExecutionNodeArrayResult
|
52
53
|
from .code_execution_node_chat_history_result import CodeExecutionNodeChatHistoryResult
|
53
54
|
from .code_execution_node_error_result import CodeExecutionNodeErrorResult
|
55
|
+
from .code_execution_node_function_call_result import CodeExecutionNodeFunctionCallResult
|
54
56
|
from .code_execution_node_json_result import CodeExecutionNodeJsonResult
|
55
57
|
from .code_execution_node_number_result import CodeExecutionNodeNumberResult
|
56
58
|
from .code_execution_node_result import CodeExecutionNodeResult
|
57
59
|
from .code_execution_node_result_data import CodeExecutionNodeResultData
|
58
60
|
from .code_execution_node_result_output import (
|
59
61
|
CodeExecutionNodeResultOutput,
|
62
|
+
CodeExecutionNodeResultOutput_Array,
|
60
63
|
CodeExecutionNodeResultOutput_ChatHistory,
|
61
64
|
CodeExecutionNodeResultOutput_Error,
|
65
|
+
CodeExecutionNodeResultOutput_FunctionCall,
|
62
66
|
CodeExecutionNodeResultOutput_Json,
|
63
67
|
CodeExecutionNodeResultOutput_Number,
|
64
68
|
CodeExecutionNodeResultOutput_SearchResults,
|
@@ -185,6 +189,7 @@ from .named_test_case_variable_value_request import (
|
|
185
189
|
from .node_input_compiled_array_value import NodeInputCompiledArrayValue
|
186
190
|
from .node_input_compiled_chat_history_value import NodeInputCompiledChatHistoryValue
|
187
191
|
from .node_input_compiled_error_value import NodeInputCompiledErrorValue
|
192
|
+
from .node_input_compiled_function_call import NodeInputCompiledFunctionCall
|
188
193
|
from .node_input_compiled_json_value import NodeInputCompiledJsonValue
|
189
194
|
from .node_input_compiled_number_value import NodeInputCompiledNumberValue
|
190
195
|
from .node_input_compiled_search_results_value import NodeInputCompiledSearchResultsValue
|
@@ -194,6 +199,7 @@ from .node_input_variable_compiled_value import (
|
|
194
199
|
NodeInputVariableCompiledValue_Array,
|
195
200
|
NodeInputVariableCompiledValue_ChatHistory,
|
196
201
|
NodeInputVariableCompiledValue_Error,
|
202
|
+
NodeInputVariableCompiledValue_FunctionCall,
|
197
203
|
NodeInputVariableCompiledValue_Json,
|
198
204
|
NodeInputVariableCompiledValue_Number,
|
199
205
|
NodeInputVariableCompiledValue_SearchResults,
|
@@ -311,16 +317,20 @@ from .submit_workflow_execution_actual_request import (
|
|
311
317
|
)
|
312
318
|
from .subworkflow_enum import SubworkflowEnum
|
313
319
|
from .subworkflow_node_result import SubworkflowNodeResult
|
320
|
+
from .templating_node_array_result import TemplatingNodeArrayResult
|
314
321
|
from .templating_node_chat_history_result import TemplatingNodeChatHistoryResult
|
315
322
|
from .templating_node_error_result import TemplatingNodeErrorResult
|
323
|
+
from .templating_node_function_call_result import TemplatingNodeFunctionCallResult
|
316
324
|
from .templating_node_json_result import TemplatingNodeJsonResult
|
317
325
|
from .templating_node_number_result import TemplatingNodeNumberResult
|
318
326
|
from .templating_node_result import TemplatingNodeResult
|
319
327
|
from .templating_node_result_data import TemplatingNodeResultData
|
320
328
|
from .templating_node_result_output import (
|
321
329
|
TemplatingNodeResultOutput,
|
330
|
+
TemplatingNodeResultOutput_Array,
|
322
331
|
TemplatingNodeResultOutput_ChatHistory,
|
323
332
|
TemplatingNodeResultOutput_Error,
|
333
|
+
TemplatingNodeResultOutput_FunctionCall,
|
324
334
|
TemplatingNodeResultOutput_Json,
|
325
335
|
TemplatingNodeResultOutput_Number,
|
326
336
|
TemplatingNodeResultOutput_SearchResults,
|
@@ -551,15 +561,19 @@ __all__ = [
|
|
551
561
|
"ChatMessageContent_String",
|
552
562
|
"ChatMessageRequest",
|
553
563
|
"ChatMessageRole",
|
564
|
+
"CodeExecutionNodeArrayResult",
|
554
565
|
"CodeExecutionNodeChatHistoryResult",
|
555
566
|
"CodeExecutionNodeErrorResult",
|
567
|
+
"CodeExecutionNodeFunctionCallResult",
|
556
568
|
"CodeExecutionNodeJsonResult",
|
557
569
|
"CodeExecutionNodeNumberResult",
|
558
570
|
"CodeExecutionNodeResult",
|
559
571
|
"CodeExecutionNodeResultData",
|
560
572
|
"CodeExecutionNodeResultOutput",
|
573
|
+
"CodeExecutionNodeResultOutput_Array",
|
561
574
|
"CodeExecutionNodeResultOutput_ChatHistory",
|
562
575
|
"CodeExecutionNodeResultOutput_Error",
|
576
|
+
"CodeExecutionNodeResultOutput_FunctionCall",
|
563
577
|
"CodeExecutionNodeResultOutput_Json",
|
564
578
|
"CodeExecutionNodeResultOutput_Number",
|
565
579
|
"CodeExecutionNodeResultOutput_SearchResults",
|
@@ -677,6 +691,7 @@ __all__ = [
|
|
677
691
|
"NodeInputCompiledArrayValue",
|
678
692
|
"NodeInputCompiledChatHistoryValue",
|
679
693
|
"NodeInputCompiledErrorValue",
|
694
|
+
"NodeInputCompiledFunctionCall",
|
680
695
|
"NodeInputCompiledJsonValue",
|
681
696
|
"NodeInputCompiledNumberValue",
|
682
697
|
"NodeInputCompiledSearchResultsValue",
|
@@ -685,6 +700,7 @@ __all__ = [
|
|
685
700
|
"NodeInputVariableCompiledValue_Array",
|
686
701
|
"NodeInputVariableCompiledValue_ChatHistory",
|
687
702
|
"NodeInputVariableCompiledValue_Error",
|
703
|
+
"NodeInputVariableCompiledValue_FunctionCall",
|
688
704
|
"NodeInputVariableCompiledValue_Json",
|
689
705
|
"NodeInputVariableCompiledValue_Number",
|
690
706
|
"NodeInputVariableCompiledValue_SearchResults",
|
@@ -793,15 +809,19 @@ __all__ = [
|
|
793
809
|
"SubmitWorkflowExecutionActualRequest_String",
|
794
810
|
"SubworkflowEnum",
|
795
811
|
"SubworkflowNodeResult",
|
812
|
+
"TemplatingNodeArrayResult",
|
796
813
|
"TemplatingNodeChatHistoryResult",
|
797
814
|
"TemplatingNodeErrorResult",
|
815
|
+
"TemplatingNodeFunctionCallResult",
|
798
816
|
"TemplatingNodeJsonResult",
|
799
817
|
"TemplatingNodeNumberResult",
|
800
818
|
"TemplatingNodeResult",
|
801
819
|
"TemplatingNodeResultData",
|
802
820
|
"TemplatingNodeResultOutput",
|
821
|
+
"TemplatingNodeResultOutput_Array",
|
803
822
|
"TemplatingNodeResultOutput_ChatHistory",
|
804
823
|
"TemplatingNodeResultOutput_Error",
|
824
|
+
"TemplatingNodeResultOutput_FunctionCall",
|
805
825
|
"TemplatingNodeResultOutput_Json",
|
806
826
|
"TemplatingNodeResultOutput_Number",
|
807
827
|
"TemplatingNodeResultOutput_SearchResults",
|
vellum/types/api_node_result.py
CHANGED
@@ -13,9 +13,9 @@ except ImportError:
|
|
13
13
|
|
14
14
|
class ApiNodeResultData(pydantic.BaseModel):
|
15
15
|
text_output_id: str
|
16
|
-
text: typing.Optional[str]
|
16
|
+
text: typing.Optional[str] = None
|
17
17
|
json_output_id: str
|
18
|
-
json_: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(alias="json")
|
18
|
+
json_: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(alias="json", default=None)
|
19
19
|
status_code_output_id: str
|
20
20
|
status_code: int
|
21
21
|
|
@@ -31,4 +31,6 @@ class ApiNodeResultData(pydantic.BaseModel):
|
|
31
31
|
frozen = True
|
32
32
|
smart_union = True
|
33
33
|
allow_population_by_field_name = True
|
34
|
+
populate_by_name = True
|
35
|
+
extra = pydantic.Extra.allow
|
34
36
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -4,38 +4,39 @@ from __future__ import annotations
|
|
4
4
|
|
5
5
|
import typing
|
6
6
|
|
7
|
-
import typing_extensions
|
8
|
-
|
9
7
|
from .function_call_chat_message_content import FunctionCallChatMessageContent
|
10
8
|
from .image_chat_message_content import ImageChatMessageContent
|
11
9
|
from .string_chat_message_content import StringChatMessageContent
|
12
10
|
|
13
11
|
|
14
12
|
class ArrayChatMessageContentItem_String(StringChatMessageContent):
|
15
|
-
type:
|
13
|
+
type: typing.Literal["STRING"] = "STRING"
|
16
14
|
|
17
15
|
class Config:
|
18
16
|
frozen = True
|
19
17
|
smart_union = True
|
20
18
|
allow_population_by_field_name = True
|
19
|
+
populate_by_name = True
|
21
20
|
|
22
21
|
|
23
22
|
class ArrayChatMessageContentItem_FunctionCall(FunctionCallChatMessageContent):
|
24
|
-
type:
|
23
|
+
type: typing.Literal["FUNCTION_CALL"] = "FUNCTION_CALL"
|
25
24
|
|
26
25
|
class Config:
|
27
26
|
frozen = True
|
28
27
|
smart_union = True
|
29
28
|
allow_population_by_field_name = True
|
29
|
+
populate_by_name = True
|
30
30
|
|
31
31
|
|
32
32
|
class ArrayChatMessageContentItem_Image(ImageChatMessageContent):
|
33
|
-
type:
|
33
|
+
type: typing.Literal["IMAGE"] = "IMAGE"
|
34
34
|
|
35
35
|
class Config:
|
36
36
|
frozen = True
|
37
37
|
smart_union = True
|
38
38
|
allow_population_by_field_name = True
|
39
|
+
populate_by_name = True
|
39
40
|
|
40
41
|
|
41
42
|
ArrayChatMessageContentItem = typing.Union[
|
@@ -4,38 +4,39 @@ from __future__ import annotations
|
|
4
4
|
|
5
5
|
import typing
|
6
6
|
|
7
|
-
import typing_extensions
|
8
|
-
|
9
7
|
from .function_call_chat_message_content_request import FunctionCallChatMessageContentRequest
|
10
8
|
from .image_chat_message_content_request import ImageChatMessageContentRequest
|
11
9
|
from .string_chat_message_content_request import StringChatMessageContentRequest
|
12
10
|
|
13
11
|
|
14
12
|
class ArrayChatMessageContentItemRequest_String(StringChatMessageContentRequest):
|
15
|
-
type:
|
13
|
+
type: typing.Literal["STRING"] = "STRING"
|
16
14
|
|
17
15
|
class Config:
|
18
16
|
frozen = True
|
19
17
|
smart_union = True
|
20
18
|
allow_population_by_field_name = True
|
19
|
+
populate_by_name = True
|
21
20
|
|
22
21
|
|
23
22
|
class ArrayChatMessageContentItemRequest_FunctionCall(FunctionCallChatMessageContentRequest):
|
24
|
-
type:
|
23
|
+
type: typing.Literal["FUNCTION_CALL"] = "FUNCTION_CALL"
|
25
24
|
|
26
25
|
class Config:
|
27
26
|
frozen = True
|
28
27
|
smart_union = True
|
29
28
|
allow_population_by_field_name = True
|
29
|
+
populate_by_name = True
|
30
30
|
|
31
31
|
|
32
32
|
class ArrayChatMessageContentItemRequest_Image(ImageChatMessageContentRequest):
|
33
|
-
type:
|
33
|
+
type: typing.Literal["IMAGE"] = "IMAGE"
|
34
34
|
|
35
35
|
class Config:
|
36
36
|
frozen = True
|
37
37
|
smart_union = True
|
38
38
|
allow_population_by_field_name = True
|
39
|
+
populate_by_name = True
|
39
40
|
|
40
41
|
|
41
42
|
ArrayChatMessageContentItemRequest = typing.Union[
|
vellum/types/array_enum.py
CHANGED
@@ -4,8 +4,6 @@ from __future__ import annotations
|
|
4
4
|
|
5
5
|
import typing
|
6
6
|
|
7
|
-
import typing_extensions
|
8
|
-
|
9
7
|
from .chat_history_variable_value import ChatHistoryVariableValue
|
10
8
|
from .error_variable_value import ErrorVariableValue
|
11
9
|
from .function_call_variable_value import FunctionCallVariableValue
|
@@ -17,75 +15,83 @@ from .string_variable_value import StringVariableValue
|
|
17
15
|
|
18
16
|
|
19
17
|
class ArrayVariableValueItem_String(StringVariableValue):
|
20
|
-
type:
|
18
|
+
type: typing.Literal["STRING"] = "STRING"
|
21
19
|
|
22
20
|
class Config:
|
23
21
|
frozen = True
|
24
22
|
smart_union = True
|
25
23
|
allow_population_by_field_name = True
|
24
|
+
populate_by_name = True
|
26
25
|
|
27
26
|
|
28
27
|
class ArrayVariableValueItem_Number(NumberVariableValue):
|
29
|
-
type:
|
28
|
+
type: typing.Literal["NUMBER"] = "NUMBER"
|
30
29
|
|
31
30
|
class Config:
|
32
31
|
frozen = True
|
33
32
|
smart_union = True
|
34
33
|
allow_population_by_field_name = True
|
34
|
+
populate_by_name = True
|
35
35
|
|
36
36
|
|
37
37
|
class ArrayVariableValueItem_Json(JsonVariableValue):
|
38
|
-
type:
|
38
|
+
type: typing.Literal["JSON"] = "JSON"
|
39
39
|
|
40
40
|
class Config:
|
41
41
|
frozen = True
|
42
42
|
smart_union = True
|
43
43
|
allow_population_by_field_name = True
|
44
|
+
populate_by_name = True
|
44
45
|
|
45
46
|
|
46
47
|
class ArrayVariableValueItem_ChatHistory(ChatHistoryVariableValue):
|
47
|
-
type:
|
48
|
+
type: typing.Literal["CHAT_HISTORY"] = "CHAT_HISTORY"
|
48
49
|
|
49
50
|
class Config:
|
50
51
|
frozen = True
|
51
52
|
smart_union = True
|
52
53
|
allow_population_by_field_name = True
|
54
|
+
populate_by_name = True
|
53
55
|
|
54
56
|
|
55
57
|
class ArrayVariableValueItem_SearchResults(SearchResultsVariableValue):
|
56
|
-
type:
|
58
|
+
type: typing.Literal["SEARCH_RESULTS"] = "SEARCH_RESULTS"
|
57
59
|
|
58
60
|
class Config:
|
59
61
|
frozen = True
|
60
62
|
smart_union = True
|
61
63
|
allow_population_by_field_name = True
|
64
|
+
populate_by_name = True
|
62
65
|
|
63
66
|
|
64
67
|
class ArrayVariableValueItem_Error(ErrorVariableValue):
|
65
|
-
type:
|
68
|
+
type: typing.Literal["ERROR"] = "ERROR"
|
66
69
|
|
67
70
|
class Config:
|
68
71
|
frozen = True
|
69
72
|
smart_union = True
|
70
73
|
allow_population_by_field_name = True
|
74
|
+
populate_by_name = True
|
71
75
|
|
72
76
|
|
73
77
|
class ArrayVariableValueItem_FunctionCall(FunctionCallVariableValue):
|
74
|
-
type:
|
78
|
+
type: typing.Literal["FUNCTION_CALL"] = "FUNCTION_CALL"
|
75
79
|
|
76
80
|
class Config:
|
77
81
|
frozen = True
|
78
82
|
smart_union = True
|
79
83
|
allow_population_by_field_name = True
|
84
|
+
populate_by_name = True
|
80
85
|
|
81
86
|
|
82
87
|
class ArrayVariableValueItem_Image(ImageVariableValue):
|
83
|
-
type:
|
88
|
+
type: typing.Literal["IMAGE"] = "IMAGE"
|
84
89
|
|
85
90
|
class Config:
|
86
91
|
frozen = True
|
87
92
|
smart_union = True
|
88
93
|
allow_population_by_field_name = True
|
94
|
+
populate_by_name = True
|
89
95
|
|
90
96
|
|
91
97
|
ArrayVariableValueItem = typing.Union[
|
@@ -17,7 +17,11 @@ class ChatHistoryInputRequest(pydantic.BaseModel):
|
|
17
17
|
A user input representing a list of chat messages
|
18
18
|
"""
|
19
19
|
|
20
|
-
name: str = pydantic.Field(
|
20
|
+
name: str = pydantic.Field()
|
21
|
+
"""
|
22
|
+
The variable's name, as defined in the deployment.
|
23
|
+
"""
|
24
|
+
|
21
25
|
value: typing.List[ChatMessageRequest]
|
22
26
|
|
23
27
|
def json(self, **kwargs: typing.Any) -> str:
|
@@ -31,4 +35,5 @@ class ChatHistoryInputRequest(pydantic.BaseModel):
|
|
31
35
|
class Config:
|
32
36
|
frozen = True
|
33
37
|
smart_union = True
|
38
|
+
extra = pydantic.Extra.allow
|
34
39
|
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -13,7 +13,7 @@ except ImportError:
|
|
13
13
|
|
14
14
|
|
15
15
|
class ChatHistoryVariableValue(pydantic.BaseModel):
|
16
|
-
value: typing.Optional[typing.List[ChatMessage]]
|
16
|
+
value: typing.Optional[typing.List[ChatMessage]] = None
|
17
17
|
|
18
18
|
def json(self, **kwargs: typing.Any) -> str:
|
19
19
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -26,4 +26,5 @@ class ChatHistoryVariableValue(pydantic.BaseModel):
|
|
26
26
|
class Config:
|
27
27
|
frozen = True
|
28
28
|
smart_union = True
|
29
|
+
extra = pydantic.Extra.allow
|
29
30
|
json_encoders = {dt.datetime: serialize_datetime}
|
vellum/types/chat_message.py
CHANGED
@@ -14,12 +14,13 @@ except ImportError:
|
|
14
14
|
|
15
15
|
|
16
16
|
class ChatMessage(pydantic.BaseModel):
|
17
|
-
text: typing.Optional[str]
|
17
|
+
text: typing.Optional[str] = None
|
18
18
|
role: ChatMessageRole
|
19
|
-
content: typing.Optional[ChatMessageContent]
|
20
|
-
source: typing.Optional[str] = pydantic.Field(
|
21
|
-
|
22
|
-
|
19
|
+
content: typing.Optional[ChatMessageContent] = None
|
20
|
+
source: typing.Optional[str] = pydantic.Field(default=None)
|
21
|
+
"""
|
22
|
+
An optional identifier representing who or what generated this message.
|
23
|
+
"""
|
23
24
|
|
24
25
|
def json(self, **kwargs: typing.Any) -> str:
|
25
26
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
@@ -32,4 +33,5 @@ class ChatMessage(pydantic.BaseModel):
|
|
32
33
|
class Config:
|
33
34
|
frozen = True
|
34
35
|
smart_union = True
|
36
|
+
extra = pydantic.Extra.allow
|
35
37
|
json_encoders = {dt.datetime: serialize_datetime}
|