vellum-ai 1.11.2__py3-none-any.whl → 1.13.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of vellum-ai might be problematic. Click here for more details.
- vellum/__init__.py +18 -0
- vellum/client/README.md +1 -1
- vellum/client/core/client_wrapper.py +2 -2
- vellum/client/core/force_multipart.py +4 -2
- vellum/client/core/http_response.py +1 -1
- vellum/client/core/pydantic_utilities.py +7 -4
- vellum/client/errors/too_many_requests_error.py +1 -2
- vellum/client/reference.md +677 -76
- vellum/client/resources/container_images/client.py +299 -0
- vellum/client/resources/container_images/raw_client.py +286 -0
- vellum/client/resources/documents/client.py +20 -10
- vellum/client/resources/documents/raw_client.py +20 -10
- vellum/client/resources/events/raw_client.py +4 -4
- vellum/client/resources/integration_auth_configs/client.py +2 -0
- vellum/client/resources/integration_auth_configs/raw_client.py +2 -0
- vellum/client/resources/integration_providers/client.py +28 -2
- vellum/client/resources/integration_providers/raw_client.py +24 -0
- vellum/client/resources/integrations/client.py +52 -4
- vellum/client/resources/integrations/raw_client.py +61 -0
- vellum/client/resources/workflow_deployments/client.py +156 -0
- vellum/client/resources/workflow_deployments/raw_client.py +334 -0
- vellum/client/resources/workflows/client.py +212 -8
- vellum/client/resources/workflows/raw_client.py +343 -6
- vellum/client/types/__init__.py +18 -0
- vellum/client/types/api_actor_type_enum.py +1 -1
- vellum/client/types/check_workflow_execution_status_error.py +21 -0
- vellum/client/types/check_workflow_execution_status_response.py +29 -0
- vellum/client/types/code_execution_package_request.py +21 -0
- vellum/client/types/composio_execute_tool_request.py +5 -0
- vellum/client/types/composio_tool_definition.py +1 -0
- vellum/client/types/container_image_build_config.py +1 -0
- vellum/client/types/container_image_container_image_tag.py +1 -0
- vellum/client/types/dataset_row_push_request.py +3 -0
- vellum/client/types/document_document_to_document_index.py +1 -0
- vellum/client/types/integration_name.py +24 -0
- vellum/client/types/node_execution_fulfilled_body.py +1 -0
- vellum/client/types/node_execution_log_body.py +24 -0
- vellum/client/types/node_execution_log_event.py +47 -0
- vellum/client/types/prompt_deployment_release_prompt_deployment.py +1 -0
- vellum/client/types/runner_config_request.py +24 -0
- vellum/client/types/severity_enum.py +5 -0
- vellum/client/types/slim_composio_tool_definition.py +1 -0
- vellum/client/types/slim_document_document_to_document_index.py +2 -0
- vellum/client/types/type_checker_enum.py +5 -0
- vellum/client/types/vellum_audio.py +5 -1
- vellum/client/types/vellum_audio_request.py +5 -1
- vellum/client/types/vellum_document.py +5 -1
- vellum/client/types/vellum_document_request.py +5 -1
- vellum/client/types/vellum_image.py +5 -1
- vellum/client/types/vellum_image_request.py +5 -1
- vellum/client/types/vellum_node_execution_event.py +2 -0
- vellum/client/types/vellum_variable.py +5 -0
- vellum/client/types/vellum_variable_extensions.py +1 -0
- vellum/client/types/vellum_variable_type.py +1 -0
- vellum/client/types/vellum_video.py +5 -1
- vellum/client/types/vellum_video_request.py +5 -1
- vellum/client/types/workflow_deployment_release_workflow_deployment.py +1 -0
- vellum/client/types/workflow_event.py +2 -0
- vellum/client/types/workflow_execution_fulfilled_body.py +1 -0
- vellum/client/types/workflow_result_event_output_data_array.py +1 -1
- vellum/client/types/workflow_result_event_output_data_chat_history.py +1 -1
- vellum/client/types/workflow_result_event_output_data_error.py +1 -1
- vellum/client/types/workflow_result_event_output_data_function_call.py +1 -1
- vellum/client/types/workflow_result_event_output_data_json.py +1 -1
- vellum/client/types/workflow_result_event_output_data_number.py +1 -1
- vellum/client/types/workflow_result_event_output_data_search_results.py +1 -1
- vellum/client/types/workflow_result_event_output_data_string.py +1 -1
- vellum/client/types/workflow_sandbox_execute_node_response.py +8 -0
- vellum/plugins/vellum_mypy.py +37 -2
- vellum/types/check_workflow_execution_status_error.py +3 -0
- vellum/types/check_workflow_execution_status_response.py +3 -0
- vellum/types/code_execution_package_request.py +3 -0
- vellum/types/node_execution_log_body.py +3 -0
- vellum/types/node_execution_log_event.py +3 -0
- vellum/types/runner_config_request.py +3 -0
- vellum/types/severity_enum.py +3 -0
- vellum/types/type_checker_enum.py +3 -0
- vellum/types/workflow_sandbox_execute_node_response.py +3 -0
- vellum/utils/files/mixin.py +26 -0
- vellum/utils/files/tests/test_mixin.py +62 -0
- vellum/utils/tests/test_vellum_client.py +95 -0
- vellum/utils/uuid.py +19 -2
- vellum/utils/vellum_client.py +10 -3
- vellum/workflows/__init__.py +7 -1
- vellum/workflows/descriptors/base.py +86 -0
- vellum/workflows/descriptors/tests/test_utils.py +9 -0
- vellum/workflows/errors/tests/__init__.py +0 -0
- vellum/workflows/errors/tests/test_types.py +52 -0
- vellum/workflows/errors/types.py +1 -0
- vellum/workflows/events/node.py +24 -0
- vellum/workflows/events/tests/test_event.py +123 -0
- vellum/workflows/events/types.py +2 -1
- vellum/workflows/events/workflow.py +28 -2
- vellum/workflows/expressions/add.py +3 -0
- vellum/workflows/expressions/tests/test_add.py +24 -0
- vellum/workflows/graph/graph.py +26 -5
- vellum/workflows/graph/tests/test_graph.py +228 -1
- vellum/workflows/inputs/base.py +22 -6
- vellum/workflows/inputs/dataset_row.py +121 -16
- vellum/workflows/inputs/tests/test_inputs.py +3 -3
- vellum/workflows/integrations/tests/test_vellum_integration_service.py +84 -0
- vellum/workflows/integrations/vellum_integration_service.py +12 -1
- vellum/workflows/loaders/base.py +2 -0
- vellum/workflows/nodes/bases/base.py +37 -16
- vellum/workflows/nodes/bases/tests/test_base_node.py +104 -1
- vellum/workflows/nodes/core/inline_subworkflow_node/node.py +1 -0
- vellum/workflows/nodes/core/inline_subworkflow_node/tests/test_node.py +1 -1
- vellum/workflows/nodes/core/map_node/node.py +7 -5
- vellum/workflows/nodes/core/map_node/tests/test_node.py +33 -0
- vellum/workflows/nodes/core/retry_node/node.py +1 -0
- vellum/workflows/nodes/core/try_node/node.py +1 -0
- vellum/workflows/nodes/displayable/api_node/node.py +3 -2
- vellum/workflows/nodes/displayable/api_node/tests/test_api_node.py +38 -0
- vellum/workflows/nodes/displayable/bases/api_node/node.py +1 -1
- vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py +18 -1
- vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +109 -2
- vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +13 -2
- vellum/workflows/nodes/displayable/code_execution_node/node.py +9 -15
- vellum/workflows/nodes/displayable/code_execution_node/tests/test_node.py +65 -24
- vellum/workflows/nodes/displayable/code_execution_node/utils.py +3 -0
- vellum/workflows/nodes/displayable/final_output_node/node.py +24 -69
- vellum/workflows/nodes/displayable/final_output_node/tests/test_node.py +53 -3
- vellum/workflows/nodes/displayable/note_node/node.py +4 -1
- vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +16 -5
- vellum/workflows/nodes/displayable/tests/test_text_prompt_deployment_node.py +47 -0
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +74 -34
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py +204 -8
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +92 -71
- vellum/workflows/nodes/mocks.py +47 -213
- vellum/workflows/nodes/tests/test_mocks.py +0 -177
- vellum/workflows/nodes/utils.py +23 -8
- vellum/workflows/outputs/base.py +36 -3
- vellum/workflows/references/environment_variable.py +1 -11
- vellum/workflows/references/lazy.py +8 -0
- vellum/workflows/references/state_value.py +24 -1
- vellum/workflows/references/tests/test_lazy.py +58 -0
- vellum/workflows/references/trigger.py +8 -3
- vellum/workflows/references/workflow_input.py +8 -0
- vellum/workflows/resolvers/resolver.py +13 -3
- vellum/workflows/resolvers/tests/test_resolver.py +31 -0
- vellum/workflows/runner/runner.py +159 -14
- vellum/workflows/runner/tests/__init__.py +0 -0
- vellum/workflows/runner/tests/test_runner.py +170 -0
- vellum/workflows/sandbox.py +7 -8
- vellum/workflows/state/base.py +89 -30
- vellum/workflows/state/context.py +74 -3
- vellum/workflows/state/tests/test_state.py +269 -1
- vellum/workflows/tests/test_dataset_row.py +8 -7
- vellum/workflows/tests/test_sandbox.py +97 -8
- vellum/workflows/triggers/__init__.py +2 -1
- vellum/workflows/triggers/base.py +160 -28
- vellum/workflows/triggers/chat_message.py +141 -0
- vellum/workflows/triggers/integration.py +12 -0
- vellum/workflows/triggers/manual.py +3 -1
- vellum/workflows/triggers/schedule.py +3 -1
- vellum/workflows/triggers/tests/test_chat_message.py +257 -0
- vellum/workflows/types/core.py +18 -0
- vellum/workflows/types/definition.py +6 -13
- vellum/workflows/types/generics.py +12 -0
- vellum/workflows/types/tests/test_utils.py +12 -0
- vellum/workflows/types/utils.py +32 -2
- vellum/workflows/types/workflow_metadata.py +124 -0
- vellum/workflows/utils/functions.py +152 -16
- vellum/workflows/utils/pydantic_schema.py +19 -1
- vellum/workflows/utils/tests/test_functions.py +123 -8
- vellum/workflows/utils/tests/test_validate.py +79 -0
- vellum/workflows/utils/tests/test_vellum_variables.py +62 -2
- vellum/workflows/utils/uuids.py +90 -0
- vellum/workflows/utils/validate.py +108 -0
- vellum/workflows/utils/vellum_variables.py +96 -16
- vellum/workflows/workflows/base.py +177 -35
- vellum/workflows/workflows/tests/test_base_workflow.py +51 -0
- {vellum_ai-1.11.2.dist-info → vellum_ai-1.13.5.dist-info}/METADATA +6 -1
- {vellum_ai-1.11.2.dist-info → vellum_ai-1.13.5.dist-info}/RECORD +274 -227
- vellum_cli/__init__.py +21 -0
- vellum_cli/config.py +16 -2
- vellum_cli/pull.py +2 -0
- vellum_cli/push.py +23 -10
- vellum_cli/tests/conftest.py +8 -13
- vellum_cli/tests/test_image_push.py +4 -11
- vellum_cli/tests/test_pull.py +83 -68
- vellum_cli/tests/test_push.py +251 -2
- vellum_ee/assets/node-definitions.json +225 -12
- vellum_ee/scripts/generate_node_definitions.py +15 -3
- vellum_ee/workflows/display/base.py +4 -3
- vellum_ee/workflows/display/nodes/base_node_display.py +44 -11
- vellum_ee/workflows/display/nodes/tests/test_base_node_display.py +93 -0
- vellum_ee/workflows/display/nodes/types.py +1 -0
- vellum_ee/workflows/display/nodes/vellum/__init__.py +0 -2
- vellum_ee/workflows/display/nodes/vellum/base_adornment_node.py +5 -2
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +10 -2
- vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +17 -14
- vellum_ee/workflows/display/nodes/vellum/map_node.py +2 -0
- vellum_ee/workflows/display/nodes/vellum/note_node.py +18 -3
- vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +37 -14
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +62 -2
- vellum_ee/workflows/display/nodes/vellum/tests/test_final_output_node.py +136 -0
- vellum_ee/workflows/display/nodes/vellum/tests/test_note_node.py +44 -7
- vellum_ee/workflows/display/nodes/vellum/tests/test_prompt_node.py +5 -13
- vellum_ee/workflows/display/nodes/vellum/tests/test_subworkflow_deployment_node.py +27 -17
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +145 -22
- vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +107 -2
- vellum_ee/workflows/display/nodes/vellum/utils.py +54 -12
- vellum_ee/workflows/display/tests/test_base_workflow_display.py +13 -16
- vellum_ee/workflows/display/tests/test_json_schema_validation.py +190 -0
- vellum_ee/workflows/display/tests/test_mocks.py +912 -0
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py +14 -2
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py +109 -0
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py +3 -0
- vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py +187 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py +34 -325
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +42 -393
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +13 -315
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_default_state_serialization.py +2 -122
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_error_node_serialization.py +24 -115
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_generic_node_serialization.py +4 -93
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +7 -80
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_prompt_node_serialization.py +9 -101
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +77 -308
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +62 -324
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py +3 -82
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +4 -142
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_search_node_serialization.py +1 -61
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_set_state_node_serialization.py +4 -4
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +205 -134
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_templating_node_serialization.py +34 -146
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +2 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_composio_serialization.py +8 -6
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_inline_workflow_serialization.py +137 -266
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_inline_workflow_tool_wrapper_serialization.py +84 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +55 -16
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_serialization.py +15 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_tool_wrapper_serialization.py +71 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_vellum_integration_serialization.py +119 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_workflow_deployment_serialization.py +1 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_try_node_serialization.py +0 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_chat_message_dict_reference_serialization.py +22 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_chat_message_trigger_serialization.py +412 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_code_tool_node_reference_error.py +106 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +9 -41
- vellum_ee/workflows/display/tests/workflow_serialization/test_duplicate_trigger_name_validation.py +208 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_final_output_node_not_referenced_by_workflow_outputs.py +45 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_infinite_loop_validation.py +66 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_int_input_serialization.py +40 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_integration_trigger_serialization.py +8 -14
- vellum_ee/workflows/display/tests/workflow_serialization/test_integration_trigger_validation.py +173 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_integration_trigger_with_entrypoint_node_id.py +16 -13
- vellum_ee/workflows/display/tests/workflow_serialization/test_list_vellum_document_serialization.py +5 -1
- vellum_ee/workflows/display/tests/workflow_serialization/test_manual_trigger_serialization.py +12 -2
- vellum_ee/workflows/display/tests/workflow_serialization/test_multi_trigger_same_node_serialization.py +111 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_no_triggers_no_entrypoint_validation.py +64 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_partial_workflow_meta_display_override.py +55 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_sandbox_dataset_mocks_serialization.py +268 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_sandbox_invalid_pdf_data_url.py +49 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_sandbox_validation_errors.py +112 -0
- vellum_ee/workflows/display/tests/workflow_serialization/test_scheduled_trigger_serialization.py +25 -16
- vellum_ee/workflows/display/tests/workflow_serialization/test_terminal_node_in_unused_graphs_serialization.py +53 -0
- vellum_ee/workflows/display/utils/exceptions.py +34 -0
- vellum_ee/workflows/display/utils/expressions.py +463 -52
- vellum_ee/workflows/display/utils/metadata.py +98 -33
- vellum_ee/workflows/display/utils/tests/test_metadata.py +31 -0
- vellum_ee/workflows/display/utils/triggers.py +153 -0
- vellum_ee/workflows/display/utils/vellum.py +59 -5
- vellum_ee/workflows/display/workflows/base_workflow_display.py +656 -254
- vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +26 -0
- vellum_ee/workflows/display/workflows/tests/test_workflow_display.py +77 -29
- vellum_ee/workflows/server/namespaces.py +18 -0
- vellum_ee/workflows/tests/test_display_meta.py +2 -0
- vellum_ee/workflows/tests/test_serialize_module.py +174 -7
- vellum_ee/workflows/tests/test_server.py +0 -3
- vellum_ee/workflows/display/nodes/vellum/function_node.py +0 -14
- {vellum_ai-1.11.2.dist-info → vellum_ai-1.13.5.dist-info}/LICENSE +0 -0
- {vellum_ai-1.11.2.dist-info → vellum_ai-1.13.5.dist-info}/WHEEL +0 -0
- {vellum_ai-1.11.2.dist-info → vellum_ai-1.13.5.dist-info}/entry_points.txt +0 -0
vellum_ee/workflows/display/tests/workflow_serialization/test_basic_api_node_serialization.py
CHANGED
|
@@ -56,336 +56,45 @@ def test_serialize_workflow(vellum_client):
|
|
|
56
56
|
|
|
57
57
|
# AND its raw data should be what we expect
|
|
58
58
|
workflow_raw_data = serialized_workflow["workflow_raw_data"]
|
|
59
|
-
assert len(workflow_raw_data["edges"]) == 4
|
|
60
|
-
assert len(workflow_raw_data["nodes"]) == 5
|
|
61
59
|
|
|
62
|
-
# AND
|
|
63
|
-
|
|
64
|
-
assert entrypoint_node == {
|
|
65
|
-
"id": "3a6b1467-5c83-4bcd-86a0-6415bc32d23b",
|
|
66
|
-
"type": "ENTRYPOINT",
|
|
67
|
-
"inputs": [],
|
|
68
|
-
"data": {"label": "Entrypoint Node", "source_handle_id": "8eaa7f02-25ff-4a00-9b0a-5185718d89b3"},
|
|
69
|
-
"display_data": {"position": {"x": 0.0, "y": -50.0}},
|
|
70
|
-
"base": None,
|
|
71
|
-
"definition": None,
|
|
72
|
-
}
|
|
60
|
+
# AND the API node should be serialized correctly
|
|
61
|
+
api_node = next(n for n in workflow_raw_data["nodes"] if (n.get("base") or {}).get("name") == "APINode")
|
|
73
62
|
|
|
74
|
-
api_node
|
|
75
|
-
assert
|
|
76
|
-
{
|
|
77
|
-
"id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
78
|
-
"type": "API",
|
|
79
|
-
"inputs": [
|
|
80
|
-
{
|
|
81
|
-
"id": "df921419-5ccb-4e1e-987f-b2349701b3db",
|
|
82
|
-
"key": "url",
|
|
83
|
-
"value": {
|
|
84
|
-
"rules": [
|
|
85
|
-
{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "https://api.vellum.ai"}}
|
|
86
|
-
],
|
|
87
|
-
"combinator": "OR",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"id": "327b4d34-2803-4782-8449-fda65b12a064",
|
|
92
|
-
"key": "method",
|
|
93
|
-
"value": {
|
|
94
|
-
"rules": [{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "POST"}}],
|
|
95
|
-
"combinator": "OR",
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"id": "470f5596-8fbd-4f34-af14-9b69b69dffcd",
|
|
100
|
-
"key": "body",
|
|
101
|
-
"value": {
|
|
102
|
-
"rules": [{"type": "CONSTANT_VALUE", "data": {"type": "JSON", "value": {"key": "value"}}}],
|
|
103
|
-
"combinator": "OR",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"id": "76fcf4b3-7e7f-4fc5-8065-18cb1c4c0225",
|
|
108
|
-
"key": "authorization_type",
|
|
109
|
-
"value": {
|
|
110
|
-
"rules": [{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "API_KEY"}}],
|
|
111
|
-
"combinator": "OR",
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id": "94e73208-63db-4511-b86e-9fa285cdd1ad",
|
|
116
|
-
"key": "bearer_token_value",
|
|
117
|
-
"value": {
|
|
118
|
-
"rules": [
|
|
119
|
-
{"type": "WORKSPACE_SECRET", "data": {"type": "STRING", "workspace_secret_id": None}}
|
|
120
|
-
],
|
|
121
|
-
"combinator": "OR",
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"id": "1b3f6dfc-2053-4536-898a-747e64cc1313",
|
|
126
|
-
"key": "api_key_header_key",
|
|
127
|
-
"value": {
|
|
128
|
-
"rules": [{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "CUSTOM_API_KEY"}}],
|
|
129
|
-
"combinator": "OR",
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"id": "7d728938-fd08-4224-81b4-5d5bc3d3bd57",
|
|
134
|
-
"key": "api_key_header_value",
|
|
135
|
-
"value": {
|
|
136
|
-
"rules": [
|
|
137
|
-
{
|
|
138
|
-
"type": "WORKSPACE_SECRET",
|
|
139
|
-
"data": {
|
|
140
|
-
"type": "STRING",
|
|
141
|
-
"workspace_secret_id": f"{workspace_secret_id}",
|
|
142
|
-
},
|
|
143
|
-
}
|
|
144
|
-
],
|
|
145
|
-
"combinator": "OR",
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"id": "416e4be7-f186-4ace-9619-637c54eeffb7",
|
|
150
|
-
"key": "additional_header_key",
|
|
151
|
-
"value": {
|
|
152
|
-
"rules": [{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "additional_header"}}],
|
|
153
|
-
"combinator": "OR",
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"id": "f2803619-eda1-4941-8d6a-288c87aca215",
|
|
158
|
-
"key": "additional_header_value",
|
|
159
|
-
"value": {
|
|
160
|
-
"rules": [
|
|
161
|
-
{"type": "CONSTANT_VALUE", "data": {"type": "STRING", "value": "additional header value"}}
|
|
162
|
-
],
|
|
163
|
-
"combinator": "OR",
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
"attributes": [
|
|
168
|
-
{
|
|
169
|
-
"id": "4377112c-8e3a-4636-adb4-8b0c0ddc71a9",
|
|
170
|
-
"name": "timeout",
|
|
171
|
-
"value": {
|
|
172
|
-
"type": "CONSTANT_VALUE",
|
|
173
|
-
"value": {"type": "JSON", "value": None},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
"data": {
|
|
178
|
-
"label": "Simple API Node",
|
|
179
|
-
"error_output_id": None,
|
|
180
|
-
"source_handle_id": "6c574f01-9362-4edd-b3dd-5faacca76b28",
|
|
181
|
-
"target_handle_id": "35816b8f-453b-4f70-a5fc-72dd0ceca460",
|
|
182
|
-
"url_input_id": "df921419-5ccb-4e1e-987f-b2349701b3db",
|
|
183
|
-
"method_input_id": "327b4d34-2803-4782-8449-fda65b12a064",
|
|
184
|
-
"body_input_id": "470f5596-8fbd-4f34-af14-9b69b69dffcd",
|
|
185
|
-
"authorization_type_input_id": "76fcf4b3-7e7f-4fc5-8065-18cb1c4c0225",
|
|
186
|
-
"bearer_token_value_input_id": "94e73208-63db-4511-b86e-9fa285cdd1ad",
|
|
187
|
-
"api_key_header_key_input_id": "1b3f6dfc-2053-4536-898a-747e64cc1313",
|
|
188
|
-
"api_key_header_value_input_id": "7d728938-fd08-4224-81b4-5d5bc3d3bd57",
|
|
189
|
-
"additional_headers": [
|
|
190
|
-
{
|
|
191
|
-
"header_key_input_id": "416e4be7-f186-4ace-9619-637c54eeffb7",
|
|
192
|
-
"header_value_input_id": "f2803619-eda1-4941-8d6a-288c87aca215",
|
|
193
|
-
}
|
|
194
|
-
],
|
|
195
|
-
"text_output_id": "f7190a6b-0c13-4a5a-9087-d8e6feb84eca",
|
|
196
|
-
"json_output_id": "a0542dcc-443c-4b3b-aac8-c41d2277a5c7",
|
|
197
|
-
"status_code_output_id": "f687c0a1-b63a-4c5c-b6ef-472c6108ae4b",
|
|
198
|
-
},
|
|
199
|
-
"display_data": {"position": {"x": 200.0, "y": -50.0}},
|
|
200
|
-
"base": {
|
|
201
|
-
"name": "APINode",
|
|
202
|
-
"module": ["vellum", "workflows", "nodes", "displayable", "api_node", "node"],
|
|
203
|
-
},
|
|
204
|
-
"definition": {
|
|
205
|
-
"name": "SimpleAPINode",
|
|
206
|
-
"module": ["tests", "workflows", "basic_api_node", "workflow"],
|
|
207
|
-
},
|
|
208
|
-
"trigger": {
|
|
209
|
-
"id": "35816b8f-453b-4f70-a5fc-72dd0ceca460",
|
|
210
|
-
"merge_behavior": "AWAIT_ANY",
|
|
211
|
-
},
|
|
212
|
-
"ports": [{"id": "6c574f01-9362-4edd-b3dd-5faacca76b28", "name": "default", "type": "DEFAULT"}],
|
|
213
|
-
"outputs": [
|
|
214
|
-
{"id": "a0542dcc-443c-4b3b-aac8-c41d2277a5c7", "name": "json", "type": "JSON", "value": None},
|
|
215
|
-
{"id": "88082704-42bc-453f-a02a-40754453546b", "name": "headers", "type": "JSON", "value": None},
|
|
216
|
-
{"id": "f687c0a1-b63a-4c5c-b6ef-472c6108ae4b", "name": "status_code", "type": "NUMBER", "value": None},
|
|
217
|
-
{"id": "f7190a6b-0c13-4a5a-9087-d8e6feb84eca", "name": "text", "type": "STRING", "value": None},
|
|
218
|
-
],
|
|
219
|
-
},
|
|
220
|
-
api_node,
|
|
221
|
-
)
|
|
63
|
+
assert api_node["id"] == "6783c80f-5fc0-4712-a251-ce59d3c14ff2"
|
|
64
|
+
assert api_node["type"] == "API"
|
|
222
65
|
|
|
223
|
-
|
|
224
|
-
assert
|
|
225
|
-
[
|
|
226
|
-
{
|
|
227
|
-
"id": "8f975ab1-aca6-4dc1-aa80-c596f4e13afa",
|
|
228
|
-
"type": "TERMINAL",
|
|
229
|
-
"data": {
|
|
230
|
-
"label": "Final Output",
|
|
231
|
-
"name": "json",
|
|
232
|
-
"target_handle_id": "06853542-e1a1-4a00-bd1e-4ac40f347b32",
|
|
233
|
-
"output_id": "9a37bf7d-484e-4725-903e-f3254df38a0a",
|
|
234
|
-
"output_type": "JSON",
|
|
235
|
-
"node_input_id": "b49f0f85-37fc-4686-81a7-287c06634661",
|
|
236
|
-
},
|
|
237
|
-
"inputs": [
|
|
238
|
-
{
|
|
239
|
-
"id": "b49f0f85-37fc-4686-81a7-287c06634661",
|
|
240
|
-
"key": "node_input",
|
|
241
|
-
"value": {
|
|
242
|
-
"rules": [
|
|
243
|
-
{
|
|
244
|
-
"type": "NODE_OUTPUT",
|
|
245
|
-
"data": {
|
|
246
|
-
"node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
247
|
-
"output_id": "a0542dcc-443c-4b3b-aac8-c41d2277a5c7",
|
|
248
|
-
},
|
|
249
|
-
}
|
|
250
|
-
],
|
|
251
|
-
"combinator": "OR",
|
|
252
|
-
},
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
"display_data": {"position": {"x": 400.0, "y": 200.0}},
|
|
256
|
-
"base": {
|
|
257
|
-
"name": "FinalOutputNode",
|
|
258
|
-
"module": ["vellum", "workflows", "nodes", "displayable", "final_output_node", "node"],
|
|
259
|
-
},
|
|
260
|
-
"definition": None,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"id": "736f9bd0-f487-42af-bdb3-780b4941c61c",
|
|
264
|
-
"type": "TERMINAL",
|
|
265
|
-
"data": {
|
|
266
|
-
"label": "Final Output",
|
|
267
|
-
"name": "headers",
|
|
268
|
-
"target_handle_id": "80d0894f-642e-4d2e-b43a-f236e7bedb3c",
|
|
269
|
-
"output_id": "5090e96d-5787-4a08-bf58-129101cf2548",
|
|
270
|
-
"output_type": "JSON",
|
|
271
|
-
"node_input_id": "5e892e5b-0004-4a04-bd2e-1ea9e0e5d3f9",
|
|
272
|
-
},
|
|
273
|
-
"inputs": [
|
|
274
|
-
{
|
|
275
|
-
"id": "5e892e5b-0004-4a04-bd2e-1ea9e0e5d3f9",
|
|
276
|
-
"key": "node_input",
|
|
277
|
-
"value": {
|
|
278
|
-
"rules": [
|
|
279
|
-
{
|
|
280
|
-
"type": "NODE_OUTPUT",
|
|
281
|
-
"data": {
|
|
282
|
-
"node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
283
|
-
"output_id": "88082704-42bc-453f-a02a-40754453546b",
|
|
284
|
-
},
|
|
285
|
-
}
|
|
286
|
-
],
|
|
287
|
-
"combinator": "OR",
|
|
288
|
-
},
|
|
289
|
-
}
|
|
290
|
-
],
|
|
291
|
-
"display_data": {"position": {"x": 400.0, "y": -50.0}},
|
|
292
|
-
"base": {
|
|
293
|
-
"name": "FinalOutputNode",
|
|
294
|
-
"module": ["vellum", "workflows", "nodes", "displayable", "final_output_node", "node"],
|
|
295
|
-
},
|
|
296
|
-
"definition": None,
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"id": "3f3ffc50-b156-48ac-b5f3-f68cb05c2b90",
|
|
300
|
-
"type": "TERMINAL",
|
|
301
|
-
"data": {
|
|
302
|
-
"label": "Final Output",
|
|
303
|
-
"name": "status_code",
|
|
304
|
-
"target_handle_id": "0c98c306-b519-40d7-8b05-321b1dfd7f11",
|
|
305
|
-
"output_id": "44ea8d75-e2a8-4627-85b1-8504b65d25c9",
|
|
306
|
-
"output_type": "NUMBER",
|
|
307
|
-
"node_input_id": "14345321-7e6b-4e2a-918a-7a5b0064f047",
|
|
308
|
-
},
|
|
309
|
-
"inputs": [
|
|
310
|
-
{
|
|
311
|
-
"id": "14345321-7e6b-4e2a-918a-7a5b0064f047",
|
|
312
|
-
"key": "node_input",
|
|
313
|
-
"value": {
|
|
314
|
-
"rules": [
|
|
315
|
-
{
|
|
316
|
-
"type": "NODE_OUTPUT",
|
|
317
|
-
"data": {
|
|
318
|
-
"node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
319
|
-
"output_id": "f687c0a1-b63a-4c5c-b6ef-472c6108ae4b",
|
|
320
|
-
},
|
|
321
|
-
}
|
|
322
|
-
],
|
|
323
|
-
"combinator": "OR",
|
|
324
|
-
},
|
|
325
|
-
}
|
|
326
|
-
],
|
|
327
|
-
"display_data": {"position": {"x": 400.0, "y": -300.0}},
|
|
328
|
-
"base": {
|
|
329
|
-
"name": "FinalOutputNode",
|
|
330
|
-
"module": ["vellum", "workflows", "nodes", "displayable", "final_output_node", "node"],
|
|
331
|
-
},
|
|
332
|
-
"definition": None,
|
|
333
|
-
},
|
|
334
|
-
],
|
|
335
|
-
final_output_nodes,
|
|
336
|
-
ignore_order=True,
|
|
337
|
-
)
|
|
66
|
+
assert api_node["base"]["name"] == "APINode"
|
|
67
|
+
assert api_node["base"]["module"] == ["vellum", "workflows", "nodes", "displayable", "api_node", "node"]
|
|
338
68
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
assert not DeepDiff(
|
|
342
|
-
[
|
|
343
|
-
{
|
|
344
|
-
"id": "5e0e62cf-cdd9-4c47-ad19-ccbcdb41deac",
|
|
345
|
-
"source_node_id": "3a6b1467-5c83-4bcd-86a0-6415bc32d23b",
|
|
346
|
-
"source_handle_id": "8eaa7f02-25ff-4a00-9b0a-5185718d89b3",
|
|
347
|
-
"target_node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
348
|
-
"target_handle_id": "35816b8f-453b-4f70-a5fc-72dd0ceca460",
|
|
349
|
-
"type": "DEFAULT",
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"id": "422bbbb7-38b2-4e19-ac95-24a86ed24100",
|
|
353
|
-
"source_node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
354
|
-
"source_handle_id": "6c574f01-9362-4edd-b3dd-5faacca76b28",
|
|
355
|
-
"target_node_id": "8f975ab1-aca6-4dc1-aa80-c596f4e13afa",
|
|
356
|
-
"target_handle_id": "06853542-e1a1-4a00-bd1e-4ac40f347b32",
|
|
357
|
-
"type": "DEFAULT",
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
"id": "73007fe0-5cc2-435e-b2e4-6fa734153fbd",
|
|
361
|
-
"source_node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
362
|
-
"source_handle_id": "6c574f01-9362-4edd-b3dd-5faacca76b28",
|
|
363
|
-
"target_node_id": "736f9bd0-f487-42af-bdb3-780b4941c61c",
|
|
364
|
-
"target_handle_id": "80d0894f-642e-4d2e-b43a-f236e7bedb3c",
|
|
365
|
-
"type": "DEFAULT",
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"id": "4ac7d1c4-697b-440c-a35d-61ffb44a33b3",
|
|
369
|
-
"source_node_id": "6783c80f-5fc0-4712-a251-ce59d3c14ff2",
|
|
370
|
-
"source_handle_id": "6c574f01-9362-4edd-b3dd-5faacca76b28",
|
|
371
|
-
"target_node_id": "3f3ffc50-b156-48ac-b5f3-f68cb05c2b90",
|
|
372
|
-
"target_handle_id": "0c98c306-b519-40d7-8b05-321b1dfd7f11",
|
|
373
|
-
"type": "DEFAULT",
|
|
374
|
-
},
|
|
375
|
-
],
|
|
376
|
-
serialized_edges,
|
|
377
|
-
ignore_order=True,
|
|
378
|
-
)
|
|
69
|
+
assert api_node["definition"]["name"] == "SimpleAPINode"
|
|
70
|
+
assert api_node["definition"]["module"] == ["tests", "workflows", "basic_api_node", "workflow"]
|
|
379
71
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
72
|
+
assert api_node["trigger"]["id"] == "35816b8f-453b-4f70-a5fc-72dd0ceca460"
|
|
73
|
+
assert api_node["trigger"]["merge_behavior"] == "AWAIT_ANY"
|
|
74
|
+
|
|
75
|
+
assert len(api_node["ports"]) == 1
|
|
76
|
+
assert api_node["ports"][0]["name"] == "default"
|
|
77
|
+
assert api_node["ports"][0]["type"] == "DEFAULT"
|
|
78
|
+
|
|
79
|
+
assert len(api_node["outputs"]) == 4
|
|
80
|
+
output_names = {output["name"] for output in api_node["outputs"]}
|
|
81
|
+
assert output_names == {"json", "headers", "status_code", "text"}
|
|
82
|
+
|
|
83
|
+
assert api_node["data"]["label"] == "Simple API Node"
|
|
84
|
+
assert api_node["data"]["error_output_id"] is None
|
|
85
|
+
assert api_node["data"]["source_handle_id"] == "6c574f01-9362-4edd-b3dd-5faacca76b28"
|
|
86
|
+
assert api_node["data"]["target_handle_id"] == "35816b8f-453b-4f70-a5fc-72dd0ceca460"
|
|
87
|
+
assert api_node["data"]["json_output_id"] == "a0542dcc-443c-4b3b-aac8-c41d2277a5c7"
|
|
88
|
+
assert api_node["data"]["text_output_id"] == "f7190a6b-0c13-4a5a-9087-d8e6feb84eca"
|
|
89
|
+
assert api_node["data"]["status_code_output_id"] == "f687c0a1-b63a-4c5c-b6ef-472c6108ae4b"
|
|
90
|
+
|
|
91
|
+
input_keys = {inp["key"] for inp in api_node["inputs"]}
|
|
92
|
+
assert "url" in input_keys
|
|
93
|
+
assert "method" in input_keys
|
|
94
|
+
assert "body" in input_keys
|
|
95
|
+
|
|
96
|
+
assert len(api_node["attributes"]) == 1
|
|
97
|
+
assert api_node["attributes"][0]["name"] == "timeout"
|
|
389
98
|
|
|
390
99
|
# AND the definition should be what we expect
|
|
391
100
|
definition = workflow_raw_data["definition"]
|