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
vellum/client/raw_client.py
CHANGED
@@ -1,43 +1,48 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
import contextlib
|
4
|
+
import json
|
3
5
|
import typing
|
4
|
-
from .core.client_wrapper import SyncClientWrapper
|
5
|
-
from .types.method_enum import MethodEnum
|
6
|
-
from .types.execute_api_request_body import ExecuteApiRequestBody
|
7
|
-
from .types.execute_api_request_headers_value import ExecuteApiRequestHeadersValue
|
8
|
-
from .types.execute_api_request_bearer_token import ExecuteApiRequestBearerToken
|
9
|
-
from .core.request_options import RequestOptions
|
10
|
-
from .core.http_response import HttpResponse
|
11
|
-
from .types.execute_api_response import ExecuteApiResponse
|
12
|
-
from .core.serialization import convert_and_respect_annotation_metadata
|
13
|
-
from .core.pydantic_utilities import parse_obj_as
|
14
6
|
from json.decoder import JSONDecodeError
|
7
|
+
|
15
8
|
from .core.api_error import ApiError
|
9
|
+
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
10
|
+
from .core.http_response import AsyncHttpResponse, HttpResponse
|
11
|
+
from .core.pydantic_utilities import parse_obj_as
|
12
|
+
from .core.request_options import RequestOptions
|
13
|
+
from .core.serialization import convert_and_respect_annotation_metadata
|
14
|
+
from .errors.bad_request_error import BadRequestError
|
15
|
+
from .errors.forbidden_error import ForbiddenError
|
16
|
+
from .errors.internal_server_error import InternalServerError
|
17
|
+
from .errors.not_found_error import NotFoundError
|
18
|
+
from .types.code_execution_package import CodeExecutionPackage
|
16
19
|
from .types.code_execution_runtime import CodeExecutionRuntime
|
17
20
|
from .types.code_executor_input import CodeExecutorInput
|
18
|
-
from .types.code_execution_package import CodeExecutionPackage
|
19
|
-
from .types.vellum_variable_type import VellumVariableType
|
20
21
|
from .types.code_executor_response import CodeExecutorResponse
|
21
|
-
from .
|
22
|
-
from .types.
|
23
|
-
from .types.
|
24
|
-
from .types.
|
22
|
+
from .types.execute_api_request_bearer_token import ExecuteApiRequestBearerToken
|
23
|
+
from .types.execute_api_request_body import ExecuteApiRequestBody
|
24
|
+
from .types.execute_api_request_headers_value import ExecuteApiRequestHeadersValue
|
25
|
+
from .types.execute_api_response import ExecuteApiResponse
|
26
|
+
from .types.execute_prompt_event import ExecutePromptEvent
|
25
27
|
from .types.execute_prompt_response import ExecutePromptResponse
|
26
|
-
from .errors.forbidden_error import ForbiddenError
|
27
|
-
from .errors.not_found_error import NotFoundError
|
28
|
-
from .errors.internal_server_error import InternalServerError
|
29
|
-
from .types.workflow_request_input_request import WorkflowRequestInputRequest
|
30
|
-
from .types.workflow_expand_meta_request import WorkflowExpandMetaRequest
|
31
28
|
from .types.execute_workflow_response import ExecuteWorkflowResponse
|
32
|
-
from .types.generate_request import GenerateRequest
|
33
29
|
from .types.generate_options_request import GenerateOptionsRequest
|
30
|
+
from .types.generate_request import GenerateRequest
|
34
31
|
from .types.generate_response import GenerateResponse
|
32
|
+
from .types.generate_stream_response import GenerateStreamResponse
|
33
|
+
from .types.method_enum import MethodEnum
|
34
|
+
from .types.prompt_deployment_expand_meta_request import PromptDeploymentExpandMetaRequest
|
35
|
+
from .types.prompt_deployment_input_request import PromptDeploymentInputRequest
|
36
|
+
from .types.raw_prompt_execution_overrides_request import RawPromptExecutionOverridesRequest
|
35
37
|
from .types.search_request_options_request import SearchRequestOptionsRequest
|
36
38
|
from .types.search_response import SearchResponse
|
37
39
|
from .types.submit_completion_actual_request import SubmitCompletionActualRequest
|
38
40
|
from .types.submit_workflow_execution_actual_request import SubmitWorkflowExecutionActualRequest
|
39
|
-
from .
|
40
|
-
from .
|
41
|
+
from .types.vellum_variable_type import VellumVariableType
|
42
|
+
from .types.workflow_execution_event_type import WorkflowExecutionEventType
|
43
|
+
from .types.workflow_expand_meta_request import WorkflowExpandMetaRequest
|
44
|
+
from .types.workflow_request_input_request import WorkflowRequestInputRequest
|
45
|
+
from .types.workflow_stream_event import WorkflowStreamEvent
|
41
46
|
|
42
47
|
# this is used as the default value for optional parameters
|
43
48
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -113,8 +118,8 @@ class RawVellum:
|
|
113
118
|
return HttpResponse(response=_response, data=_data)
|
114
119
|
_response_json = _response.json()
|
115
120
|
except JSONDecodeError:
|
116
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
117
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
121
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
122
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
118
123
|
|
119
124
|
def execute_code(
|
120
125
|
self,
|
@@ -180,18 +185,19 @@ class RawVellum:
|
|
180
185
|
return HttpResponse(response=_response, data=_data)
|
181
186
|
if _response.status_code == 400:
|
182
187
|
raise BadRequestError(
|
183
|
-
|
188
|
+
headers=dict(_response.headers),
|
189
|
+
body=typing.cast(
|
184
190
|
typing.Optional[typing.Any],
|
185
191
|
parse_obj_as(
|
186
192
|
type_=typing.Optional[typing.Any], # type: ignore
|
187
193
|
object_=_response.json(),
|
188
194
|
),
|
189
|
-
)
|
195
|
+
),
|
190
196
|
)
|
191
197
|
_response_json = _response.json()
|
192
198
|
except JSONDecodeError:
|
193
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
194
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
199
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
200
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
195
201
|
|
196
202
|
def execute_prompt(
|
197
203
|
self,
|
@@ -290,48 +296,214 @@ class RawVellum:
|
|
290
296
|
return HttpResponse(response=_response, data=_data)
|
291
297
|
if _response.status_code == 400:
|
292
298
|
raise BadRequestError(
|
293
|
-
|
299
|
+
headers=dict(_response.headers),
|
300
|
+
body=typing.cast(
|
294
301
|
typing.Optional[typing.Any],
|
295
302
|
parse_obj_as(
|
296
303
|
type_=typing.Optional[typing.Any], # type: ignore
|
297
304
|
object_=_response.json(),
|
298
305
|
),
|
299
|
-
)
|
306
|
+
),
|
300
307
|
)
|
301
308
|
if _response.status_code == 403:
|
302
309
|
raise ForbiddenError(
|
303
|
-
|
310
|
+
headers=dict(_response.headers),
|
311
|
+
body=typing.cast(
|
304
312
|
typing.Optional[typing.Any],
|
305
313
|
parse_obj_as(
|
306
314
|
type_=typing.Optional[typing.Any], # type: ignore
|
307
315
|
object_=_response.json(),
|
308
316
|
),
|
309
|
-
)
|
317
|
+
),
|
310
318
|
)
|
311
319
|
if _response.status_code == 404:
|
312
320
|
raise NotFoundError(
|
313
|
-
|
321
|
+
headers=dict(_response.headers),
|
322
|
+
body=typing.cast(
|
314
323
|
typing.Optional[typing.Any],
|
315
324
|
parse_obj_as(
|
316
325
|
type_=typing.Optional[typing.Any], # type: ignore
|
317
326
|
object_=_response.json(),
|
318
327
|
),
|
319
|
-
)
|
328
|
+
),
|
320
329
|
)
|
321
330
|
if _response.status_code == 500:
|
322
331
|
raise InternalServerError(
|
323
|
-
|
332
|
+
headers=dict(_response.headers),
|
333
|
+
body=typing.cast(
|
324
334
|
typing.Optional[typing.Any],
|
325
335
|
parse_obj_as(
|
326
336
|
type_=typing.Optional[typing.Any], # type: ignore
|
327
337
|
object_=_response.json(),
|
328
338
|
),
|
329
|
-
)
|
339
|
+
),
|
330
340
|
)
|
331
341
|
_response_json = _response.json()
|
332
342
|
except JSONDecodeError:
|
333
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
334
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
343
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
344
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
345
|
+
|
346
|
+
@contextlib.contextmanager
|
347
|
+
def execute_prompt_stream(
|
348
|
+
self,
|
349
|
+
*,
|
350
|
+
inputs: typing.Sequence[PromptDeploymentInputRequest],
|
351
|
+
prompt_deployment_id: typing.Optional[str] = OMIT,
|
352
|
+
prompt_deployment_name: typing.Optional[str] = OMIT,
|
353
|
+
release_tag: typing.Optional[str] = OMIT,
|
354
|
+
external_id: typing.Optional[str] = OMIT,
|
355
|
+
expand_meta: typing.Optional[PromptDeploymentExpandMetaRequest] = OMIT,
|
356
|
+
raw_overrides: typing.Optional[RawPromptExecutionOverridesRequest] = OMIT,
|
357
|
+
expand_raw: typing.Optional[typing.Sequence[str]] = OMIT,
|
358
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
359
|
+
request_options: typing.Optional[RequestOptions] = None,
|
360
|
+
) -> typing.Iterator[HttpResponse[typing.Iterator[ExecutePromptEvent]]]:
|
361
|
+
"""
|
362
|
+
Executes a deployed Prompt and streams back the results.
|
363
|
+
|
364
|
+
Parameters
|
365
|
+
----------
|
366
|
+
inputs : typing.Sequence[PromptDeploymentInputRequest]
|
367
|
+
A list consisting of the Prompt Deployment's input variables and their values.
|
368
|
+
|
369
|
+
prompt_deployment_id : typing.Optional[str]
|
370
|
+
The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name.
|
371
|
+
|
372
|
+
prompt_deployment_name : typing.Optional[str]
|
373
|
+
The unique name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
374
|
+
|
375
|
+
release_tag : typing.Optional[str]
|
376
|
+
Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
377
|
+
|
378
|
+
external_id : typing.Optional[str]
|
379
|
+
Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
|
380
|
+
|
381
|
+
expand_meta : typing.Optional[PromptDeploymentExpandMetaRequest]
|
382
|
+
An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response.
|
383
|
+
|
384
|
+
raw_overrides : typing.Optional[RawPromptExecutionOverridesRequest]
|
385
|
+
Overrides for the raw API request sent to the model host. Combined with `expand_raw`, it can be used to access new features from models.
|
386
|
+
|
387
|
+
expand_raw : typing.Optional[typing.Sequence[str]]
|
388
|
+
A list of keys whose values you'd like to directly return from the JSON response of the model provider. Useful if you need lower-level info returned by model providers that Vellum would otherwise omit. Corresponding key/value pairs will be returned under the `raw` key of the API response.
|
389
|
+
|
390
|
+
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
391
|
+
Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis.
|
392
|
+
|
393
|
+
request_options : typing.Optional[RequestOptions]
|
394
|
+
Request-specific configuration.
|
395
|
+
|
396
|
+
Yields
|
397
|
+
------
|
398
|
+
typing.Iterator[HttpResponse[typing.Iterator[ExecutePromptEvent]]]
|
399
|
+
|
400
|
+
"""
|
401
|
+
with self._client_wrapper.httpx_client.stream(
|
402
|
+
"v1/execute-prompt-stream",
|
403
|
+
base_url=self._client_wrapper.get_environment().predict,
|
404
|
+
method="POST",
|
405
|
+
json={
|
406
|
+
"inputs": convert_and_respect_annotation_metadata(
|
407
|
+
object_=inputs, annotation=typing.Sequence[PromptDeploymentInputRequest], direction="write"
|
408
|
+
),
|
409
|
+
"prompt_deployment_id": prompt_deployment_id,
|
410
|
+
"prompt_deployment_name": prompt_deployment_name,
|
411
|
+
"release_tag": release_tag,
|
412
|
+
"external_id": external_id,
|
413
|
+
"expand_meta": convert_and_respect_annotation_metadata(
|
414
|
+
object_=expand_meta,
|
415
|
+
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
416
|
+
direction="write",
|
417
|
+
),
|
418
|
+
"raw_overrides": convert_and_respect_annotation_metadata(
|
419
|
+
object_=raw_overrides,
|
420
|
+
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
421
|
+
direction="write",
|
422
|
+
),
|
423
|
+
"expand_raw": expand_raw,
|
424
|
+
"metadata": metadata,
|
425
|
+
},
|
426
|
+
headers={
|
427
|
+
"content-type": "application/json",
|
428
|
+
},
|
429
|
+
request_options=request_options,
|
430
|
+
omit=OMIT,
|
431
|
+
) as _response:
|
432
|
+
|
433
|
+
def _stream() -> HttpResponse[typing.Iterator[ExecutePromptEvent]]:
|
434
|
+
try:
|
435
|
+
if 200 <= _response.status_code < 300:
|
436
|
+
|
437
|
+
def _iter():
|
438
|
+
for _text in _response.iter_lines():
|
439
|
+
try:
|
440
|
+
if len(_text) == 0:
|
441
|
+
continue
|
442
|
+
yield typing.cast(
|
443
|
+
ExecutePromptEvent,
|
444
|
+
parse_obj_as(
|
445
|
+
type_=ExecutePromptEvent, # type: ignore
|
446
|
+
object_=json.loads(_text),
|
447
|
+
),
|
448
|
+
)
|
449
|
+
except Exception:
|
450
|
+
pass
|
451
|
+
return
|
452
|
+
|
453
|
+
return HttpResponse(response=_response, data=_iter())
|
454
|
+
_response.read()
|
455
|
+
if _response.status_code == 400:
|
456
|
+
raise BadRequestError(
|
457
|
+
headers=dict(_response.headers),
|
458
|
+
body=typing.cast(
|
459
|
+
typing.Optional[typing.Any],
|
460
|
+
parse_obj_as(
|
461
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
462
|
+
object_=_response.json(),
|
463
|
+
),
|
464
|
+
),
|
465
|
+
)
|
466
|
+
if _response.status_code == 403:
|
467
|
+
raise ForbiddenError(
|
468
|
+
headers=dict(_response.headers),
|
469
|
+
body=typing.cast(
|
470
|
+
typing.Optional[typing.Any],
|
471
|
+
parse_obj_as(
|
472
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
473
|
+
object_=_response.json(),
|
474
|
+
),
|
475
|
+
),
|
476
|
+
)
|
477
|
+
if _response.status_code == 404:
|
478
|
+
raise NotFoundError(
|
479
|
+
headers=dict(_response.headers),
|
480
|
+
body=typing.cast(
|
481
|
+
typing.Optional[typing.Any],
|
482
|
+
parse_obj_as(
|
483
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
484
|
+
object_=_response.json(),
|
485
|
+
),
|
486
|
+
),
|
487
|
+
)
|
488
|
+
if _response.status_code == 500:
|
489
|
+
raise InternalServerError(
|
490
|
+
headers=dict(_response.headers),
|
491
|
+
body=typing.cast(
|
492
|
+
typing.Optional[typing.Any],
|
493
|
+
parse_obj_as(
|
494
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
495
|
+
object_=_response.json(),
|
496
|
+
),
|
497
|
+
),
|
498
|
+
)
|
499
|
+
_response_json = _response.json()
|
500
|
+
except JSONDecodeError:
|
501
|
+
raise ApiError(
|
502
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
503
|
+
)
|
504
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
505
|
+
|
506
|
+
yield _stream()
|
335
507
|
|
336
508
|
def execute_workflow(
|
337
509
|
self,
|
@@ -414,38 +586,181 @@ class RawVellum:
|
|
414
586
|
return HttpResponse(response=_response, data=_data)
|
415
587
|
if _response.status_code == 400:
|
416
588
|
raise BadRequestError(
|
417
|
-
|
589
|
+
headers=dict(_response.headers),
|
590
|
+
body=typing.cast(
|
418
591
|
typing.Optional[typing.Any],
|
419
592
|
parse_obj_as(
|
420
593
|
type_=typing.Optional[typing.Any], # type: ignore
|
421
594
|
object_=_response.json(),
|
422
595
|
),
|
423
|
-
)
|
596
|
+
),
|
424
597
|
)
|
425
598
|
if _response.status_code == 404:
|
426
599
|
raise NotFoundError(
|
427
|
-
|
600
|
+
headers=dict(_response.headers),
|
601
|
+
body=typing.cast(
|
428
602
|
typing.Optional[typing.Any],
|
429
603
|
parse_obj_as(
|
430
604
|
type_=typing.Optional[typing.Any], # type: ignore
|
431
605
|
object_=_response.json(),
|
432
606
|
),
|
433
|
-
)
|
607
|
+
),
|
434
608
|
)
|
435
609
|
if _response.status_code == 500:
|
436
610
|
raise InternalServerError(
|
437
|
-
|
611
|
+
headers=dict(_response.headers),
|
612
|
+
body=typing.cast(
|
438
613
|
typing.Optional[typing.Any],
|
439
614
|
parse_obj_as(
|
440
615
|
type_=typing.Optional[typing.Any], # type: ignore
|
441
616
|
object_=_response.json(),
|
442
617
|
),
|
443
|
-
)
|
618
|
+
),
|
444
619
|
)
|
445
620
|
_response_json = _response.json()
|
446
621
|
except JSONDecodeError:
|
447
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
448
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
622
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
623
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
624
|
+
|
625
|
+
@contextlib.contextmanager
|
626
|
+
def execute_workflow_stream(
|
627
|
+
self,
|
628
|
+
*,
|
629
|
+
inputs: typing.Sequence[WorkflowRequestInputRequest],
|
630
|
+
expand_meta: typing.Optional[WorkflowExpandMetaRequest] = OMIT,
|
631
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
632
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
633
|
+
release_tag: typing.Optional[str] = OMIT,
|
634
|
+
external_id: typing.Optional[str] = OMIT,
|
635
|
+
event_types: typing.Optional[typing.Sequence[WorkflowExecutionEventType]] = OMIT,
|
636
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
637
|
+
request_options: typing.Optional[RequestOptions] = None,
|
638
|
+
) -> typing.Iterator[HttpResponse[typing.Iterator[WorkflowStreamEvent]]]:
|
639
|
+
"""
|
640
|
+
Executes a deployed Workflow and streams back its results.
|
641
|
+
|
642
|
+
Parameters
|
643
|
+
----------
|
644
|
+
inputs : typing.Sequence[WorkflowRequestInputRequest]
|
645
|
+
The list of inputs defined in the Workflow's Deployment with their corresponding values.
|
646
|
+
|
647
|
+
expand_meta : typing.Optional[WorkflowExpandMetaRequest]
|
648
|
+
An optionally specified configuration used to opt in to including additional metadata about this workflow execution in the API response. Corresponding values will be returned under the `execution_meta` key within NODE events in the response stream.
|
649
|
+
|
650
|
+
workflow_deployment_id : typing.Optional[str]
|
651
|
+
The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
|
652
|
+
|
653
|
+
workflow_deployment_name : typing.Optional[str]
|
654
|
+
The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
|
655
|
+
|
656
|
+
release_tag : typing.Optional[str]
|
657
|
+
Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
|
658
|
+
|
659
|
+
external_id : typing.Optional[str]
|
660
|
+
Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
|
661
|
+
|
662
|
+
event_types : typing.Optional[typing.Sequence[WorkflowExecutionEventType]]
|
663
|
+
Optionally specify which events you want to receive. Defaults to only WORKFLOW events. Note that the schema of non-WORKFLOW events is unstable and should be used with caution.
|
664
|
+
|
665
|
+
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
666
|
+
Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis.
|
667
|
+
|
668
|
+
request_options : typing.Optional[RequestOptions]
|
669
|
+
Request-specific configuration.
|
670
|
+
|
671
|
+
Yields
|
672
|
+
------
|
673
|
+
typing.Iterator[HttpResponse[typing.Iterator[WorkflowStreamEvent]]]
|
674
|
+
|
675
|
+
"""
|
676
|
+
with self._client_wrapper.httpx_client.stream(
|
677
|
+
"v1/execute-workflow-stream",
|
678
|
+
base_url=self._client_wrapper.get_environment().predict,
|
679
|
+
method="POST",
|
680
|
+
json={
|
681
|
+
"inputs": convert_and_respect_annotation_metadata(
|
682
|
+
object_=inputs, annotation=typing.Sequence[WorkflowRequestInputRequest], direction="write"
|
683
|
+
),
|
684
|
+
"expand_meta": convert_and_respect_annotation_metadata(
|
685
|
+
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
686
|
+
),
|
687
|
+
"workflow_deployment_id": workflow_deployment_id,
|
688
|
+
"workflow_deployment_name": workflow_deployment_name,
|
689
|
+
"release_tag": release_tag,
|
690
|
+
"external_id": external_id,
|
691
|
+
"event_types": event_types,
|
692
|
+
"metadata": metadata,
|
693
|
+
},
|
694
|
+
headers={
|
695
|
+
"content-type": "application/json",
|
696
|
+
},
|
697
|
+
request_options=request_options,
|
698
|
+
omit=OMIT,
|
699
|
+
) as _response:
|
700
|
+
|
701
|
+
def _stream() -> HttpResponse[typing.Iterator[WorkflowStreamEvent]]:
|
702
|
+
try:
|
703
|
+
if 200 <= _response.status_code < 300:
|
704
|
+
|
705
|
+
def _iter():
|
706
|
+
for _text in _response.iter_lines():
|
707
|
+
try:
|
708
|
+
if len(_text) == 0:
|
709
|
+
continue
|
710
|
+
yield typing.cast(
|
711
|
+
WorkflowStreamEvent,
|
712
|
+
parse_obj_as(
|
713
|
+
type_=WorkflowStreamEvent, # type: ignore
|
714
|
+
object_=json.loads(_text),
|
715
|
+
),
|
716
|
+
)
|
717
|
+
except Exception:
|
718
|
+
pass
|
719
|
+
return
|
720
|
+
|
721
|
+
return HttpResponse(response=_response, data=_iter())
|
722
|
+
_response.read()
|
723
|
+
if _response.status_code == 400:
|
724
|
+
raise BadRequestError(
|
725
|
+
headers=dict(_response.headers),
|
726
|
+
body=typing.cast(
|
727
|
+
typing.Optional[typing.Any],
|
728
|
+
parse_obj_as(
|
729
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
730
|
+
object_=_response.json(),
|
731
|
+
),
|
732
|
+
),
|
733
|
+
)
|
734
|
+
if _response.status_code == 404:
|
735
|
+
raise NotFoundError(
|
736
|
+
headers=dict(_response.headers),
|
737
|
+
body=typing.cast(
|
738
|
+
typing.Optional[typing.Any],
|
739
|
+
parse_obj_as(
|
740
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
741
|
+
object_=_response.json(),
|
742
|
+
),
|
743
|
+
),
|
744
|
+
)
|
745
|
+
if _response.status_code == 500:
|
746
|
+
raise InternalServerError(
|
747
|
+
headers=dict(_response.headers),
|
748
|
+
body=typing.cast(
|
749
|
+
typing.Optional[typing.Any],
|
750
|
+
parse_obj_as(
|
751
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
752
|
+
object_=_response.json(),
|
753
|
+
),
|
754
|
+
),
|
755
|
+
)
|
756
|
+
_response_json = _response.json()
|
757
|
+
except JSONDecodeError:
|
758
|
+
raise ApiError(
|
759
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
760
|
+
)
|
761
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
762
|
+
|
763
|
+
yield _stream()
|
449
764
|
|
450
765
|
def generate(
|
451
766
|
self,
|
@@ -516,48 +831,186 @@ class RawVellum:
|
|
516
831
|
return HttpResponse(response=_response, data=_data)
|
517
832
|
if _response.status_code == 400:
|
518
833
|
raise BadRequestError(
|
519
|
-
|
834
|
+
headers=dict(_response.headers),
|
835
|
+
body=typing.cast(
|
520
836
|
typing.Optional[typing.Any],
|
521
837
|
parse_obj_as(
|
522
838
|
type_=typing.Optional[typing.Any], # type: ignore
|
523
839
|
object_=_response.json(),
|
524
840
|
),
|
525
|
-
)
|
841
|
+
),
|
526
842
|
)
|
527
843
|
if _response.status_code == 403:
|
528
844
|
raise ForbiddenError(
|
529
|
-
|
845
|
+
headers=dict(_response.headers),
|
846
|
+
body=typing.cast(
|
530
847
|
typing.Optional[typing.Any],
|
531
848
|
parse_obj_as(
|
532
849
|
type_=typing.Optional[typing.Any], # type: ignore
|
533
850
|
object_=_response.json(),
|
534
851
|
),
|
535
|
-
)
|
852
|
+
),
|
536
853
|
)
|
537
854
|
if _response.status_code == 404:
|
538
855
|
raise NotFoundError(
|
539
|
-
|
856
|
+
headers=dict(_response.headers),
|
857
|
+
body=typing.cast(
|
540
858
|
typing.Optional[typing.Any],
|
541
859
|
parse_obj_as(
|
542
860
|
type_=typing.Optional[typing.Any], # type: ignore
|
543
861
|
object_=_response.json(),
|
544
862
|
),
|
545
|
-
)
|
863
|
+
),
|
546
864
|
)
|
547
865
|
if _response.status_code == 500:
|
548
866
|
raise InternalServerError(
|
549
|
-
|
867
|
+
headers=dict(_response.headers),
|
868
|
+
body=typing.cast(
|
550
869
|
typing.Optional[typing.Any],
|
551
870
|
parse_obj_as(
|
552
871
|
type_=typing.Optional[typing.Any], # type: ignore
|
553
872
|
object_=_response.json(),
|
554
873
|
),
|
555
|
-
)
|
874
|
+
),
|
556
875
|
)
|
557
876
|
_response_json = _response.json()
|
558
877
|
except JSONDecodeError:
|
559
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
560
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
878
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
879
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
880
|
+
|
881
|
+
@contextlib.contextmanager
|
882
|
+
def generate_stream(
|
883
|
+
self,
|
884
|
+
*,
|
885
|
+
requests: typing.Sequence[GenerateRequest],
|
886
|
+
deployment_id: typing.Optional[str] = OMIT,
|
887
|
+
deployment_name: typing.Optional[str] = OMIT,
|
888
|
+
options: typing.Optional[GenerateOptionsRequest] = OMIT,
|
889
|
+
request_options: typing.Optional[RequestOptions] = None,
|
890
|
+
) -> typing.Iterator[HttpResponse[typing.Iterator[GenerateStreamResponse]]]:
|
891
|
+
"""
|
892
|
+
Generate a stream of completions using a previously defined deployment.
|
893
|
+
|
894
|
+
Important: This endpoint is DEPRECATED and has been superseded by
|
895
|
+
[execute-prompt-stream](/api-reference/api-reference/execute-prompt-stream).
|
896
|
+
|
897
|
+
Parameters
|
898
|
+
----------
|
899
|
+
requests : typing.Sequence[GenerateRequest]
|
900
|
+
The generation request to make. Bulk requests are no longer supported, this field must be an array of length 1.
|
901
|
+
|
902
|
+
deployment_id : typing.Optional[str]
|
903
|
+
The ID of the deployment. Must provide either this or deployment_name.
|
904
|
+
|
905
|
+
deployment_name : typing.Optional[str]
|
906
|
+
The name of the deployment. Must provide either this or deployment_id.
|
907
|
+
|
908
|
+
options : typing.Optional[GenerateOptionsRequest]
|
909
|
+
Additional configuration that can be used to control what's included in the response.
|
910
|
+
|
911
|
+
request_options : typing.Optional[RequestOptions]
|
912
|
+
Request-specific configuration.
|
913
|
+
|
914
|
+
Yields
|
915
|
+
------
|
916
|
+
typing.Iterator[HttpResponse[typing.Iterator[GenerateStreamResponse]]]
|
917
|
+
|
918
|
+
"""
|
919
|
+
with self._client_wrapper.httpx_client.stream(
|
920
|
+
"v1/generate-stream",
|
921
|
+
base_url=self._client_wrapper.get_environment().predict,
|
922
|
+
method="POST",
|
923
|
+
json={
|
924
|
+
"deployment_id": deployment_id,
|
925
|
+
"deployment_name": deployment_name,
|
926
|
+
"requests": convert_and_respect_annotation_metadata(
|
927
|
+
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
928
|
+
),
|
929
|
+
"options": convert_and_respect_annotation_metadata(
|
930
|
+
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
931
|
+
),
|
932
|
+
},
|
933
|
+
headers={
|
934
|
+
"content-type": "application/json",
|
935
|
+
},
|
936
|
+
request_options=request_options,
|
937
|
+
omit=OMIT,
|
938
|
+
) as _response:
|
939
|
+
|
940
|
+
def _stream() -> HttpResponse[typing.Iterator[GenerateStreamResponse]]:
|
941
|
+
try:
|
942
|
+
if 200 <= _response.status_code < 300:
|
943
|
+
|
944
|
+
def _iter():
|
945
|
+
for _text in _response.iter_lines():
|
946
|
+
try:
|
947
|
+
if len(_text) == 0:
|
948
|
+
continue
|
949
|
+
yield typing.cast(
|
950
|
+
GenerateStreamResponse,
|
951
|
+
parse_obj_as(
|
952
|
+
type_=GenerateStreamResponse, # type: ignore
|
953
|
+
object_=json.loads(_text),
|
954
|
+
),
|
955
|
+
)
|
956
|
+
except Exception:
|
957
|
+
pass
|
958
|
+
return
|
959
|
+
|
960
|
+
return HttpResponse(response=_response, data=_iter())
|
961
|
+
_response.read()
|
962
|
+
if _response.status_code == 400:
|
963
|
+
raise BadRequestError(
|
964
|
+
headers=dict(_response.headers),
|
965
|
+
body=typing.cast(
|
966
|
+
typing.Optional[typing.Any],
|
967
|
+
parse_obj_as(
|
968
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
969
|
+
object_=_response.json(),
|
970
|
+
),
|
971
|
+
),
|
972
|
+
)
|
973
|
+
if _response.status_code == 403:
|
974
|
+
raise ForbiddenError(
|
975
|
+
headers=dict(_response.headers),
|
976
|
+
body=typing.cast(
|
977
|
+
typing.Optional[typing.Any],
|
978
|
+
parse_obj_as(
|
979
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
980
|
+
object_=_response.json(),
|
981
|
+
),
|
982
|
+
),
|
983
|
+
)
|
984
|
+
if _response.status_code == 404:
|
985
|
+
raise NotFoundError(
|
986
|
+
headers=dict(_response.headers),
|
987
|
+
body=typing.cast(
|
988
|
+
typing.Optional[typing.Any],
|
989
|
+
parse_obj_as(
|
990
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
991
|
+
object_=_response.json(),
|
992
|
+
),
|
993
|
+
),
|
994
|
+
)
|
995
|
+
if _response.status_code == 500:
|
996
|
+
raise InternalServerError(
|
997
|
+
headers=dict(_response.headers),
|
998
|
+
body=typing.cast(
|
999
|
+
typing.Optional[typing.Any],
|
1000
|
+
parse_obj_as(
|
1001
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1002
|
+
object_=_response.json(),
|
1003
|
+
),
|
1004
|
+
),
|
1005
|
+
)
|
1006
|
+
_response_json = _response.json()
|
1007
|
+
except JSONDecodeError:
|
1008
|
+
raise ApiError(
|
1009
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
1010
|
+
)
|
1011
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1012
|
+
|
1013
|
+
yield _stream()
|
561
1014
|
|
562
1015
|
def search(
|
563
1016
|
self,
|
@@ -628,38 +1081,41 @@ class RawVellum:
|
|
628
1081
|
return HttpResponse(response=_response, data=_data)
|
629
1082
|
if _response.status_code == 400:
|
630
1083
|
raise BadRequestError(
|
631
|
-
|
1084
|
+
headers=dict(_response.headers),
|
1085
|
+
body=typing.cast(
|
632
1086
|
typing.Optional[typing.Any],
|
633
1087
|
parse_obj_as(
|
634
1088
|
type_=typing.Optional[typing.Any], # type: ignore
|
635
1089
|
object_=_response.json(),
|
636
1090
|
),
|
637
|
-
)
|
1091
|
+
),
|
638
1092
|
)
|
639
1093
|
if _response.status_code == 404:
|
640
1094
|
raise NotFoundError(
|
641
|
-
|
1095
|
+
headers=dict(_response.headers),
|
1096
|
+
body=typing.cast(
|
642
1097
|
typing.Optional[typing.Any],
|
643
1098
|
parse_obj_as(
|
644
1099
|
type_=typing.Optional[typing.Any], # type: ignore
|
645
1100
|
object_=_response.json(),
|
646
1101
|
),
|
647
|
-
)
|
1102
|
+
),
|
648
1103
|
)
|
649
1104
|
if _response.status_code == 500:
|
650
1105
|
raise InternalServerError(
|
651
|
-
|
1106
|
+
headers=dict(_response.headers),
|
1107
|
+
body=typing.cast(
|
652
1108
|
typing.Optional[typing.Any],
|
653
1109
|
parse_obj_as(
|
654
1110
|
type_=typing.Optional[typing.Any], # type: ignore
|
655
1111
|
object_=_response.json(),
|
656
1112
|
),
|
657
|
-
)
|
1113
|
+
),
|
658
1114
|
)
|
659
1115
|
_response_json = _response.json()
|
660
1116
|
except JSONDecodeError:
|
661
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
662
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1117
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1118
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
663
1119
|
|
664
1120
|
def submit_completion_actuals(
|
665
1121
|
self,
|
@@ -712,38 +1168,41 @@ class RawVellum:
|
|
712
1168
|
return HttpResponse(response=_response, data=None)
|
713
1169
|
if _response.status_code == 400:
|
714
1170
|
raise BadRequestError(
|
715
|
-
|
1171
|
+
headers=dict(_response.headers),
|
1172
|
+
body=typing.cast(
|
716
1173
|
typing.Optional[typing.Any],
|
717
1174
|
parse_obj_as(
|
718
1175
|
type_=typing.Optional[typing.Any], # type: ignore
|
719
1176
|
object_=_response.json(),
|
720
1177
|
),
|
721
|
-
)
|
1178
|
+
),
|
722
1179
|
)
|
723
1180
|
if _response.status_code == 404:
|
724
1181
|
raise NotFoundError(
|
725
|
-
|
1182
|
+
headers=dict(_response.headers),
|
1183
|
+
body=typing.cast(
|
726
1184
|
typing.Optional[typing.Any],
|
727
1185
|
parse_obj_as(
|
728
1186
|
type_=typing.Optional[typing.Any], # type: ignore
|
729
1187
|
object_=_response.json(),
|
730
1188
|
),
|
731
|
-
)
|
1189
|
+
),
|
732
1190
|
)
|
733
1191
|
if _response.status_code == 500:
|
734
1192
|
raise InternalServerError(
|
735
|
-
|
1193
|
+
headers=dict(_response.headers),
|
1194
|
+
body=typing.cast(
|
736
1195
|
typing.Optional[typing.Any],
|
737
1196
|
parse_obj_as(
|
738
1197
|
type_=typing.Optional[typing.Any], # type: ignore
|
739
1198
|
object_=_response.json(),
|
740
1199
|
),
|
741
|
-
)
|
1200
|
+
),
|
742
1201
|
)
|
743
1202
|
_response_json = _response.json()
|
744
1203
|
except JSONDecodeError:
|
745
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
746
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1204
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1205
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
747
1206
|
|
748
1207
|
def submit_workflow_execution_actuals(
|
749
1208
|
self,
|
@@ -798,8 +1257,8 @@ class RawVellum:
|
|
798
1257
|
return HttpResponse(response=_response, data=None)
|
799
1258
|
_response_json = _response.json()
|
800
1259
|
except JSONDecodeError:
|
801
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
802
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1260
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1261
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
803
1262
|
|
804
1263
|
|
805
1264
|
class AsyncRawVellum:
|
@@ -872,8 +1331,8 @@ class AsyncRawVellum:
|
|
872
1331
|
return AsyncHttpResponse(response=_response, data=_data)
|
873
1332
|
_response_json = _response.json()
|
874
1333
|
except JSONDecodeError:
|
875
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
876
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1334
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1335
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
877
1336
|
|
878
1337
|
async def execute_code(
|
879
1338
|
self,
|
@@ -939,18 +1398,19 @@ class AsyncRawVellum:
|
|
939
1398
|
return AsyncHttpResponse(response=_response, data=_data)
|
940
1399
|
if _response.status_code == 400:
|
941
1400
|
raise BadRequestError(
|
942
|
-
|
1401
|
+
headers=dict(_response.headers),
|
1402
|
+
body=typing.cast(
|
943
1403
|
typing.Optional[typing.Any],
|
944
1404
|
parse_obj_as(
|
945
1405
|
type_=typing.Optional[typing.Any], # type: ignore
|
946
1406
|
object_=_response.json(),
|
947
1407
|
),
|
948
|
-
)
|
1408
|
+
),
|
949
1409
|
)
|
950
1410
|
_response_json = _response.json()
|
951
1411
|
except JSONDecodeError:
|
952
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
953
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1412
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1413
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
954
1414
|
|
955
1415
|
async def execute_prompt(
|
956
1416
|
self,
|
@@ -1049,48 +1509,214 @@ class AsyncRawVellum:
|
|
1049
1509
|
return AsyncHttpResponse(response=_response, data=_data)
|
1050
1510
|
if _response.status_code == 400:
|
1051
1511
|
raise BadRequestError(
|
1052
|
-
|
1512
|
+
headers=dict(_response.headers),
|
1513
|
+
body=typing.cast(
|
1053
1514
|
typing.Optional[typing.Any],
|
1054
1515
|
parse_obj_as(
|
1055
1516
|
type_=typing.Optional[typing.Any], # type: ignore
|
1056
1517
|
object_=_response.json(),
|
1057
1518
|
),
|
1058
|
-
)
|
1519
|
+
),
|
1059
1520
|
)
|
1060
1521
|
if _response.status_code == 403:
|
1061
1522
|
raise ForbiddenError(
|
1062
|
-
|
1523
|
+
headers=dict(_response.headers),
|
1524
|
+
body=typing.cast(
|
1063
1525
|
typing.Optional[typing.Any],
|
1064
1526
|
parse_obj_as(
|
1065
1527
|
type_=typing.Optional[typing.Any], # type: ignore
|
1066
1528
|
object_=_response.json(),
|
1067
1529
|
),
|
1068
|
-
)
|
1530
|
+
),
|
1069
1531
|
)
|
1070
1532
|
if _response.status_code == 404:
|
1071
1533
|
raise NotFoundError(
|
1072
|
-
|
1534
|
+
headers=dict(_response.headers),
|
1535
|
+
body=typing.cast(
|
1073
1536
|
typing.Optional[typing.Any],
|
1074
1537
|
parse_obj_as(
|
1075
1538
|
type_=typing.Optional[typing.Any], # type: ignore
|
1076
1539
|
object_=_response.json(),
|
1077
1540
|
),
|
1078
|
-
)
|
1541
|
+
),
|
1079
1542
|
)
|
1080
1543
|
if _response.status_code == 500:
|
1081
1544
|
raise InternalServerError(
|
1082
|
-
|
1545
|
+
headers=dict(_response.headers),
|
1546
|
+
body=typing.cast(
|
1083
1547
|
typing.Optional[typing.Any],
|
1084
1548
|
parse_obj_as(
|
1085
1549
|
type_=typing.Optional[typing.Any], # type: ignore
|
1086
1550
|
object_=_response.json(),
|
1087
1551
|
),
|
1088
|
-
)
|
1552
|
+
),
|
1089
1553
|
)
|
1090
1554
|
_response_json = _response.json()
|
1091
1555
|
except JSONDecodeError:
|
1092
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1093
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1556
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1557
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1558
|
+
|
1559
|
+
@contextlib.asynccontextmanager
|
1560
|
+
async def execute_prompt_stream(
|
1561
|
+
self,
|
1562
|
+
*,
|
1563
|
+
inputs: typing.Sequence[PromptDeploymentInputRequest],
|
1564
|
+
prompt_deployment_id: typing.Optional[str] = OMIT,
|
1565
|
+
prompt_deployment_name: typing.Optional[str] = OMIT,
|
1566
|
+
release_tag: typing.Optional[str] = OMIT,
|
1567
|
+
external_id: typing.Optional[str] = OMIT,
|
1568
|
+
expand_meta: typing.Optional[PromptDeploymentExpandMetaRequest] = OMIT,
|
1569
|
+
raw_overrides: typing.Optional[RawPromptExecutionOverridesRequest] = OMIT,
|
1570
|
+
expand_raw: typing.Optional[typing.Sequence[str]] = OMIT,
|
1571
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
1572
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1573
|
+
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[ExecutePromptEvent]]]:
|
1574
|
+
"""
|
1575
|
+
Executes a deployed Prompt and streams back the results.
|
1576
|
+
|
1577
|
+
Parameters
|
1578
|
+
----------
|
1579
|
+
inputs : typing.Sequence[PromptDeploymentInputRequest]
|
1580
|
+
A list consisting of the Prompt Deployment's input variables and their values.
|
1581
|
+
|
1582
|
+
prompt_deployment_id : typing.Optional[str]
|
1583
|
+
The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name.
|
1584
|
+
|
1585
|
+
prompt_deployment_name : typing.Optional[str]
|
1586
|
+
The unique name of the Prompt Deployment. Must provide either this or prompt_deployment_id.
|
1587
|
+
|
1588
|
+
release_tag : typing.Optional[str]
|
1589
|
+
Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
|
1590
|
+
|
1591
|
+
external_id : typing.Optional[str]
|
1592
|
+
Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
|
1593
|
+
|
1594
|
+
expand_meta : typing.Optional[PromptDeploymentExpandMetaRequest]
|
1595
|
+
An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response.
|
1596
|
+
|
1597
|
+
raw_overrides : typing.Optional[RawPromptExecutionOverridesRequest]
|
1598
|
+
Overrides for the raw API request sent to the model host. Combined with `expand_raw`, it can be used to access new features from models.
|
1599
|
+
|
1600
|
+
expand_raw : typing.Optional[typing.Sequence[str]]
|
1601
|
+
A list of keys whose values you'd like to directly return from the JSON response of the model provider. Useful if you need lower-level info returned by model providers that Vellum would otherwise omit. Corresponding key/value pairs will be returned under the `raw` key of the API response.
|
1602
|
+
|
1603
|
+
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
1604
|
+
Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis.
|
1605
|
+
|
1606
|
+
request_options : typing.Optional[RequestOptions]
|
1607
|
+
Request-specific configuration.
|
1608
|
+
|
1609
|
+
Yields
|
1610
|
+
------
|
1611
|
+
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[ExecutePromptEvent]]]
|
1612
|
+
|
1613
|
+
"""
|
1614
|
+
async with self._client_wrapper.httpx_client.stream(
|
1615
|
+
"v1/execute-prompt-stream",
|
1616
|
+
base_url=self._client_wrapper.get_environment().predict,
|
1617
|
+
method="POST",
|
1618
|
+
json={
|
1619
|
+
"inputs": convert_and_respect_annotation_metadata(
|
1620
|
+
object_=inputs, annotation=typing.Sequence[PromptDeploymentInputRequest], direction="write"
|
1621
|
+
),
|
1622
|
+
"prompt_deployment_id": prompt_deployment_id,
|
1623
|
+
"prompt_deployment_name": prompt_deployment_name,
|
1624
|
+
"release_tag": release_tag,
|
1625
|
+
"external_id": external_id,
|
1626
|
+
"expand_meta": convert_and_respect_annotation_metadata(
|
1627
|
+
object_=expand_meta,
|
1628
|
+
annotation=typing.Optional[PromptDeploymentExpandMetaRequest],
|
1629
|
+
direction="write",
|
1630
|
+
),
|
1631
|
+
"raw_overrides": convert_and_respect_annotation_metadata(
|
1632
|
+
object_=raw_overrides,
|
1633
|
+
annotation=typing.Optional[RawPromptExecutionOverridesRequest],
|
1634
|
+
direction="write",
|
1635
|
+
),
|
1636
|
+
"expand_raw": expand_raw,
|
1637
|
+
"metadata": metadata,
|
1638
|
+
},
|
1639
|
+
headers={
|
1640
|
+
"content-type": "application/json",
|
1641
|
+
},
|
1642
|
+
request_options=request_options,
|
1643
|
+
omit=OMIT,
|
1644
|
+
) as _response:
|
1645
|
+
|
1646
|
+
async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[ExecutePromptEvent]]:
|
1647
|
+
try:
|
1648
|
+
if 200 <= _response.status_code < 300:
|
1649
|
+
|
1650
|
+
async def _iter():
|
1651
|
+
async for _text in _response.aiter_lines():
|
1652
|
+
try:
|
1653
|
+
if len(_text) == 0:
|
1654
|
+
continue
|
1655
|
+
yield typing.cast(
|
1656
|
+
ExecutePromptEvent,
|
1657
|
+
parse_obj_as(
|
1658
|
+
type_=ExecutePromptEvent, # type: ignore
|
1659
|
+
object_=json.loads(_text),
|
1660
|
+
),
|
1661
|
+
)
|
1662
|
+
except Exception:
|
1663
|
+
pass
|
1664
|
+
return
|
1665
|
+
|
1666
|
+
return AsyncHttpResponse(response=_response, data=_iter())
|
1667
|
+
await _response.aread()
|
1668
|
+
if _response.status_code == 400:
|
1669
|
+
raise BadRequestError(
|
1670
|
+
headers=dict(_response.headers),
|
1671
|
+
body=typing.cast(
|
1672
|
+
typing.Optional[typing.Any],
|
1673
|
+
parse_obj_as(
|
1674
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1675
|
+
object_=_response.json(),
|
1676
|
+
),
|
1677
|
+
),
|
1678
|
+
)
|
1679
|
+
if _response.status_code == 403:
|
1680
|
+
raise ForbiddenError(
|
1681
|
+
headers=dict(_response.headers),
|
1682
|
+
body=typing.cast(
|
1683
|
+
typing.Optional[typing.Any],
|
1684
|
+
parse_obj_as(
|
1685
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1686
|
+
object_=_response.json(),
|
1687
|
+
),
|
1688
|
+
),
|
1689
|
+
)
|
1690
|
+
if _response.status_code == 404:
|
1691
|
+
raise NotFoundError(
|
1692
|
+
headers=dict(_response.headers),
|
1693
|
+
body=typing.cast(
|
1694
|
+
typing.Optional[typing.Any],
|
1695
|
+
parse_obj_as(
|
1696
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1697
|
+
object_=_response.json(),
|
1698
|
+
),
|
1699
|
+
),
|
1700
|
+
)
|
1701
|
+
if _response.status_code == 500:
|
1702
|
+
raise InternalServerError(
|
1703
|
+
headers=dict(_response.headers),
|
1704
|
+
body=typing.cast(
|
1705
|
+
typing.Optional[typing.Any],
|
1706
|
+
parse_obj_as(
|
1707
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1708
|
+
object_=_response.json(),
|
1709
|
+
),
|
1710
|
+
),
|
1711
|
+
)
|
1712
|
+
_response_json = _response.json()
|
1713
|
+
except JSONDecodeError:
|
1714
|
+
raise ApiError(
|
1715
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
1716
|
+
)
|
1717
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1718
|
+
|
1719
|
+
yield await _stream()
|
1094
1720
|
|
1095
1721
|
async def execute_workflow(
|
1096
1722
|
self,
|
@@ -1173,38 +1799,181 @@ class AsyncRawVellum:
|
|
1173
1799
|
return AsyncHttpResponse(response=_response, data=_data)
|
1174
1800
|
if _response.status_code == 400:
|
1175
1801
|
raise BadRequestError(
|
1176
|
-
|
1802
|
+
headers=dict(_response.headers),
|
1803
|
+
body=typing.cast(
|
1177
1804
|
typing.Optional[typing.Any],
|
1178
1805
|
parse_obj_as(
|
1179
1806
|
type_=typing.Optional[typing.Any], # type: ignore
|
1180
1807
|
object_=_response.json(),
|
1181
1808
|
),
|
1182
|
-
)
|
1809
|
+
),
|
1183
1810
|
)
|
1184
1811
|
if _response.status_code == 404:
|
1185
1812
|
raise NotFoundError(
|
1186
|
-
|
1813
|
+
headers=dict(_response.headers),
|
1814
|
+
body=typing.cast(
|
1187
1815
|
typing.Optional[typing.Any],
|
1188
1816
|
parse_obj_as(
|
1189
1817
|
type_=typing.Optional[typing.Any], # type: ignore
|
1190
1818
|
object_=_response.json(),
|
1191
1819
|
),
|
1192
|
-
)
|
1820
|
+
),
|
1193
1821
|
)
|
1194
1822
|
if _response.status_code == 500:
|
1195
1823
|
raise InternalServerError(
|
1196
|
-
|
1824
|
+
headers=dict(_response.headers),
|
1825
|
+
body=typing.cast(
|
1197
1826
|
typing.Optional[typing.Any],
|
1198
1827
|
parse_obj_as(
|
1199
1828
|
type_=typing.Optional[typing.Any], # type: ignore
|
1200
1829
|
object_=_response.json(),
|
1201
1830
|
),
|
1202
|
-
)
|
1831
|
+
),
|
1203
1832
|
)
|
1204
1833
|
_response_json = _response.json()
|
1205
1834
|
except JSONDecodeError:
|
1206
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1207
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
1835
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1836
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1837
|
+
|
1838
|
+
@contextlib.asynccontextmanager
|
1839
|
+
async def execute_workflow_stream(
|
1840
|
+
self,
|
1841
|
+
*,
|
1842
|
+
inputs: typing.Sequence[WorkflowRequestInputRequest],
|
1843
|
+
expand_meta: typing.Optional[WorkflowExpandMetaRequest] = OMIT,
|
1844
|
+
workflow_deployment_id: typing.Optional[str] = OMIT,
|
1845
|
+
workflow_deployment_name: typing.Optional[str] = OMIT,
|
1846
|
+
release_tag: typing.Optional[str] = OMIT,
|
1847
|
+
external_id: typing.Optional[str] = OMIT,
|
1848
|
+
event_types: typing.Optional[typing.Sequence[WorkflowExecutionEventType]] = OMIT,
|
1849
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
1850
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1851
|
+
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[WorkflowStreamEvent]]]:
|
1852
|
+
"""
|
1853
|
+
Executes a deployed Workflow and streams back its results.
|
1854
|
+
|
1855
|
+
Parameters
|
1856
|
+
----------
|
1857
|
+
inputs : typing.Sequence[WorkflowRequestInputRequest]
|
1858
|
+
The list of inputs defined in the Workflow's Deployment with their corresponding values.
|
1859
|
+
|
1860
|
+
expand_meta : typing.Optional[WorkflowExpandMetaRequest]
|
1861
|
+
An optionally specified configuration used to opt in to including additional metadata about this workflow execution in the API response. Corresponding values will be returned under the `execution_meta` key within NODE events in the response stream.
|
1862
|
+
|
1863
|
+
workflow_deployment_id : typing.Optional[str]
|
1864
|
+
The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
|
1865
|
+
|
1866
|
+
workflow_deployment_name : typing.Optional[str]
|
1867
|
+
The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
|
1868
|
+
|
1869
|
+
release_tag : typing.Optional[str]
|
1870
|
+
Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
|
1871
|
+
|
1872
|
+
external_id : typing.Optional[str]
|
1873
|
+
Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
|
1874
|
+
|
1875
|
+
event_types : typing.Optional[typing.Sequence[WorkflowExecutionEventType]]
|
1876
|
+
Optionally specify which events you want to receive. Defaults to only WORKFLOW events. Note that the schema of non-WORKFLOW events is unstable and should be used with caution.
|
1877
|
+
|
1878
|
+
metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
1879
|
+
Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis.
|
1880
|
+
|
1881
|
+
request_options : typing.Optional[RequestOptions]
|
1882
|
+
Request-specific configuration.
|
1883
|
+
|
1884
|
+
Yields
|
1885
|
+
------
|
1886
|
+
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[WorkflowStreamEvent]]]
|
1887
|
+
|
1888
|
+
"""
|
1889
|
+
async with self._client_wrapper.httpx_client.stream(
|
1890
|
+
"v1/execute-workflow-stream",
|
1891
|
+
base_url=self._client_wrapper.get_environment().predict,
|
1892
|
+
method="POST",
|
1893
|
+
json={
|
1894
|
+
"inputs": convert_and_respect_annotation_metadata(
|
1895
|
+
object_=inputs, annotation=typing.Sequence[WorkflowRequestInputRequest], direction="write"
|
1896
|
+
),
|
1897
|
+
"expand_meta": convert_and_respect_annotation_metadata(
|
1898
|
+
object_=expand_meta, annotation=typing.Optional[WorkflowExpandMetaRequest], direction="write"
|
1899
|
+
),
|
1900
|
+
"workflow_deployment_id": workflow_deployment_id,
|
1901
|
+
"workflow_deployment_name": workflow_deployment_name,
|
1902
|
+
"release_tag": release_tag,
|
1903
|
+
"external_id": external_id,
|
1904
|
+
"event_types": event_types,
|
1905
|
+
"metadata": metadata,
|
1906
|
+
},
|
1907
|
+
headers={
|
1908
|
+
"content-type": "application/json",
|
1909
|
+
},
|
1910
|
+
request_options=request_options,
|
1911
|
+
omit=OMIT,
|
1912
|
+
) as _response:
|
1913
|
+
|
1914
|
+
async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[WorkflowStreamEvent]]:
|
1915
|
+
try:
|
1916
|
+
if 200 <= _response.status_code < 300:
|
1917
|
+
|
1918
|
+
async def _iter():
|
1919
|
+
async for _text in _response.aiter_lines():
|
1920
|
+
try:
|
1921
|
+
if len(_text) == 0:
|
1922
|
+
continue
|
1923
|
+
yield typing.cast(
|
1924
|
+
WorkflowStreamEvent,
|
1925
|
+
parse_obj_as(
|
1926
|
+
type_=WorkflowStreamEvent, # type: ignore
|
1927
|
+
object_=json.loads(_text),
|
1928
|
+
),
|
1929
|
+
)
|
1930
|
+
except Exception:
|
1931
|
+
pass
|
1932
|
+
return
|
1933
|
+
|
1934
|
+
return AsyncHttpResponse(response=_response, data=_iter())
|
1935
|
+
await _response.aread()
|
1936
|
+
if _response.status_code == 400:
|
1937
|
+
raise BadRequestError(
|
1938
|
+
headers=dict(_response.headers),
|
1939
|
+
body=typing.cast(
|
1940
|
+
typing.Optional[typing.Any],
|
1941
|
+
parse_obj_as(
|
1942
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1943
|
+
object_=_response.json(),
|
1944
|
+
),
|
1945
|
+
),
|
1946
|
+
)
|
1947
|
+
if _response.status_code == 404:
|
1948
|
+
raise NotFoundError(
|
1949
|
+
headers=dict(_response.headers),
|
1950
|
+
body=typing.cast(
|
1951
|
+
typing.Optional[typing.Any],
|
1952
|
+
parse_obj_as(
|
1953
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1954
|
+
object_=_response.json(),
|
1955
|
+
),
|
1956
|
+
),
|
1957
|
+
)
|
1958
|
+
if _response.status_code == 500:
|
1959
|
+
raise InternalServerError(
|
1960
|
+
headers=dict(_response.headers),
|
1961
|
+
body=typing.cast(
|
1962
|
+
typing.Optional[typing.Any],
|
1963
|
+
parse_obj_as(
|
1964
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1965
|
+
object_=_response.json(),
|
1966
|
+
),
|
1967
|
+
),
|
1968
|
+
)
|
1969
|
+
_response_json = _response.json()
|
1970
|
+
except JSONDecodeError:
|
1971
|
+
raise ApiError(
|
1972
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
1973
|
+
)
|
1974
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1975
|
+
|
1976
|
+
yield await _stream()
|
1208
1977
|
|
1209
1978
|
async def generate(
|
1210
1979
|
self,
|
@@ -1275,48 +2044,186 @@ class AsyncRawVellum:
|
|
1275
2044
|
return AsyncHttpResponse(response=_response, data=_data)
|
1276
2045
|
if _response.status_code == 400:
|
1277
2046
|
raise BadRequestError(
|
1278
|
-
|
2047
|
+
headers=dict(_response.headers),
|
2048
|
+
body=typing.cast(
|
1279
2049
|
typing.Optional[typing.Any],
|
1280
2050
|
parse_obj_as(
|
1281
2051
|
type_=typing.Optional[typing.Any], # type: ignore
|
1282
2052
|
object_=_response.json(),
|
1283
2053
|
),
|
1284
|
-
)
|
2054
|
+
),
|
1285
2055
|
)
|
1286
2056
|
if _response.status_code == 403:
|
1287
2057
|
raise ForbiddenError(
|
1288
|
-
|
2058
|
+
headers=dict(_response.headers),
|
2059
|
+
body=typing.cast(
|
1289
2060
|
typing.Optional[typing.Any],
|
1290
2061
|
parse_obj_as(
|
1291
2062
|
type_=typing.Optional[typing.Any], # type: ignore
|
1292
2063
|
object_=_response.json(),
|
1293
2064
|
),
|
1294
|
-
)
|
2065
|
+
),
|
1295
2066
|
)
|
1296
2067
|
if _response.status_code == 404:
|
1297
2068
|
raise NotFoundError(
|
1298
|
-
|
2069
|
+
headers=dict(_response.headers),
|
2070
|
+
body=typing.cast(
|
1299
2071
|
typing.Optional[typing.Any],
|
1300
2072
|
parse_obj_as(
|
1301
2073
|
type_=typing.Optional[typing.Any], # type: ignore
|
1302
2074
|
object_=_response.json(),
|
1303
2075
|
),
|
1304
|
-
)
|
2076
|
+
),
|
1305
2077
|
)
|
1306
2078
|
if _response.status_code == 500:
|
1307
2079
|
raise InternalServerError(
|
1308
|
-
|
2080
|
+
headers=dict(_response.headers),
|
2081
|
+
body=typing.cast(
|
1309
2082
|
typing.Optional[typing.Any],
|
1310
2083
|
parse_obj_as(
|
1311
2084
|
type_=typing.Optional[typing.Any], # type: ignore
|
1312
2085
|
object_=_response.json(),
|
1313
2086
|
),
|
1314
|
-
)
|
2087
|
+
),
|
1315
2088
|
)
|
1316
2089
|
_response_json = _response.json()
|
1317
2090
|
except JSONDecodeError:
|
1318
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1319
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2091
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2092
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
2093
|
+
|
2094
|
+
@contextlib.asynccontextmanager
|
2095
|
+
async def generate_stream(
|
2096
|
+
self,
|
2097
|
+
*,
|
2098
|
+
requests: typing.Sequence[GenerateRequest],
|
2099
|
+
deployment_id: typing.Optional[str] = OMIT,
|
2100
|
+
deployment_name: typing.Optional[str] = OMIT,
|
2101
|
+
options: typing.Optional[GenerateOptionsRequest] = OMIT,
|
2102
|
+
request_options: typing.Optional[RequestOptions] = None,
|
2103
|
+
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[GenerateStreamResponse]]]:
|
2104
|
+
"""
|
2105
|
+
Generate a stream of completions using a previously defined deployment.
|
2106
|
+
|
2107
|
+
Important: This endpoint is DEPRECATED and has been superseded by
|
2108
|
+
[execute-prompt-stream](/api-reference/api-reference/execute-prompt-stream).
|
2109
|
+
|
2110
|
+
Parameters
|
2111
|
+
----------
|
2112
|
+
requests : typing.Sequence[GenerateRequest]
|
2113
|
+
The generation request to make. Bulk requests are no longer supported, this field must be an array of length 1.
|
2114
|
+
|
2115
|
+
deployment_id : typing.Optional[str]
|
2116
|
+
The ID of the deployment. Must provide either this or deployment_name.
|
2117
|
+
|
2118
|
+
deployment_name : typing.Optional[str]
|
2119
|
+
The name of the deployment. Must provide either this or deployment_id.
|
2120
|
+
|
2121
|
+
options : typing.Optional[GenerateOptionsRequest]
|
2122
|
+
Additional configuration that can be used to control what's included in the response.
|
2123
|
+
|
2124
|
+
request_options : typing.Optional[RequestOptions]
|
2125
|
+
Request-specific configuration.
|
2126
|
+
|
2127
|
+
Yields
|
2128
|
+
------
|
2129
|
+
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[GenerateStreamResponse]]]
|
2130
|
+
|
2131
|
+
"""
|
2132
|
+
async with self._client_wrapper.httpx_client.stream(
|
2133
|
+
"v1/generate-stream",
|
2134
|
+
base_url=self._client_wrapper.get_environment().predict,
|
2135
|
+
method="POST",
|
2136
|
+
json={
|
2137
|
+
"deployment_id": deployment_id,
|
2138
|
+
"deployment_name": deployment_name,
|
2139
|
+
"requests": convert_and_respect_annotation_metadata(
|
2140
|
+
object_=requests, annotation=typing.Sequence[GenerateRequest], direction="write"
|
2141
|
+
),
|
2142
|
+
"options": convert_and_respect_annotation_metadata(
|
2143
|
+
object_=options, annotation=typing.Optional[GenerateOptionsRequest], direction="write"
|
2144
|
+
),
|
2145
|
+
},
|
2146
|
+
headers={
|
2147
|
+
"content-type": "application/json",
|
2148
|
+
},
|
2149
|
+
request_options=request_options,
|
2150
|
+
omit=OMIT,
|
2151
|
+
) as _response:
|
2152
|
+
|
2153
|
+
async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[GenerateStreamResponse]]:
|
2154
|
+
try:
|
2155
|
+
if 200 <= _response.status_code < 300:
|
2156
|
+
|
2157
|
+
async def _iter():
|
2158
|
+
async for _text in _response.aiter_lines():
|
2159
|
+
try:
|
2160
|
+
if len(_text) == 0:
|
2161
|
+
continue
|
2162
|
+
yield typing.cast(
|
2163
|
+
GenerateStreamResponse,
|
2164
|
+
parse_obj_as(
|
2165
|
+
type_=GenerateStreamResponse, # type: ignore
|
2166
|
+
object_=json.loads(_text),
|
2167
|
+
),
|
2168
|
+
)
|
2169
|
+
except Exception:
|
2170
|
+
pass
|
2171
|
+
return
|
2172
|
+
|
2173
|
+
return AsyncHttpResponse(response=_response, data=_iter())
|
2174
|
+
await _response.aread()
|
2175
|
+
if _response.status_code == 400:
|
2176
|
+
raise BadRequestError(
|
2177
|
+
headers=dict(_response.headers),
|
2178
|
+
body=typing.cast(
|
2179
|
+
typing.Optional[typing.Any],
|
2180
|
+
parse_obj_as(
|
2181
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2182
|
+
object_=_response.json(),
|
2183
|
+
),
|
2184
|
+
),
|
2185
|
+
)
|
2186
|
+
if _response.status_code == 403:
|
2187
|
+
raise ForbiddenError(
|
2188
|
+
headers=dict(_response.headers),
|
2189
|
+
body=typing.cast(
|
2190
|
+
typing.Optional[typing.Any],
|
2191
|
+
parse_obj_as(
|
2192
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2193
|
+
object_=_response.json(),
|
2194
|
+
),
|
2195
|
+
),
|
2196
|
+
)
|
2197
|
+
if _response.status_code == 404:
|
2198
|
+
raise NotFoundError(
|
2199
|
+
headers=dict(_response.headers),
|
2200
|
+
body=typing.cast(
|
2201
|
+
typing.Optional[typing.Any],
|
2202
|
+
parse_obj_as(
|
2203
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2204
|
+
object_=_response.json(),
|
2205
|
+
),
|
2206
|
+
),
|
2207
|
+
)
|
2208
|
+
if _response.status_code == 500:
|
2209
|
+
raise InternalServerError(
|
2210
|
+
headers=dict(_response.headers),
|
2211
|
+
body=typing.cast(
|
2212
|
+
typing.Optional[typing.Any],
|
2213
|
+
parse_obj_as(
|
2214
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2215
|
+
object_=_response.json(),
|
2216
|
+
),
|
2217
|
+
),
|
2218
|
+
)
|
2219
|
+
_response_json = _response.json()
|
2220
|
+
except JSONDecodeError:
|
2221
|
+
raise ApiError(
|
2222
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
|
2223
|
+
)
|
2224
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
2225
|
+
|
2226
|
+
yield await _stream()
|
1320
2227
|
|
1321
2228
|
async def search(
|
1322
2229
|
self,
|
@@ -1387,38 +2294,41 @@ class AsyncRawVellum:
|
|
1387
2294
|
return AsyncHttpResponse(response=_response, data=_data)
|
1388
2295
|
if _response.status_code == 400:
|
1389
2296
|
raise BadRequestError(
|
1390
|
-
|
2297
|
+
headers=dict(_response.headers),
|
2298
|
+
body=typing.cast(
|
1391
2299
|
typing.Optional[typing.Any],
|
1392
2300
|
parse_obj_as(
|
1393
2301
|
type_=typing.Optional[typing.Any], # type: ignore
|
1394
2302
|
object_=_response.json(),
|
1395
2303
|
),
|
1396
|
-
)
|
2304
|
+
),
|
1397
2305
|
)
|
1398
2306
|
if _response.status_code == 404:
|
1399
2307
|
raise NotFoundError(
|
1400
|
-
|
2308
|
+
headers=dict(_response.headers),
|
2309
|
+
body=typing.cast(
|
1401
2310
|
typing.Optional[typing.Any],
|
1402
2311
|
parse_obj_as(
|
1403
2312
|
type_=typing.Optional[typing.Any], # type: ignore
|
1404
2313
|
object_=_response.json(),
|
1405
2314
|
),
|
1406
|
-
)
|
2315
|
+
),
|
1407
2316
|
)
|
1408
2317
|
if _response.status_code == 500:
|
1409
2318
|
raise InternalServerError(
|
1410
|
-
|
2319
|
+
headers=dict(_response.headers),
|
2320
|
+
body=typing.cast(
|
1411
2321
|
typing.Optional[typing.Any],
|
1412
2322
|
parse_obj_as(
|
1413
2323
|
type_=typing.Optional[typing.Any], # type: ignore
|
1414
2324
|
object_=_response.json(),
|
1415
2325
|
),
|
1416
|
-
)
|
2326
|
+
),
|
1417
2327
|
)
|
1418
2328
|
_response_json = _response.json()
|
1419
2329
|
except JSONDecodeError:
|
1420
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1421
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2330
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2331
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1422
2332
|
|
1423
2333
|
async def submit_completion_actuals(
|
1424
2334
|
self,
|
@@ -1471,38 +2381,41 @@ class AsyncRawVellum:
|
|
1471
2381
|
return AsyncHttpResponse(response=_response, data=None)
|
1472
2382
|
if _response.status_code == 400:
|
1473
2383
|
raise BadRequestError(
|
1474
|
-
|
2384
|
+
headers=dict(_response.headers),
|
2385
|
+
body=typing.cast(
|
1475
2386
|
typing.Optional[typing.Any],
|
1476
2387
|
parse_obj_as(
|
1477
2388
|
type_=typing.Optional[typing.Any], # type: ignore
|
1478
2389
|
object_=_response.json(),
|
1479
2390
|
),
|
1480
|
-
)
|
2391
|
+
),
|
1481
2392
|
)
|
1482
2393
|
if _response.status_code == 404:
|
1483
2394
|
raise NotFoundError(
|
1484
|
-
|
2395
|
+
headers=dict(_response.headers),
|
2396
|
+
body=typing.cast(
|
1485
2397
|
typing.Optional[typing.Any],
|
1486
2398
|
parse_obj_as(
|
1487
2399
|
type_=typing.Optional[typing.Any], # type: ignore
|
1488
2400
|
object_=_response.json(),
|
1489
2401
|
),
|
1490
|
-
)
|
2402
|
+
),
|
1491
2403
|
)
|
1492
2404
|
if _response.status_code == 500:
|
1493
2405
|
raise InternalServerError(
|
1494
|
-
|
2406
|
+
headers=dict(_response.headers),
|
2407
|
+
body=typing.cast(
|
1495
2408
|
typing.Optional[typing.Any],
|
1496
2409
|
parse_obj_as(
|
1497
2410
|
type_=typing.Optional[typing.Any], # type: ignore
|
1498
2411
|
object_=_response.json(),
|
1499
2412
|
),
|
1500
|
-
)
|
2413
|
+
),
|
1501
2414
|
)
|
1502
2415
|
_response_json = _response.json()
|
1503
2416
|
except JSONDecodeError:
|
1504
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1505
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2417
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2418
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1506
2419
|
|
1507
2420
|
async def submit_workflow_execution_actuals(
|
1508
2421
|
self,
|
@@ -1557,5 +2470,5 @@ class AsyncRawVellum:
|
|
1557
2470
|
return AsyncHttpResponse(response=_response, data=None)
|
1558
2471
|
_response_json = _response.json()
|
1559
2472
|
except JSONDecodeError:
|
1560
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1561
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
2473
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2474
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|