vellum-ai 1.1.2__py3-none-any.whl → 1.1.4__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.
- vellum/__init__.py +18 -0
- vellum/client/README.md +77 -0
- vellum/client/__init__.py +149 -600
- vellum/client/core/__init__.py +2 -0
- vellum/client/core/api_error.py +13 -5
- vellum/client/core/client_wrapper.py +16 -4
- vellum/client/core/force_multipart.py +16 -0
- vellum/client/core/http_client.py +70 -24
- vellum/client/core/http_response.py +19 -11
- vellum/client/core/pydantic_utilities.py +71 -114
- vellum/client/core/serialization.py +6 -1
- vellum/client/errors/__init__.py +2 -0
- vellum/client/errors/bad_request_error.py +4 -3
- vellum/client/errors/forbidden_error.py +4 -3
- vellum/client/errors/internal_server_error.py +4 -3
- vellum/client/errors/not_found_error.py +4 -3
- vellum/client/raw_client.py +1041 -128
- vellum/client/reference.md +692 -19
- vellum/client/resources/__init__.py +2 -0
- vellum/client/resources/ad_hoc/__init__.py +2 -0
- vellum/client/resources/ad_hoc/client.py +37 -195
- vellum/client/resources/ad_hoc/raw_client.py +322 -31
- vellum/client/resources/container_images/__init__.py +2 -0
- vellum/client/resources/container_images/client.py +26 -49
- vellum/client/resources/container_images/raw_client.py +23 -24
- vellum/client/resources/deployments/__init__.py +2 -0
- vellum/client/resources/deployments/client.py +55 -102
- vellum/client/resources/deployments/raw_client.py +73 -66
- vellum/client/resources/deployments/types/__init__.py +2 -0
- vellum/client/resources/document_indexes/__init__.py +2 -0
- vellum/client/resources/document_indexes/client.py +43 -100
- vellum/client/resources/document_indexes/raw_client.py +42 -43
- vellum/client/resources/document_indexes/types/__init__.py +2 -0
- vellum/client/resources/documents/__init__.py +2 -0
- vellum/client/resources/documents/client.py +29 -52
- vellum/client/resources/documents/raw_client.py +51 -44
- vellum/client/resources/folder_entities/__init__.py +2 -0
- vellum/client/resources/folder_entities/client.py +16 -21
- vellum/client/resources/folder_entities/raw_client.py +15 -16
- vellum/client/resources/folder_entities/types/__init__.py +2 -0
- vellum/client/resources/metric_definitions/__init__.py +2 -0
- vellum/client/resources/metric_definitions/client.py +16 -27
- vellum/client/resources/metric_definitions/raw_client.py +17 -18
- vellum/client/resources/ml_models/__init__.py +2 -0
- vellum/client/resources/ml_models/client.py +7 -14
- vellum/client/resources/ml_models/raw_client.py +11 -12
- vellum/client/resources/organizations/__init__.py +2 -0
- vellum/client/resources/organizations/client.py +7 -12
- vellum/client/resources/organizations/raw_client.py +10 -11
- vellum/client/resources/prompts/__init__.py +2 -0
- vellum/client/resources/prompts/client.py +12 -19
- vellum/client/resources/prompts/raw_client.py +40 -33
- vellum/client/resources/sandboxes/__init__.py +2 -0
- vellum/client/resources/sandboxes/client.py +17 -34
- vellum/client/resources/sandboxes/raw_client.py +20 -21
- vellum/client/resources/test_suite_runs/__init__.py +2 -0
- vellum/client/resources/test_suite_runs/client.py +19 -34
- vellum/client/resources/test_suite_runs/raw_client.py +20 -21
- vellum/client/resources/test_suites/__init__.py +2 -0
- vellum/client/resources/test_suites/client.py +26 -100
- vellum/client/resources/test_suites/raw_client.py +172 -21
- vellum/client/resources/workflow_deployments/__init__.py +2 -0
- vellum/client/resources/workflow_deployments/client.py +61 -120
- vellum/client/resources/workflow_deployments/raw_client.py +48 -49
- vellum/client/resources/workflow_deployments/types/__init__.py +2 -0
- vellum/client/resources/workflow_executions/__init__.py +2 -0
- vellum/client/resources/workflow_executions/client.py +8 -13
- vellum/client/resources/workflow_executions/raw_client.py +11 -12
- vellum/client/resources/workflow_sandboxes/__init__.py +2 -0
- vellum/client/resources/workflow_sandboxes/client.py +14 -23
- vellum/client/resources/workflow_sandboxes/raw_client.py +16 -17
- vellum/client/resources/workflow_sandboxes/types/__init__.py +2 -0
- vellum/client/resources/workflows/__init__.py +2 -0
- vellum/client/resources/workflows/client.py +16 -16
- vellum/client/resources/workflows/raw_client.py +75 -57
- vellum/client/resources/workspace_secrets/__init__.py +2 -0
- vellum/client/resources/workspace_secrets/client.py +11 -28
- vellum/client/resources/workspace_secrets/raw_client.py +15 -16
- vellum/client/resources/workspaces/__init__.py +2 -0
- vellum/client/resources/workspaces/client.py +7 -12
- vellum/client/resources/workspaces/raw_client.py +10 -11
- vellum/client/types/__init__.py +18 -0
- vellum/client/types/ad_hoc_execute_prompt_event.py +3 -2
- vellum/client/types/ad_hoc_expand_meta.py +2 -2
- vellum/client/types/ad_hoc_fulfilled_prompt_execution_meta.py +3 -3
- vellum/client/types/ad_hoc_initiated_prompt_execution_meta.py +2 -2
- vellum/client/types/ad_hoc_rejected_prompt_execution_meta.py +3 -3
- vellum/client/types/ad_hoc_streaming_prompt_execution_meta.py +2 -2
- vellum/client/types/api_node_result.py +3 -3
- vellum/client/types/api_node_result_data.py +4 -4
- vellum/client/types/api_request_parent_context.py +11 -11
- vellum/client/types/array_chat_message_content.py +3 -3
- vellum/client/types/array_chat_message_content_item.py +7 -4
- vellum/client/types/array_chat_message_content_item_request.py +7 -4
- vellum/client/types/array_chat_message_content_request.py +3 -3
- vellum/client/types/array_input.py +12 -6
- vellum/client/types/array_vellum_value.py +4 -4
- vellum/client/types/array_vellum_value_request.py +4 -4
- vellum/client/types/audio_chat_message_content.py +3 -3
- vellum/client/types/audio_chat_message_content_request.py +3 -3
- vellum/client/types/audio_prompt_block.py +4 -4
- vellum/client/types/audio_vellum_value.py +3 -3
- vellum/client/types/audio_vellum_value_request.py +3 -3
- vellum/client/types/base_output.py +2 -2
- vellum/client/types/basic_vectorizer_intfloat_multilingual_e_5_large.py +2 -2
- vellum/client/types/basic_vectorizer_intfloat_multilingual_e_5_large_request.py +2 -2
- vellum/client/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1.py +2 -2
- vellum/client/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1_request.py +2 -2
- vellum/client/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1.py +2 -2
- vellum/client/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1_request.py +2 -2
- vellum/client/types/chat_history_input.py +3 -3
- vellum/client/types/chat_history_input_request.py +3 -3
- vellum/client/types/chat_history_vellum_value.py +3 -3
- vellum/client/types/chat_history_vellum_value_request.py +3 -3
- vellum/client/types/chat_message.py +4 -4
- vellum/client/types/chat_message_content.py +7 -4
- vellum/client/types/chat_message_content_request.py +7 -4
- vellum/client/types/chat_message_prompt_block.py +7 -7
- vellum/client/types/chat_message_request.py +4 -4
- vellum/client/types/code_execution_node_array_result.py +11 -5
- vellum/client/types/code_execution_node_chat_history_result.py +3 -3
- vellum/client/types/code_execution_node_error_result.py +3 -3
- vellum/client/types/code_execution_node_function_call_result.py +3 -3
- vellum/client/types/code_execution_node_json_result.py +2 -2
- vellum/client/types/code_execution_node_number_result.py +2 -2
- vellum/client/types/code_execution_node_result.py +10 -4
- vellum/client/types/code_execution_node_result_data.py +10 -4
- vellum/client/types/code_execution_node_result_output.py +6 -5
- vellum/client/types/code_execution_node_search_results_result.py +3 -3
- vellum/client/types/code_execution_node_string_result.py +2 -2
- vellum/client/types/code_execution_package.py +2 -2
- vellum/client/types/code_executor_input.py +7 -6
- vellum/client/types/code_executor_response.py +11 -5
- vellum/client/types/code_executor_secret_input.py +3 -3
- vellum/client/types/code_resource_definition.py +3 -3
- vellum/client/types/compile_prompt_deployment_expand_meta_request.py +2 -2
- vellum/client/types/compile_prompt_meta.py +2 -2
- vellum/client/types/conditional_node_result.py +3 -3
- vellum/client/types/conditional_node_result_data.py +2 -2
- vellum/client/types/container_image_build_config.py +3 -3
- vellum/client/types/container_image_container_image_tag.py +2 -2
- vellum/client/types/container_image_read.py +5 -5
- vellum/client/types/create_test_suite_test_case_request.py +9 -3
- vellum/client/types/deployment_history_item.py +10 -4
- vellum/client/types/deployment_provider_payload_response.py +4 -4
- vellum/client/types/deployment_read.py +10 -4
- vellum/client/types/deployment_release_tag_deployment_history_item.py +2 -2
- vellum/client/types/deployment_release_tag_read.py +4 -4
- vellum/client/types/docker_service_token.py +2 -2
- vellum/client/types/document_chat_message_content.py +3 -3
- vellum/client/types/document_chat_message_content_request.py +3 -3
- vellum/client/types/document_document_to_document_index.py +3 -3
- vellum/client/types/document_index_chunking.py +1 -0
- vellum/client/types/document_index_chunking_request.py +1 -0
- vellum/client/types/document_index_indexing_config.py +4 -4
- vellum/client/types/document_index_indexing_config_request.py +4 -4
- vellum/client/types/document_index_read.py +4 -4
- vellum/client/types/document_prompt_block.py +4 -4
- vellum/client/types/document_read.py +4 -4
- vellum/client/types/document_vellum_value.py +3 -3
- vellum/client/types/document_vellum_value_request.py +3 -3
- vellum/client/types/enriched_normalized_completion.py +3 -3
- vellum/client/types/ephemeral_prompt_cache_config.py +3 -3
- vellum/client/types/error_input.py +3 -3
- vellum/client/types/error_vellum_value.py +3 -3
- vellum/client/types/error_vellum_value_request.py +3 -3
- vellum/client/types/execute_api_request_bearer_token.py +1 -0
- vellum/client/types/execute_api_request_headers_value.py +1 -0
- vellum/client/types/execute_api_response.py +5 -5
- vellum/client/types/execute_prompt_event.py +3 -2
- vellum/client/types/execute_prompt_response.py +1 -0
- vellum/client/types/execute_workflow_response.py +10 -4
- vellum/client/types/execute_workflow_workflow_result_event.py +1 -0
- vellum/client/types/execution_array_vellum_value.py +12 -6
- vellum/client/types/execution_chat_history_vellum_value.py +3 -3
- vellum/client/types/execution_error_vellum_value.py +3 -3
- vellum/client/types/execution_function_call_vellum_value.py +3 -3
- vellum/client/types/execution_json_vellum_value.py +3 -3
- vellum/client/types/execution_number_vellum_value.py +3 -3
- vellum/client/types/execution_search_results_vellum_value.py +3 -3
- vellum/client/types/execution_string_vellum_value.py +3 -3
- vellum/client/types/execution_thinking_vellum_value.py +3 -3
- vellum/client/types/execution_vellum_value.py +6 -5
- vellum/client/types/external_input_descriptor.py +3 -3
- vellum/client/types/external_parent_context.py +11 -11
- vellum/client/types/external_test_case_execution.py +10 -4
- vellum/client/types/external_test_case_execution_request.py +10 -4
- vellum/client/types/fast_embed_vectorizer_baai_bge_small_en_v_15.py +2 -2
- vellum/client/types/fast_embed_vectorizer_baai_bge_small_en_v_15_request.py +2 -2
- vellum/client/types/folder_entity.py +4 -3
- vellum/client/types/folder_entity_dataset.py +3 -3
- vellum/client/types/folder_entity_dataset_data.py +3 -3
- vellum/client/types/folder_entity_document_index.py +3 -3
- vellum/client/types/folder_entity_document_index_data.py +4 -4
- vellum/client/types/folder_entity_folder.py +3 -3
- vellum/client/types/folder_entity_folder_data.py +2 -2
- vellum/client/types/folder_entity_prompt_sandbox.py +3 -3
- vellum/client/types/folder_entity_prompt_sandbox_data.py +3 -3
- vellum/client/types/folder_entity_test_suite.py +3 -3
- vellum/client/types/folder_entity_test_suite_data.py +3 -3
- vellum/client/types/folder_entity_workflow_sandbox.py +3 -3
- vellum/client/types/folder_entity_workflow_sandbox_data.py +3 -3
- vellum/client/types/fulfilled_ad_hoc_execute_prompt_event.py +4 -4
- vellum/client/types/fulfilled_execute_prompt_event.py +4 -4
- vellum/client/types/fulfilled_execute_prompt_response.py +3 -3
- vellum/client/types/fulfilled_execute_workflow_workflow_result_event.py +11 -5
- vellum/client/types/fulfilled_prompt_execution_meta.py +3 -3
- vellum/client/types/fulfilled_workflow_node_result_event.py +12 -6
- vellum/client/types/function_call.py +2 -2
- vellum/client/types/function_call_chat_message_content.py +3 -3
- vellum/client/types/function_call_chat_message_content_request.py +3 -3
- vellum/client/types/function_call_chat_message_content_value.py +2 -2
- vellum/client/types/function_call_chat_message_content_value_request.py +2 -2
- vellum/client/types/function_call_input.py +3 -3
- vellum/client/types/function_call_prompt_block.py +4 -4
- vellum/client/types/function_call_request.py +2 -2
- vellum/client/types/function_call_vellum_value.py +3 -3
- vellum/client/types/function_call_vellum_value_request.py +3 -3
- vellum/client/types/function_definition.py +4 -4
- vellum/client/types/generate_options_request.py +3 -3
- vellum/client/types/generate_request.py +2 -2
- vellum/client/types/generate_response.py +3 -3
- vellum/client/types/generate_result.py +3 -3
- vellum/client/types/generate_result_data.py +3 -3
- vellum/client/types/generate_result_error.py +3 -3
- vellum/client/types/generate_stream_response.py +3 -3
- vellum/client/types/generate_stream_result.py +4 -4
- vellum/client/types/generate_stream_result_data.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_config.py +2 -2
- vellum/client/types/google_vertex_ai_vectorizer_config_request.py +2 -2
- vellum/client/types/google_vertex_ai_vectorizer_gemini_embedding_001.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_gemini_embedding_001_request.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_text_embedding_004.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_text_embedding_004_request.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_text_multilingual_embedding_002.py +3 -3
- vellum/client/types/google_vertex_ai_vectorizer_text_multilingual_embedding_002_request.py +3 -3
- vellum/client/types/hkunlp_instructor_xl_vectorizer.py +3 -3
- vellum/client/types/hkunlp_instructor_xl_vectorizer_request.py +3 -3
- vellum/client/types/image_chat_message_content.py +3 -3
- vellum/client/types/image_chat_message_content_request.py +3 -3
- vellum/client/types/image_prompt_block.py +4 -4
- vellum/client/types/image_vellum_value.py +3 -3
- vellum/client/types/image_vellum_value_request.py +3 -3
- vellum/client/types/indexing_config_vectorizer.py +7 -6
- vellum/client/types/indexing_config_vectorizer_request.py +7 -6
- vellum/client/types/initiated_ad_hoc_execute_prompt_event.py +3 -3
- vellum/client/types/initiated_execute_prompt_event.py +3 -3
- vellum/client/types/initiated_prompt_execution_meta.py +2 -2
- vellum/client/types/initiated_workflow_node_result_event.py +12 -6
- vellum/client/types/instructor_vectorizer_config.py +2 -2
- vellum/client/types/instructor_vectorizer_config_request.py +2 -2
- vellum/client/types/invoked_port.py +2 -2
- vellum/client/types/jinja_prompt_block.py +4 -4
- vellum/client/types/json_input.py +3 -3
- vellum/client/types/json_input_request.py +3 -3
- vellum/client/types/json_vellum_value.py +2 -2
- vellum/client/types/json_vellum_value_request.py +2 -2
- vellum/client/types/map_node_result.py +3 -3
- vellum/client/types/map_node_result_data.py +3 -3
- vellum/client/types/merge_node_result.py +3 -3
- vellum/client/types/merge_node_result_data.py +2 -2
- vellum/client/types/metadata_filter_config_request.py +12 -6
- vellum/client/types/metadata_filter_rule_request.py +5 -5
- vellum/client/types/metadata_filters_request.py +1 -0
- vellum/client/types/metric_definition_execution.py +10 -4
- vellum/client/types/metric_definition_history_item.py +10 -4
- vellum/client/types/metric_definition_input.py +3 -2
- vellum/client/types/metric_node_result.py +2 -2
- vellum/client/types/ml_model_read.py +6 -3
- vellum/client/types/ml_model_usage.py +2 -2
- vellum/client/types/ml_model_usage_wrapper.py +3 -3
- vellum/client/types/named_scenario_input_chat_history_variable_value_request.py +3 -3
- vellum/client/types/named_scenario_input_json_variable_value_request.py +2 -2
- vellum/client/types/named_scenario_input_request.py +3 -2
- vellum/client/types/named_scenario_input_string_variable_value_request.py +2 -2
- vellum/client/types/named_test_case_array_variable_value.py +11 -5
- vellum/client/types/named_test_case_array_variable_value_request.py +11 -5
- vellum/client/types/named_test_case_chat_history_variable_value.py +3 -3
- vellum/client/types/named_test_case_chat_history_variable_value_request.py +3 -3
- vellum/client/types/named_test_case_error_variable_value.py +3 -3
- vellum/client/types/named_test_case_error_variable_value_request.py +3 -3
- vellum/client/types/named_test_case_function_call_variable_value.py +3 -3
- vellum/client/types/named_test_case_function_call_variable_value_request.py +3 -3
- vellum/client/types/named_test_case_json_variable_value.py +2 -2
- vellum/client/types/named_test_case_json_variable_value_request.py +2 -2
- vellum/client/types/named_test_case_number_variable_value.py +2 -2
- vellum/client/types/named_test_case_number_variable_value_request.py +2 -2
- vellum/client/types/named_test_case_search_results_variable_value.py +3 -3
- vellum/client/types/named_test_case_search_results_variable_value_request.py +3 -3
- vellum/client/types/named_test_case_string_variable_value.py +2 -2
- vellum/client/types/named_test_case_string_variable_value_request.py +2 -2
- vellum/client/types/named_test_case_variable_value.py +6 -5
- vellum/client/types/named_test_case_variable_value_request.py +6 -5
- vellum/client/types/node_execution_fulfilled_body.py +4 -4
- vellum/client/types/node_execution_fulfilled_event.py +22 -16
- vellum/client/types/node_execution_initiated_body.py +3 -3
- vellum/client/types/node_execution_initiated_event.py +22 -16
- vellum/client/types/node_execution_paused_body.py +3 -3
- vellum/client/types/node_execution_paused_event.py +22 -16
- vellum/client/types/node_execution_rejected_body.py +4 -4
- vellum/client/types/node_execution_rejected_event.py +22 -16
- vellum/client/types/node_execution_resumed_body.py +3 -3
- vellum/client/types/node_execution_resumed_event.py +22 -16
- vellum/client/types/node_execution_span.py +21 -13
- vellum/client/types/node_execution_span_attributes.py +2 -2
- vellum/client/types/node_execution_streaming_body.py +4 -4
- vellum/client/types/node_execution_streaming_event.py +22 -16
- vellum/client/types/node_input_compiled_array_value.py +11 -5
- vellum/client/types/node_input_compiled_chat_history_value.py +3 -3
- vellum/client/types/node_input_compiled_error_value.py +3 -3
- vellum/client/types/node_input_compiled_function_call_value.py +3 -3
- vellum/client/types/node_input_compiled_json_value.py +2 -2
- vellum/client/types/node_input_compiled_number_value.py +2 -2
- vellum/client/types/node_input_compiled_search_results_value.py +3 -3
- vellum/client/types/node_input_compiled_secret_value.py +3 -3
- vellum/client/types/node_input_compiled_string_value.py +2 -2
- vellum/client/types/node_input_variable_compiled_value.py +6 -5
- vellum/client/types/node_output_compiled_array_value.py +12 -6
- vellum/client/types/node_output_compiled_chat_history_value.py +3 -3
- vellum/client/types/node_output_compiled_error_value.py +3 -3
- vellum/client/types/node_output_compiled_function_call_value.py +3 -3
- vellum/client/types/node_output_compiled_json_value.py +3 -3
- vellum/client/types/node_output_compiled_number_value.py +3 -3
- vellum/client/types/node_output_compiled_search_results_value.py +3 -3
- vellum/client/types/node_output_compiled_string_value.py +3 -3
- vellum/client/types/node_output_compiled_thinking_value.py +3 -3
- vellum/client/types/node_output_compiled_value.py +6 -5
- vellum/client/types/node_parent_context.py +12 -12
- vellum/client/types/normalized_log_probs.py +3 -3
- vellum/client/types/normalized_token_log_probs.py +2 -2
- vellum/client/types/number_input.py +3 -3
- vellum/client/types/number_vellum_value.py +2 -2
- vellum/client/types/number_vellum_value_request.py +2 -2
- vellum/client/types/open_ai_vectorizer_config.py +3 -3
- vellum/client/types/open_ai_vectorizer_config_request.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_3_large.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_3_large_request.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_3_small.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_3_small_request.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_ada_002.py +3 -3
- vellum/client/types/open_ai_vectorizer_text_embedding_ada_002_request.py +3 -3
- vellum/client/types/organization_read.py +4 -4
- vellum/client/types/paginated_container_image_read_list.py +3 -3
- vellum/client/types/paginated_deployment_release_tag_read_list.py +3 -3
- vellum/client/types/paginated_document_index_read_list.py +3 -3
- vellum/client/types/paginated_folder_entity_list.py +3 -3
- vellum/client/types/paginated_slim_deployment_read_list.py +10 -4
- vellum/client/types/paginated_slim_document_list.py +3 -3
- vellum/client/types/paginated_slim_workflow_deployment_list.py +10 -4
- vellum/client/types/paginated_test_suite_run_execution_list.py +10 -4
- vellum/client/types/paginated_test_suite_test_case_list.py +10 -4
- vellum/client/types/paginated_workflow_release_tag_read_list.py +3 -3
- vellum/client/types/paginated_workflow_sandbox_example_list.py +3 -3
- vellum/client/types/parent_context.py +5 -5
- vellum/client/types/pdf_search_result_meta_source.py +2 -2
- vellum/client/types/pdf_search_result_meta_source_request.py +2 -2
- vellum/client/types/plain_text_prompt_block.py +4 -4
- vellum/client/types/price.py +3 -3
- vellum/client/types/prompt_block.py +9 -6
- vellum/client/types/prompt_deployment_expand_meta_request.py +2 -2
- vellum/client/types/prompt_deployment_input_request.py +3 -2
- vellum/client/types/prompt_deployment_parent_context.py +11 -11
- vellum/client/types/prompt_deployment_release.py +6 -6
- vellum/client/types/prompt_deployment_release_prompt_deployment.py +2 -2
- vellum/client/types/prompt_deployment_release_prompt_version.py +4 -4
- vellum/client/types/prompt_exec_config.py +15 -9
- vellum/client/types/prompt_execution_meta.py +3 -3
- vellum/client/types/prompt_node_execution_meta.py +3 -3
- vellum/client/types/prompt_node_result.py +3 -3
- vellum/client/types/prompt_node_result_data.py +3 -3
- vellum/client/types/prompt_output.py +3 -2
- vellum/client/types/prompt_parameters.py +2 -2
- vellum/client/types/prompt_push_response.py +2 -2
- vellum/client/types/prompt_request_chat_history_input.py +3 -3
- vellum/client/types/prompt_request_input.py +3 -2
- vellum/client/types/prompt_request_json_input.py +3 -3
- vellum/client/types/prompt_request_string_input.py +3 -3
- vellum/client/types/prompt_settings.py +2 -2
- vellum/client/types/prompt_version_build_config_sandbox.py +2 -2
- vellum/client/types/raw_prompt_execution_overrides_request.py +2 -2
- vellum/client/types/reducto_chunker_config.py +2 -2
- vellum/client/types/reducto_chunker_config_request.py +2 -2
- vellum/client/types/reducto_chunking.py +3 -3
- vellum/client/types/reducto_chunking_request.py +3 -3
- vellum/client/types/rejected_ad_hoc_execute_prompt_event.py +4 -4
- vellum/client/types/rejected_execute_prompt_event.py +4 -4
- vellum/client/types/rejected_execute_prompt_response.py +3 -3
- vellum/client/types/rejected_execute_workflow_workflow_result_event.py +4 -4
- vellum/client/types/rejected_prompt_execution_meta.py +3 -3
- vellum/client/types/rejected_workflow_node_result_event.py +12 -6
- vellum/client/types/release_created_by.py +2 -2
- vellum/client/types/release_environment.py +2 -2
- vellum/client/types/release_release_tag.py +3 -3
- vellum/client/types/release_review_reviewer.py +2 -2
- vellum/client/types/release_tag_release.py +2 -2
- vellum/client/types/replace_test_suite_test_case_request.py +9 -3
- vellum/client/types/rich_text_child_block.py +2 -1
- vellum/client/types/rich_text_prompt_block.py +4 -4
- vellum/client/types/sandbox_scenario.py +3 -3
- vellum/client/types/scenario_input.py +3 -2
- vellum/client/types/scenario_input_chat_history_variable_value.py +3 -3
- vellum/client/types/scenario_input_json_variable_value.py +2 -2
- vellum/client/types/scenario_input_string_variable_value.py +2 -2
- vellum/client/types/search_filters_request.py +11 -5
- vellum/client/types/search_node_result.py +3 -3
- vellum/client/types/search_node_result_data.py +3 -3
- vellum/client/types/search_request_options_request.py +13 -7
- vellum/client/types/search_response.py +3 -3
- vellum/client/types/search_result.py +3 -3
- vellum/client/types/search_result_document.py +2 -2
- vellum/client/types/search_result_document_request.py +2 -2
- vellum/client/types/search_result_merging_request.py +2 -2
- vellum/client/types/search_result_meta.py +3 -3
- vellum/client/types/search_result_meta_request.py +3 -3
- vellum/client/types/search_result_request.py +3 -3
- vellum/client/types/search_results_input.py +3 -3
- vellum/client/types/search_results_vellum_value.py +3 -3
- vellum/client/types/search_results_vellum_value_request.py +3 -3
- vellum/client/types/search_weights_request.py +2 -2
- vellum/client/types/sentence_chunker_config.py +2 -2
- vellum/client/types/sentence_chunker_config_request.py +2 -2
- vellum/client/types/sentence_chunking.py +3 -3
- vellum/client/types/sentence_chunking_request.py +3 -3
- vellum/client/types/slim_deployment_read.py +10 -4
- vellum/client/types/slim_document.py +5 -5
- vellum/client/types/slim_document_document_to_document_index.py +3 -3
- vellum/client/types/slim_release_review.py +4 -4
- vellum/client/types/slim_workflow_deployment.py +11 -5
- vellum/client/types/slim_workflow_execution_read.py +21 -15
- vellum/client/types/span_link.py +12 -12
- vellum/client/types/streaming_ad_hoc_execute_prompt_event.py +4 -4
- vellum/client/types/streaming_execute_prompt_event.py +3 -3
- vellum/client/types/streaming_prompt_execution_meta.py +2 -2
- vellum/client/types/streaming_workflow_node_result_event.py +12 -6
- vellum/client/types/string_chat_message_content.py +2 -2
- vellum/client/types/string_chat_message_content_request.py +2 -2
- vellum/client/types/string_input.py +3 -3
- vellum/client/types/string_input_request.py +3 -3
- vellum/client/types/string_vellum_value.py +2 -2
- vellum/client/types/string_vellum_value_request.py +2 -2
- vellum/client/types/submit_completion_actual_request.py +3 -3
- vellum/client/types/submit_workflow_execution_actual_request.py +3 -2
- vellum/client/types/subworkflow_node_result.py +3 -3
- vellum/client/types/subworkflow_node_result_data.py +2 -2
- vellum/client/types/templating_node_array_result.py +11 -5
- vellum/client/types/templating_node_chat_history_result.py +3 -3
- vellum/client/types/templating_node_error_result.py +3 -3
- vellum/client/types/templating_node_function_call_result.py +3 -3
- vellum/client/types/templating_node_json_result.py +2 -2
- vellum/client/types/templating_node_number_result.py +2 -2
- vellum/client/types/templating_node_result.py +10 -4
- vellum/client/types/templating_node_result_data.py +10 -4
- vellum/client/types/templating_node_result_output.py +6 -5
- vellum/client/types/templating_node_search_results_result.py +3 -3
- vellum/client/types/templating_node_string_result.py +2 -2
- vellum/client/types/terminal_node_array_result.py +11 -5
- vellum/client/types/terminal_node_chat_history_result.py +2 -2
- vellum/client/types/terminal_node_error_result.py +2 -2
- vellum/client/types/terminal_node_function_call_result.py +2 -2
- vellum/client/types/terminal_node_json_result.py +2 -2
- vellum/client/types/terminal_node_number_result.py +2 -2
- vellum/client/types/terminal_node_result.py +10 -4
- vellum/client/types/terminal_node_result_data.py +10 -4
- vellum/client/types/terminal_node_result_output.py +6 -5
- vellum/client/types/terminal_node_search_results_result.py +2 -2
- vellum/client/types/terminal_node_string_result.py +2 -2
- vellum/client/types/test_case_array_variable_value.py +11 -5
- vellum/client/types/test_case_chat_history_variable_value.py +3 -3
- vellum/client/types/test_case_error_variable_value.py +3 -3
- vellum/client/types/test_case_function_call_variable_value.py +3 -3
- vellum/client/types/test_case_json_variable_value.py +2 -2
- vellum/client/types/test_case_number_variable_value.py +2 -2
- vellum/client/types/test_case_search_results_variable_value.py +3 -3
- vellum/client/types/test_case_string_variable_value.py +2 -2
- vellum/client/types/test_case_variable_value.py +6 -5
- vellum/client/types/test_suite_run_deployment_release_tag_exec_config.py +3 -3
- vellum/client/types/test_suite_run_deployment_release_tag_exec_config_data.py +3 -3
- vellum/client/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_deployment_release_tag_exec_config_request.py +3 -3
- vellum/client/types/test_suite_run_exec_config.py +2 -1
- vellum/client/types/test_suite_run_exec_config_request.py +2 -1
- vellum/client/types/test_suite_run_execution.py +11 -5
- vellum/client/types/test_suite_run_execution_array_output.py +11 -5
- vellum/client/types/test_suite_run_execution_chat_history_output.py +3 -3
- vellum/client/types/test_suite_run_execution_error_output.py +3 -3
- vellum/client/types/test_suite_run_execution_function_call_output.py +3 -3
- vellum/client/types/test_suite_run_execution_json_output.py +2 -2
- vellum/client/types/test_suite_run_execution_metric_definition.py +2 -2
- vellum/client/types/test_suite_run_execution_metric_result.py +11 -5
- vellum/client/types/test_suite_run_execution_number_output.py +2 -2
- vellum/client/types/test_suite_run_execution_output.py +6 -5
- vellum/client/types/test_suite_run_execution_search_results_output.py +3 -3
- vellum/client/types/test_suite_run_execution_string_output.py +2 -2
- vellum/client/types/test_suite_run_external_exec_config.py +10 -4
- vellum/client/types/test_suite_run_external_exec_config_data.py +10 -4
- vellum/client/types/test_suite_run_external_exec_config_data_request.py +10 -4
- vellum/client/types/test_suite_run_external_exec_config_request.py +10 -4
- vellum/client/types/test_suite_run_metric_array_output.py +11 -5
- vellum/client/types/test_suite_run_metric_error_output.py +3 -3
- vellum/client/types/test_suite_run_metric_json_output.py +2 -2
- vellum/client/types/test_suite_run_metric_number_output.py +2 -2
- vellum/client/types/test_suite_run_metric_output.py +5 -4
- vellum/client/types/test_suite_run_metric_string_output.py +2 -2
- vellum/client/types/test_suite_run_progress.py +2 -2
- vellum/client/types/test_suite_run_prompt_sandbox_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_prompt_sandbox_exec_config_request.py +3 -3
- vellum/client/types/test_suite_run_prompt_sandbox_history_item_exec_config.py +3 -3
- vellum/client/types/test_suite_run_prompt_sandbox_history_item_exec_config_data.py +3 -3
- vellum/client/types/test_suite_run_prompt_sandbox_history_item_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_prompt_sandbox_history_item_exec_config_request.py +3 -3
- vellum/client/types/test_suite_run_read.py +12 -6
- vellum/client/types/test_suite_run_test_suite.py +2 -2
- vellum/client/types/test_suite_run_workflow_release_tag_exec_config.py +3 -3
- vellum/client/types/test_suite_run_workflow_release_tag_exec_config_data.py +3 -3
- vellum/client/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_workflow_release_tag_exec_config_request.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_exec_config_request.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_history_item_exec_config.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_history_item_exec_config_data.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_history_item_exec_config_data_request.py +3 -3
- vellum/client/types/test_suite_run_workflow_sandbox_history_item_exec_config_request.py +3 -3
- vellum/client/types/test_suite_test_case.py +10 -4
- vellum/client/types/test_suite_test_case_bulk_operation_request.py +2 -1
- vellum/client/types/test_suite_test_case_bulk_result.py +2 -1
- vellum/client/types/test_suite_test_case_create_bulk_operation_request.py +10 -4
- vellum/client/types/test_suite_test_case_created_bulk_result.py +3 -3
- vellum/client/types/test_suite_test_case_created_bulk_result_data.py +2 -2
- vellum/client/types/test_suite_test_case_delete_bulk_operation_data_request.py +2 -2
- vellum/client/types/test_suite_test_case_delete_bulk_operation_request.py +3 -3
- vellum/client/types/test_suite_test_case_deleted_bulk_result.py +3 -3
- vellum/client/types/test_suite_test_case_deleted_bulk_result_data.py +2 -2
- vellum/client/types/test_suite_test_case_rejected_bulk_result.py +2 -2
- vellum/client/types/test_suite_test_case_replace_bulk_operation_request.py +10 -4
- vellum/client/types/test_suite_test_case_replaced_bulk_result.py +3 -3
- vellum/client/types/test_suite_test_case_replaced_bulk_result_data.py +2 -2
- vellum/client/types/test_suite_test_case_upsert_bulk_operation_request.py +10 -4
- vellum/client/types/thinking_vellum_value.py +3 -3
- vellum/client/types/thinking_vellum_value_request.py +3 -3
- vellum/client/types/token_overlapping_window_chunker_config.py +2 -2
- vellum/client/types/token_overlapping_window_chunker_config_request.py +2 -2
- vellum/client/types/token_overlapping_window_chunking.py +3 -3
- vellum/client/types/token_overlapping_window_chunking_request.py +3 -3
- vellum/client/types/upload_document_response.py +3 -3
- vellum/client/types/upsert_test_suite_test_case_request.py +9 -3
- vellum/client/types/variable_prompt_block.py +4 -4
- vellum/client/types/vellum_audio.py +3 -3
- vellum/client/types/vellum_audio_request.py +3 -3
- vellum/client/types/vellum_code_resource_definition.py +2 -2
- vellum/client/types/vellum_document.py +2 -2
- vellum/client/types/vellum_document_request.py +2 -2
- vellum/client/types/vellum_error.py +3 -3
- vellum/client/types/vellum_error_request.py +3 -3
- vellum/client/types/vellum_image.py +2 -2
- vellum/client/types/vellum_image_request.py +2 -2
- vellum/client/types/vellum_node_execution_event.py +4 -3
- vellum/client/types/vellum_sdk_error.py +3 -3
- vellum/client/types/vellum_secret.py +2 -2
- vellum/client/types/vellum_span.py +2 -1
- vellum/client/types/vellum_value.py +11 -8
- vellum/client/types/vellum_value_logical_condition_group_request.py +6 -6
- vellum/client/types/vellum_value_logical_condition_request.py +13 -7
- vellum/client/types/vellum_value_logical_expression_request.py +2 -1
- vellum/client/types/vellum_value_request.py +11 -8
- vellum/client/types/vellum_variable.py +13 -7
- vellum/client/types/vellum_variable_extensions.py +2 -2
- vellum/client/types/vellum_variable_type.py +2 -1
- vellum/client/types/vellum_video.py +24 -0
- vellum/client/types/vellum_video_request.py +24 -0
- vellum/client/types/vellum_workflow_execution_event.py +4 -3
- vellum/client/types/video_chat_message_content.py +25 -0
- vellum/client/types/video_chat_message_content_request.py +25 -0
- vellum/client/types/video_prompt_block.py +29 -0
- vellum/client/types/video_vellum_value.py +25 -0
- vellum/client/types/video_vellum_value_request.py +25 -0
- vellum/client/types/workflow_deployment_event_executions_response.py +18 -12
- vellum/client/types/workflow_deployment_history_item.py +10 -4
- vellum/client/types/workflow_deployment_parent_context.py +11 -11
- vellum/client/types/workflow_deployment_read.py +11 -5
- vellum/client/types/workflow_deployment_release.py +13 -7
- vellum/client/types/workflow_deployment_release_workflow_deployment.py +2 -2
- vellum/client/types/workflow_deployment_release_workflow_version.py +10 -4
- vellum/client/types/workflow_error.py +1 -0
- vellum/client/types/workflow_event_error.py +3 -3
- vellum/client/types/workflow_event_execution_read.py +22 -16
- vellum/client/types/workflow_execution_actual.py +10 -4
- vellum/client/types/workflow_execution_actual_chat_history_request.py +2 -2
- vellum/client/types/workflow_execution_actual_json_request.py +2 -2
- vellum/client/types/workflow_execution_actual_string_request.py +2 -2
- vellum/client/types/workflow_execution_detail.py +22 -16
- vellum/client/types/workflow_execution_fulfilled_body.py +3 -3
- vellum/client/types/workflow_execution_fulfilled_event.py +22 -16
- vellum/client/types/workflow_execution_initiated_body.py +3 -3
- vellum/client/types/workflow_execution_initiated_event.py +22 -16
- vellum/client/types/workflow_execution_node_result_event.py +10 -4
- vellum/client/types/workflow_execution_paused_body.py +4 -4
- vellum/client/types/workflow_execution_paused_event.py +22 -16
- vellum/client/types/workflow_execution_rejected_body.py +4 -4
- vellum/client/types/workflow_execution_rejected_event.py +22 -16
- vellum/client/types/workflow_execution_resumed_body.py +3 -3
- vellum/client/types/workflow_execution_resumed_event.py +22 -16
- vellum/client/types/workflow_execution_snapshotted_body.py +3 -3
- vellum/client/types/workflow_execution_snapshotted_event.py +22 -16
- vellum/client/types/workflow_execution_span.py +20 -12
- vellum/client/types/workflow_execution_span_attributes.py +2 -2
- vellum/client/types/workflow_execution_streaming_body.py +4 -4
- vellum/client/types/workflow_execution_streaming_event.py +22 -16
- vellum/client/types/workflow_execution_usage_calculation_error.py +3 -3
- vellum/client/types/workflow_execution_usage_calculation_fulfilled_body.py +22 -0
- vellum/client/types/workflow_execution_usage_result.py +3 -3
- vellum/client/types/workflow_execution_view_online_eval_metric_result.py +10 -4
- vellum/client/types/workflow_execution_workflow_result_event.py +10 -4
- vellum/client/types/workflow_expand_meta_request.py +2 -2
- vellum/client/types/workflow_initialization_error.py +2 -2
- vellum/client/types/workflow_node_result_data.py +8 -7
- vellum/client/types/workflow_node_result_event.py +3 -2
- vellum/client/types/workflow_output.py +6 -5
- vellum/client/types/workflow_output_array.py +12 -6
- vellum/client/types/workflow_output_chat_history.py +3 -3
- vellum/client/types/workflow_output_error.py +3 -3
- vellum/client/types/workflow_output_function_call.py +3 -3
- vellum/client/types/workflow_output_image.py +3 -3
- vellum/client/types/workflow_output_json.py +3 -3
- vellum/client/types/workflow_output_number.py +3 -3
- vellum/client/types/workflow_output_search_results.py +3 -3
- vellum/client/types/workflow_output_string.py +3 -3
- vellum/client/types/workflow_parent_context.py +12 -12
- vellum/client/types/workflow_push_deployment_config_request.py +2 -2
- vellum/client/types/workflow_push_response.py +2 -2
- vellum/client/types/workflow_release_tag_read.py +4 -4
- vellum/client/types/workflow_release_tag_workflow_deployment_history_item.py +2 -2
- vellum/client/types/workflow_request_chat_history_input_request.py +3 -3
- vellum/client/types/workflow_request_input_request.py +3 -2
- vellum/client/types/workflow_request_json_input_request.py +3 -3
- vellum/client/types/workflow_request_number_input_request.py +3 -3
- vellum/client/types/workflow_request_string_input_request.py +3 -3
- vellum/client/types/workflow_result_event.py +13 -7
- vellum/client/types/workflow_result_event_output_data.py +7 -6
- vellum/client/types/workflow_result_event_output_data_array.py +12 -6
- vellum/client/types/workflow_result_event_output_data_chat_history.py +3 -3
- vellum/client/types/workflow_result_event_output_data_error.py +3 -3
- vellum/client/types/workflow_result_event_output_data_function_call.py +3 -3
- vellum/client/types/workflow_result_event_output_data_json.py +3 -3
- vellum/client/types/workflow_result_event_output_data_number.py +3 -3
- vellum/client/types/workflow_result_event_output_data_search_results.py +3 -3
- vellum/client/types/workflow_result_event_output_data_string.py +3 -3
- vellum/client/types/workflow_sandbox_example.py +2 -2
- vellum/client/types/workflow_sandbox_parent_context.py +11 -11
- vellum/client/types/workflow_stream_event.py +2 -1
- vellum/client/types/workspace_read.py +3 -3
- vellum/client/types/workspace_secret_read.py +3 -3
- vellum/core/force_multipart.py +3 -0
- vellum/prompts/blocks/compilation.py +22 -10
- vellum/types/vellum_video.py +3 -0
- vellum/types/vellum_video_request.py +3 -0
- vellum/types/video_chat_message_content.py +3 -0
- vellum/types/video_chat_message_content_request.py +3 -0
- vellum/types/video_prompt_block.py +3 -0
- vellum/types/video_vellum_value.py +3 -0
- vellum/types/video_vellum_value_request.py +3 -0
- vellum/types/workflow_execution_usage_calculation_fulfilled_body.py +3 -0
- vellum/workflows/events/node.py +25 -10
- vellum/workflows/events/tests/test_event.py +19 -19
- vellum/workflows/events/workflow.py +11 -0
- vellum/workflows/graph/graph.py +103 -1
- vellum/workflows/graph/tests/test_graph.py +99 -0
- vellum/workflows/nodes/bases/base.py +9 -1
- vellum/workflows/nodes/displayable/bases/utils.py +4 -2
- vellum/workflows/nodes/displayable/tool_calling_node/node.py +19 -18
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_node.py +17 -7
- vellum/workflows/nodes/displayable/tool_calling_node/tests/test_utils.py +7 -7
- vellum/workflows/nodes/displayable/tool_calling_node/utils.py +47 -80
- vellum/workflows/references/environment_variable.py +10 -0
- vellum/workflows/runner/runner.py +18 -2
- vellum/workflows/state/context.py +101 -12
- vellum/workflows/state/encoder.py +2 -4
- vellum/workflows/types/definition.py +11 -1
- vellum/workflows/types/tests/test_definition.py +19 -0
- vellum/workflows/utils/functions.py +1 -1
- vellum/workflows/utils/vellum_variables.py +9 -5
- vellum/workflows/workflows/base.py +12 -5
- {vellum_ai-1.1.2.dist-info → vellum_ai-1.1.4.dist-info}/METADATA +2 -2
- {vellum_ai-1.1.2.dist-info → vellum_ai-1.1.4.dist-info}/RECORD +693 -675
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +1 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_code_execution_node.py +55 -1
- vellum_ee/workflows/display/nodes/vellum/tests/test_tool_calling_node.py +164 -47
- vellum_ee/workflows/display/tests/workflow_serialization/test_basic_tool_calling_node_mcp_serialization.py +15 -49
- vellum_ee/workflows/display/types.py +14 -1
- vellum_ee/workflows/display/utils/expressions.py +13 -4
- vellum_ee/workflows/display/workflows/base_workflow_display.py +6 -19
- {vellum_ai-1.1.2.dist-info → vellum_ai-1.1.4.dist-info}/LICENSE +0 -0
- {vellum_ai-1.1.2.dist-info → vellum_ai-1.1.4.dist-info}/WHEEL +0 -0
- {vellum_ai-1.1.2.dist-info → vellum_ai-1.1.4.dist-info}/entry_points.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import pytest
|
2
|
-
from datetime import datetime
|
2
|
+
from datetime import datetime, timezone
|
3
3
|
from uuid import UUID
|
4
4
|
|
5
5
|
from deepdiff import DeepDiff
|
@@ -64,7 +64,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
64
64
|
(
|
65
65
|
WorkflowExecutionInitiatedEvent(
|
66
66
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
67
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
67
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
68
68
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
69
69
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
70
70
|
body=WorkflowExecutionInitiatedBody(
|
@@ -75,7 +75,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
75
75
|
{
|
76
76
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
77
77
|
"api_version": "2024-10-25",
|
78
|
-
"timestamp": "2024-01-01T12:00:
|
78
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
79
79
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
80
80
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
81
81
|
"name": "workflow.execution.initiated",
|
@@ -97,7 +97,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
97
97
|
(
|
98
98
|
NodeExecutionInitiatedEvent(
|
99
99
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
100
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
100
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
101
101
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
102
102
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
103
103
|
body=NodeExecutionInitiatedBody(
|
@@ -119,7 +119,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
119
119
|
{
|
120
120
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
121
121
|
"api_version": "2024-10-25",
|
122
|
-
"timestamp": "2024-01-01T12:00:
|
122
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
123
123
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
124
124
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
125
125
|
"name": "node.execution.initiated",
|
@@ -160,7 +160,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
160
160
|
(
|
161
161
|
WorkflowExecutionStreamingEvent(
|
162
162
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
163
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
163
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
164
164
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
165
165
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
166
166
|
body=WorkflowExecutionStreamingBody(
|
@@ -174,7 +174,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
174
174
|
{
|
175
175
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
176
176
|
"api_version": "2024-10-25",
|
177
|
-
"timestamp": "2024-01-01T12:00:
|
177
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
178
178
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
179
179
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
180
180
|
"name": "workflow.execution.streaming",
|
@@ -195,7 +195,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
195
195
|
(
|
196
196
|
WorkflowExecutionFulfilledEvent(
|
197
197
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
198
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
198
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
199
199
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
200
200
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
201
201
|
body=WorkflowExecutionFulfilledBody(
|
@@ -208,7 +208,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
208
208
|
{
|
209
209
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
210
210
|
"api_version": "2024-10-25",
|
211
|
-
"timestamp": "2024-01-01T12:00:
|
211
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
212
212
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
213
213
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
214
214
|
"name": "workflow.execution.fulfilled",
|
@@ -228,7 +228,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
228
228
|
(
|
229
229
|
WorkflowExecutionRejectedEvent(
|
230
230
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
231
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
231
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
232
232
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
233
233
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
234
234
|
body=WorkflowExecutionRejectedBody(
|
@@ -242,7 +242,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
242
242
|
{
|
243
243
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
244
244
|
"api_version": "2024-10-25",
|
245
|
-
"timestamp": "2024-01-01T12:00:
|
245
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
246
246
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
247
247
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
248
248
|
"name": "workflow.execution.rejected",
|
@@ -263,7 +263,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
263
263
|
(
|
264
264
|
NodeExecutionStreamingEvent(
|
265
265
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
266
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
266
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
267
267
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
268
268
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
269
269
|
body=NodeExecutionStreamingBody(
|
@@ -277,7 +277,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
277
277
|
{
|
278
278
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
279
279
|
"api_version": "2024-10-25",
|
280
|
-
"timestamp": "2024-01-01T12:00:
|
280
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
281
281
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
282
282
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
283
283
|
"name": "node.execution.streaming",
|
@@ -298,7 +298,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
298
298
|
(
|
299
299
|
NodeExecutionFulfilledEvent(
|
300
300
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
301
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
301
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
302
302
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
303
303
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
304
304
|
body=NodeExecutionFulfilledBody(
|
@@ -312,7 +312,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
312
312
|
{
|
313
313
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
314
314
|
"api_version": "2024-10-25",
|
315
|
-
"timestamp": "2024-01-01T12:00:
|
315
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
316
316
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
317
317
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
318
318
|
"name": "node.execution.fulfilled",
|
@@ -338,7 +338,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
338
338
|
(
|
339
339
|
NodeExecutionFulfilledEvent(
|
340
340
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
341
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
341
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
342
342
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
343
343
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
344
344
|
body=NodeExecutionFulfilledBody(
|
@@ -352,7 +352,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
352
352
|
{
|
353
353
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
354
354
|
"api_version": "2024-10-25",
|
355
|
-
"timestamp": "2024-01-01T12:00:
|
355
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
356
356
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
357
357
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
358
358
|
"name": "node.execution.fulfilled",
|
@@ -376,7 +376,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
376
376
|
(
|
377
377
|
NodeExecutionFulfilledEvent(
|
378
378
|
id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
379
|
-
timestamp=datetime(2024, 1, 1, 12, 0, 0),
|
379
|
+
timestamp=datetime(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc),
|
380
380
|
trace_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
381
381
|
span_id=UUID("123e4567-e89b-12d3-a456-426614174000"),
|
382
382
|
body=NodeExecutionFulfilledBody(
|
@@ -390,7 +390,7 @@ mock_node_uuid = str(uuid4_from_hash(MockNode.__qualname__))
|
|
390
390
|
{
|
391
391
|
"id": "123e4567-e89b-12d3-a456-426614174000",
|
392
392
|
"api_version": "2024-10-25",
|
393
|
-
"timestamp": "2024-01-01T12:00:
|
393
|
+
"timestamp": "2024-01-01T12:00:00Z",
|
394
394
|
"trace_id": "123e4567-e89b-12d3-a456-426614174000",
|
395
395
|
"span_id": "123e4567-e89b-12d3-a456-426614174000",
|
396
396
|
"name": "node.execution.fulfilled",
|
@@ -41,6 +41,17 @@ class _BaseWorkflowEvent(BaseEvent):
|
|
41
41
|
def workflow_definition(self) -> Type["BaseWorkflow"]:
|
42
42
|
return self.body.workflow_definition
|
43
43
|
|
44
|
+
@property
|
45
|
+
def monitoring_url(self) -> Optional[str]:
|
46
|
+
"""
|
47
|
+
Get the monitoring URL for this workflow execution.
|
48
|
+
|
49
|
+
Returns:
|
50
|
+
The URL to view execution details in Vellum UI, or None if monitoring is disabled
|
51
|
+
or context is not available.
|
52
|
+
"""
|
53
|
+
return None
|
54
|
+
|
44
55
|
|
45
56
|
class NodeEventDisplayContext(UniversalBaseModel):
|
46
57
|
input_display: Dict[str, UUID]
|
vellum/workflows/graph/graph.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Iterator, List, Set, Type, Union
|
1
|
+
from typing import TYPE_CHECKING, Iterator, List, Optional, Set, Type, Union
|
2
2
|
|
3
3
|
from orderly_set import OrderedSet
|
4
4
|
|
@@ -154,3 +154,105 @@ class Graph:
|
|
154
154
|
for edge in edges:
|
155
155
|
if edge not in self._edges:
|
156
156
|
self._edges.append(edge)
|
157
|
+
|
158
|
+
def __str__(self) -> str:
|
159
|
+
"""
|
160
|
+
Return a visual ASCII representation of the graph showing the flow structure.
|
161
|
+
"""
|
162
|
+
if not self._edges and not self._entrypoints:
|
163
|
+
return "Graph(empty)"
|
164
|
+
|
165
|
+
if not self._edges:
|
166
|
+
if len(self._entrypoints) == 1:
|
167
|
+
port = next(iter(self._entrypoints))
|
168
|
+
return f"Graph: {self._get_port_name(port)}"
|
169
|
+
else:
|
170
|
+
port_names = [self._get_port_name(port) for port in self._entrypoints]
|
171
|
+
return f"Graph: [{', '.join(port_names)}]"
|
172
|
+
|
173
|
+
return self._build_flow_diagram()
|
174
|
+
|
175
|
+
def _build_flow_diagram(self) -> str:
|
176
|
+
"""Build a connected flow diagram showing the graph structure."""
|
177
|
+
lines = ["Graph:"]
|
178
|
+
|
179
|
+
adjacency: dict[str, list[str]] = {}
|
180
|
+
all_nodes = set()
|
181
|
+
|
182
|
+
for edge in self._edges:
|
183
|
+
source_node = edge.from_port.node_class.__name__
|
184
|
+
target_node = edge.to_node.__name__
|
185
|
+
|
186
|
+
all_nodes.add(source_node)
|
187
|
+
all_nodes.add(target_node)
|
188
|
+
|
189
|
+
if source_node not in adjacency:
|
190
|
+
adjacency[source_node] = []
|
191
|
+
adjacency[source_node].append(target_node)
|
192
|
+
|
193
|
+
target_nodes = set()
|
194
|
+
for edges in adjacency.values():
|
195
|
+
target_nodes.update(edges)
|
196
|
+
|
197
|
+
root_nodes = []
|
198
|
+
for port in self._entrypoints:
|
199
|
+
node_name = port.node_class.__name__
|
200
|
+
if node_name not in target_nodes:
|
201
|
+
root_nodes.append(node_name)
|
202
|
+
|
203
|
+
if not root_nodes and self._entrypoints:
|
204
|
+
root_nodes = [next(iter(self._entrypoints)).node_class.__name__]
|
205
|
+
|
206
|
+
visited = set()
|
207
|
+
currently_visiting = set()
|
208
|
+
|
209
|
+
def render_node(node: str, prefix: str = " ", is_last: bool = True, path: Optional[List[str]] = None) -> None:
|
210
|
+
if path is None:
|
211
|
+
path = []
|
212
|
+
|
213
|
+
if node in currently_visiting:
|
214
|
+
lines.append(f"{prefix}{'└─' if is_last else '├─'} {node} ⟲ (loops back)")
|
215
|
+
return
|
216
|
+
|
217
|
+
if node in visited:
|
218
|
+
lines.append(f"{prefix}{'└─' if is_last else '├─'} {node} → (see above)")
|
219
|
+
return
|
220
|
+
|
221
|
+
visited.add(node)
|
222
|
+
currently_visiting.add(node)
|
223
|
+
|
224
|
+
lines.append(f"{prefix}{'└─' if is_last else '├─'} {node}")
|
225
|
+
|
226
|
+
if node in adjacency:
|
227
|
+
children = adjacency[node]
|
228
|
+
for i, child in enumerate(children):
|
229
|
+
child_is_last = i == len(children) - 1
|
230
|
+
next_prefix = prefix + (" " if is_last else "│ ")
|
231
|
+
render_node(child, next_prefix, child_is_last, path + [node])
|
232
|
+
|
233
|
+
currently_visiting.remove(node)
|
234
|
+
|
235
|
+
for i, root in enumerate(root_nodes):
|
236
|
+
is_last_root = i == len(root_nodes) - 1
|
237
|
+
render_node(root, " ", is_last_root)
|
238
|
+
|
239
|
+
return "\n".join(lines)
|
240
|
+
|
241
|
+
def _get_port_name(self, port: "Port") -> str:
|
242
|
+
"""Get a readable name for a port."""
|
243
|
+
try:
|
244
|
+
if hasattr(port, "node_class") and hasattr(port.node_class, "__name__"):
|
245
|
+
node_name = port.node_class.__name__
|
246
|
+
port_name = getattr(port, "name", "unknown")
|
247
|
+
return f"{node_name}.{port_name}"
|
248
|
+
else:
|
249
|
+
return str(port)
|
250
|
+
except Exception:
|
251
|
+
return f"<Port:{getattr(port, 'name', 'unknown')}>"
|
252
|
+
|
253
|
+
def _get_node_name(self, node: Type["BaseNode"]) -> str:
|
254
|
+
"""Get a readable name for a node."""
|
255
|
+
try:
|
256
|
+
return getattr(node, "__name__", str(node))
|
257
|
+
except Exception:
|
258
|
+
return "<Node:unknown>"
|
@@ -484,3 +484,102 @@ def test_graph__set_to_graph():
|
|
484
484
|
|
485
485
|
# AND two edges
|
486
486
|
assert len(list(graph.edges)) == 2
|
487
|
+
|
488
|
+
|
489
|
+
def test_graph__str_simple_linear():
|
490
|
+
# GIVEN a simple linear graph: A -> B -> C
|
491
|
+
class NodeA(BaseNode):
|
492
|
+
pass
|
493
|
+
|
494
|
+
class NodeB(BaseNode):
|
495
|
+
pass
|
496
|
+
|
497
|
+
class NodeC(BaseNode):
|
498
|
+
pass
|
499
|
+
|
500
|
+
graph = NodeA >> NodeB >> NodeC
|
501
|
+
|
502
|
+
# WHEN we convert the graph to string
|
503
|
+
result = str(graph)
|
504
|
+
|
505
|
+
# THEN it shows the linear flow structure
|
506
|
+
expected_lines = ["Graph:", " └─ NodeA", " └─ NodeB", " └─ NodeC"]
|
507
|
+
assert result == "\n".join(expected_lines)
|
508
|
+
|
509
|
+
|
510
|
+
def test_graph__str_with_branching():
|
511
|
+
# GIVEN a graph with branching: A -> {B, C}
|
512
|
+
class NodeA(BaseNode):
|
513
|
+
pass
|
514
|
+
|
515
|
+
class NodeB(BaseNode):
|
516
|
+
pass
|
517
|
+
|
518
|
+
class NodeC(BaseNode):
|
519
|
+
pass
|
520
|
+
|
521
|
+
graph = NodeA >> {NodeB, NodeC}
|
522
|
+
|
523
|
+
# WHEN we convert the graph to string
|
524
|
+
result = str(graph)
|
525
|
+
|
526
|
+
# THEN it shows the branching structure
|
527
|
+
# Note: The order might vary due to set ordering, so we check for the structure
|
528
|
+
lines = result.split("\n")
|
529
|
+
assert lines[0] == "Graph:"
|
530
|
+
assert lines[1] == " └─ NodeA"
|
531
|
+
|
532
|
+
# Should have two branches (order may vary)
|
533
|
+
branch_lines = [line.strip() for line in lines[2:] if line.strip()]
|
534
|
+
assert len(branch_lines) == 2
|
535
|
+
assert any("NodeB" in line for line in branch_lines)
|
536
|
+
assert any("NodeC" in line for line in branch_lines)
|
537
|
+
assert all(line.startswith("├─ ") or line.startswith("└─ ") for line in branch_lines)
|
538
|
+
|
539
|
+
|
540
|
+
def test_graph__str_with_loop():
|
541
|
+
# GIVEN a graph with a loop: A -> B -> A (loop back)
|
542
|
+
class NodeA(BaseNode):
|
543
|
+
pass
|
544
|
+
|
545
|
+
class NodeB(BaseNode):
|
546
|
+
pass
|
547
|
+
|
548
|
+
# Create the loop manually using edges
|
549
|
+
edge1 = Edge(NodeA.Ports.default, NodeB)
|
550
|
+
edge2 = Edge(NodeB.Ports.default, NodeA)
|
551
|
+
|
552
|
+
graph = Graph(entrypoints={NodeA.Ports.default}, edges=[edge1, edge2], terminals={NodeA.Ports.default})
|
553
|
+
|
554
|
+
# WHEN we convert the graph to string
|
555
|
+
result = str(graph)
|
556
|
+
|
557
|
+
# THEN it shows the loop with cycle detection
|
558
|
+
expected_lines = ["Graph:", " └─ NodeA", " └─ NodeB", " └─ NodeA ⟲ (loops back)"]
|
559
|
+
assert result == "\n".join(expected_lines)
|
560
|
+
|
561
|
+
|
562
|
+
def test_graph__str_empty_graph():
|
563
|
+
# GIVEN an empty graph
|
564
|
+
graph = Graph(entrypoints=set(), edges=[], terminals=set())
|
565
|
+
|
566
|
+
# WHEN we convert the graph to string
|
567
|
+
result = str(graph)
|
568
|
+
|
569
|
+
# THEN it shows empty graph message
|
570
|
+
assert result == "Graph(empty)"
|
571
|
+
|
572
|
+
|
573
|
+
def test_graph__str_single_node():
|
574
|
+
# GIVEN a graph with just one node and no edges
|
575
|
+
class SingleNode(BaseNode):
|
576
|
+
pass
|
577
|
+
|
578
|
+
graph = Graph.from_node(SingleNode)
|
579
|
+
|
580
|
+
# WHEN we convert the graph to string
|
581
|
+
result = str(graph)
|
582
|
+
|
583
|
+
# THEN it shows the single node
|
584
|
+
assert "SingleNode.default" in result
|
585
|
+
assert "Graph:" in result
|
@@ -8,6 +8,7 @@ from typing import Any, Dict, Generic, Iterator, Optional, Set, Tuple, Type, Typ
|
|
8
8
|
|
9
9
|
from vellum.workflows.constants import undefined
|
10
10
|
from vellum.workflows.descriptors.base import BaseDescriptor
|
11
|
+
from vellum.workflows.descriptors.exceptions import InvalidExpressionException
|
11
12
|
from vellum.workflows.descriptors.utils import is_unresolved, resolve_value
|
12
13
|
from vellum.workflows.errors.types import WorkflowErrorCode
|
13
14
|
from vellum.workflows.events.node import NodeExecutionStreamingEvent
|
@@ -302,7 +303,14 @@ class BaseNode(Generic[StateType], ABC, metaclass=BaseNodeMeta):
|
|
302
303
|
if not descriptor.instance:
|
303
304
|
continue
|
304
305
|
|
305
|
-
|
306
|
+
try:
|
307
|
+
resolved_value = resolve_value(descriptor.instance, state, path=descriptor.name)
|
308
|
+
except InvalidExpressionException as e:
|
309
|
+
raise NodeException(
|
310
|
+
message=str(e),
|
311
|
+
code=WorkflowErrorCode.INVALID_INPUTS,
|
312
|
+
) from e
|
313
|
+
|
306
314
|
if is_unresolved(resolved_value):
|
307
315
|
return False
|
308
316
|
|
@@ -35,8 +35,9 @@ VELLUM_VALUE_REQUEST_TUPLE = (
|
|
35
35
|
StringVellumValueRequest,
|
36
36
|
NumberVellumValueRequest,
|
37
37
|
JsonVellumValueRequest,
|
38
|
-
ImageVellumValueRequest,
|
39
38
|
AudioVellumValueRequest,
|
39
|
+
# VideoVellumValueRequest,
|
40
|
+
ImageVellumValueRequest,
|
40
41
|
FunctionCallVellumValueRequest,
|
41
42
|
ErrorVellumValueRequest,
|
42
43
|
ArrayVellumValueRequest,
|
@@ -78,8 +79,9 @@ def primitive_to_vellum_value(value: Any) -> VellumValue:
|
|
78
79
|
StringVellumValue,
|
79
80
|
NumberVellumValue,
|
80
81
|
JsonVellumValue,
|
81
|
-
ImageVellumValue,
|
82
82
|
AudioVellumValue,
|
83
|
+
# VideoVellumValue,
|
84
|
+
ImageVellumValue,
|
83
85
|
FunctionCallVellumValue,
|
84
86
|
ErrorVellumValue,
|
85
87
|
ArrayVellumValue,
|
@@ -16,7 +16,7 @@ from vellum.workflows.nodes.displayable.tool_calling_node.utils import (
|
|
16
16
|
create_function_node,
|
17
17
|
create_mcp_tool_node,
|
18
18
|
create_router_node,
|
19
|
-
|
19
|
+
create_tool_prompt_node,
|
20
20
|
get_function_name,
|
21
21
|
get_mcp_tool_name,
|
22
22
|
hydrate_mcp_tool_definitions,
|
@@ -78,7 +78,7 @@ class ToolCallingNode(BaseNode[StateType], Generic[StateType]):
|
|
78
78
|
graph = self._graph
|
79
79
|
|
80
80
|
class Outputs(BaseWorkflow.Outputs):
|
81
|
-
text: str = self.
|
81
|
+
text: str = self.tool_prompt_node.Outputs.text
|
82
82
|
chat_history: List[ChatMessage] = ToolCallingState.chat_history
|
83
83
|
|
84
84
|
subworkflow = ToolCallingWorkflow(
|
@@ -137,7 +137,7 @@ class ToolCallingNode(BaseNode[StateType], Generic[StateType]):
|
|
137
137
|
)
|
138
138
|
|
139
139
|
def _build_graph(self) -> None:
|
140
|
-
self.
|
140
|
+
self.tool_prompt_node = create_tool_prompt_node(
|
141
141
|
ml_model=self.ml_model,
|
142
142
|
blocks=self.blocks,
|
143
143
|
functions=self.functions,
|
@@ -146,9 +146,10 @@ class ToolCallingNode(BaseNode[StateType], Generic[StateType]):
|
|
146
146
|
max_prompt_iterations=self.max_prompt_iterations,
|
147
147
|
)
|
148
148
|
|
149
|
+
# Create the router node (handles routing logic only)
|
149
150
|
self.router_node = create_router_node(
|
150
151
|
functions=self.functions,
|
151
|
-
|
152
|
+
tool_prompt_node=self.tool_prompt_node,
|
152
153
|
)
|
153
154
|
|
154
155
|
self._function_nodes = {}
|
@@ -160,29 +161,29 @@ class ToolCallingNode(BaseNode[StateType], Generic[StateType]):
|
|
160
161
|
|
161
162
|
self._function_nodes[function_name] = create_mcp_tool_node(
|
162
163
|
tool_def=tool_definition,
|
163
|
-
|
164
|
+
tool_prompt_node=self.tool_prompt_node,
|
164
165
|
)
|
165
166
|
else:
|
166
167
|
function_name = get_function_name(function)
|
167
168
|
|
168
169
|
self._function_nodes[function_name] = create_function_node(
|
169
170
|
function=function,
|
170
|
-
|
171
|
+
tool_prompt_node=self.tool_prompt_node,
|
171
172
|
)
|
172
173
|
|
173
|
-
|
174
|
+
graph: Graph = self.tool_prompt_node >> self.router_node
|
174
175
|
|
175
|
-
# Add connections from ports of router to function nodes and back to router
|
176
176
|
for function_name, FunctionNodeClass in self._function_nodes.items():
|
177
|
-
router_port = getattr(self.
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
else_node = create_else_node(self.
|
182
|
-
|
183
|
-
else_node.Ports.
|
184
|
-
else_node.Ports.
|
177
|
+
router_port = getattr(self.router_node.Ports, function_name)
|
178
|
+
function_subgraph = router_port >> FunctionNodeClass >> self.router_node
|
179
|
+
graph._extend_edges(function_subgraph.edges)
|
180
|
+
|
181
|
+
else_node = create_else_node(self.tool_prompt_node)
|
182
|
+
default_port_graph = self.router_node.Ports.default >> {
|
183
|
+
else_node.Ports.loop_to_router >> self.router_node, # More outputs to process
|
184
|
+
else_node.Ports.loop_to_prompt >> self.tool_prompt_node, # Need new prompt iteration
|
185
|
+
else_node.Ports.end, # Finished
|
185
186
|
}
|
186
|
-
|
187
|
+
graph._extend_edges(default_port_graph.edges)
|
187
188
|
|
188
|
-
self._graph =
|
189
|
+
self._graph = graph
|
@@ -16,7 +16,11 @@ from vellum.workflows.inputs.base import BaseInputs
|
|
16
16
|
from vellum.workflows.nodes.bases import BaseNode
|
17
17
|
from vellum.workflows.nodes.displayable.tool_calling_node.node import ToolCallingNode
|
18
18
|
from vellum.workflows.nodes.displayable.tool_calling_node.state import ToolCallingState
|
19
|
-
from vellum.workflows.nodes.displayable.tool_calling_node.utils import
|
19
|
+
from vellum.workflows.nodes.displayable.tool_calling_node.utils import (
|
20
|
+
create_function_node,
|
21
|
+
create_router_node,
|
22
|
+
create_tool_prompt_node,
|
23
|
+
)
|
20
24
|
from vellum.workflows.outputs.base import BaseOutputs
|
21
25
|
from vellum.workflows.state.base import BaseState, StateMeta
|
22
26
|
from vellum.workflows.state.context import WorkflowContext
|
@@ -35,8 +39,8 @@ def test_port_condition_match_function_name():
|
|
35
39
|
"""
|
36
40
|
Test that the port condition correctly matches the function name.
|
37
41
|
"""
|
38
|
-
# GIVEN a tool
|
39
|
-
|
42
|
+
# GIVEN a tool prompt node
|
43
|
+
tool_prompt_node = create_tool_prompt_node(
|
40
44
|
ml_model="test-model",
|
41
45
|
blocks=[],
|
42
46
|
functions=[first_function, second_function],
|
@@ -44,11 +48,17 @@ def test_port_condition_match_function_name():
|
|
44
48
|
parameters=DEFAULT_PROMPT_PARAMETERS,
|
45
49
|
)
|
46
50
|
|
51
|
+
# AND a router node that references the tool prompt node
|
52
|
+
router_node = create_router_node(
|
53
|
+
functions=[first_function, second_function],
|
54
|
+
tool_prompt_node=tool_prompt_node,
|
55
|
+
)
|
56
|
+
|
47
57
|
# AND a state with a function call to the first function
|
48
58
|
state = ToolCallingState(
|
49
59
|
meta=StateMeta(
|
50
60
|
node_outputs={
|
51
|
-
|
61
|
+
tool_prompt_node.Outputs.results: [
|
52
62
|
FunctionCallVellumValue(
|
53
63
|
value=FunctionCall(
|
54
64
|
arguments={}, id="call_zp7pBQjGAOBCr7lo0AbR1HXT", name="first_function", state="FULFILLED"
|
@@ -93,8 +103,8 @@ def test_tool_calling_node_inline_workflow_context():
|
|
93
103
|
class Outputs(BaseOutputs):
|
94
104
|
generated_files = MyNode.Outputs.generated_files
|
95
105
|
|
96
|
-
# GIVEN a tool
|
97
|
-
|
106
|
+
# GIVEN a tool prompt node
|
107
|
+
tool_prompt_node = create_tool_prompt_node(
|
98
108
|
ml_model="test-model",
|
99
109
|
blocks=[],
|
100
110
|
functions=[MyWorkflow],
|
@@ -105,7 +115,7 @@ def test_tool_calling_node_inline_workflow_context():
|
|
105
115
|
# WHEN we create a function node for the workflow
|
106
116
|
function_node_class = create_function_node(
|
107
117
|
function=MyWorkflow,
|
108
|
-
|
118
|
+
tool_prompt_node=tool_prompt_node,
|
109
119
|
)
|
110
120
|
|
111
121
|
# AND we create an instance with a context containing generated_files
|
@@ -13,7 +13,7 @@ from vellum.workflows import BaseWorkflow
|
|
13
13
|
from vellum.workflows.inputs.base import BaseInputs
|
14
14
|
from vellum.workflows.nodes.bases import BaseNode
|
15
15
|
from vellum.workflows.nodes.displayable.tool_calling_node.utils import (
|
16
|
-
|
16
|
+
create_tool_prompt_node,
|
17
17
|
get_function_name,
|
18
18
|
get_mcp_tool_name,
|
19
19
|
)
|
@@ -104,9 +104,9 @@ def test_get_function_name_composio_tool_definition_various_toolkits(
|
|
104
104
|
assert result == expected_result
|
105
105
|
|
106
106
|
|
107
|
-
def
|
107
|
+
def test_create_tool_prompt_node_max_prompt_iterations(vellum_adhoc_prompt_client):
|
108
108
|
# GIVEN a tool router node with max_prompt_iterations set to None
|
109
|
-
|
109
|
+
tool_prompt_node = create_tool_prompt_node(
|
110
110
|
ml_model="gpt-4o-mini",
|
111
111
|
blocks=[],
|
112
112
|
functions=[],
|
@@ -129,7 +129,7 @@ def test_create_tool_router_node_max_prompt_iterations(vellum_adhoc_prompt_clien
|
|
129
129
|
vellum_adhoc_prompt_client.adhoc_execute_prompt_stream.side_effect = generate_prompt_events
|
130
130
|
|
131
131
|
# WHEN we run the tool router node
|
132
|
-
node_instance =
|
132
|
+
node_instance = tool_prompt_node()
|
133
133
|
outputs = list(node_instance.run())
|
134
134
|
assert outputs[0].name == "results"
|
135
135
|
assert outputs[0].value == [StringVellumValue(type="STRING", value="test output")]
|
@@ -137,7 +137,7 @@ def test_create_tool_router_node_max_prompt_iterations(vellum_adhoc_prompt_clien
|
|
137
137
|
assert outputs[1].value == "test output"
|
138
138
|
|
139
139
|
|
140
|
-
def
|
140
|
+
def test_create_tool_prompt_node_chat_history_block_dict(vellum_adhoc_prompt_client):
|
141
141
|
# GIVEN a list of blocks with a chat history block
|
142
142
|
blocks = [
|
143
143
|
{
|
@@ -165,7 +165,7 @@ def test_create_tool_router_node_chat_history_block_dict(vellum_adhoc_prompt_cli
|
|
165
165
|
},
|
166
166
|
]
|
167
167
|
|
168
|
-
|
168
|
+
tool_prompt_node = create_tool_prompt_node(
|
169
169
|
ml_model="gpt-4o-mini",
|
170
170
|
blocks=blocks, # type: ignore
|
171
171
|
functions=[],
|
@@ -187,7 +187,7 @@ def test_create_tool_router_node_chat_history_block_dict(vellum_adhoc_prompt_cli
|
|
187
187
|
vellum_adhoc_prompt_client.adhoc_execute_prompt_stream.side_effect = generate_prompt_events
|
188
188
|
|
189
189
|
# WHEN we run the tool router node
|
190
|
-
node_instance =
|
190
|
+
node_instance = tool_prompt_node()
|
191
191
|
list(node_instance.run())
|
192
192
|
|
193
193
|
# THEN the API was called with compiled blocks
|