vellum_ai 0.3.15 → 0.14.74
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.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/lib/core/file_utilities.rb +14 -13
- data/lib/environment.rb +4 -6
- data/lib/requests.rb +141 -59
- data/lib/types_export.rb +392 -110
- data/lib/vellum_ai/ad_hoc/client.rb +179 -0
- data/lib/vellum_ai/container_images/client.rb +289 -0
- data/lib/vellum_ai/deployments/client.rb +581 -111
- data/lib/vellum_ai/deployments/types/deployments_list_request_status.rb +7 -3
- data/lib/vellum_ai/deployments/types/list_deployment_release_tags_request_source.rb +12 -0
- data/lib/vellum_ai/document_indexes/client.rb +517 -261
- data/lib/vellum_ai/document_indexes/types/document_indexes_list_request_status.rb +7 -3
- data/lib/vellum_ai/documents/client.rb +337 -186
- data/lib/vellum_ai/folder_entities/client.rb +165 -33
- data/lib/vellum_ai/folder_entities/types/folder_entities_list_request_entity_status.rb +12 -0
- data/lib/vellum_ai/metric_definitions/client.rb +159 -0
- data/lib/vellum_ai/ml_models/client.rb +94 -0
- data/lib/vellum_ai/organizations/client.rb +92 -0
- data/lib/vellum_ai/prompts/client.rb +194 -0
- data/lib/vellum_ai/release_reviews/client.rb +102 -0
- data/lib/vellum_ai/sandboxes/client.rb +230 -90
- data/lib/vellum_ai/test_suite_runs/client.rb +188 -101
- data/lib/vellum_ai/test_suites/client.rb +208 -90
- data/lib/vellum_ai/types/ad_hoc_execute_prompt_event.rb +90 -0
- data/lib/vellum_ai/types/ad_hoc_expand_meta.rb +85 -0
- data/lib/vellum_ai/types/ad_hoc_fulfilled_prompt_execution_meta.rb +92 -0
- data/lib/vellum_ai/types/ad_hoc_initiated_prompt_execution_meta.rb +65 -0
- data/lib/vellum_ai/types/ad_hoc_rejected_prompt_execution_meta.rb +66 -0
- data/lib/vellum_ai/types/ad_hoc_streaming_prompt_execution_meta.rb +55 -0
- data/lib/vellum_ai/types/api_node_result.rb +43 -27
- data/lib/vellum_ai/types/api_node_result_data.rb +62 -51
- data/lib/vellum_ai/types/api_request_parent_context.rb +87 -0
- data/lib/vellum_ai/types/{image_enum.rb → api_version_enum.rb} +2 -2
- data/lib/vellum_ai/types/array_chat_message_content.rb +42 -26
- data/lib/vellum_ai/types/array_chat_message_content_item.rb +85 -82
- data/lib/vellum_ai/types/array_chat_message_content_item_request.rb +85 -82
- data/lib/vellum_ai/types/array_chat_message_content_request.rb +42 -26
- data/lib/vellum_ai/types/array_input.rb +73 -0
- data/lib/vellum_ai/types/array_vellum_value.rb +68 -0
- data/lib/vellum_ai/types/array_vellum_value_request.rb +68 -0
- data/lib/vellum_ai/types/audio_chat_message_content.rb +68 -0
- data/lib/vellum_ai/types/audio_chat_message_content_request.rb +68 -0
- data/lib/vellum_ai/types/audio_prompt_block.rb +92 -0
- data/lib/vellum_ai/types/audio_vellum_value.rb +70 -0
- data/lib/vellum_ai/types/audio_vellum_value_request.rb +70 -0
- data/lib/vellum_ai/types/base_output.rb +70 -0
- data/lib/vellum_ai/types/basic_vectorizer_intfloat_multilingual_e_5_large.rb +66 -0
- data/lib/vellum_ai/types/basic_vectorizer_intfloat_multilingual_e_5_large_request.rb +66 -0
- data/lib/vellum_ai/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1.rb +66 -0
- data/lib/vellum_ai/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1_request.rb +66 -0
- data/lib/vellum_ai/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1.rb +66 -0
- data/lib/vellum_ai/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1_request.rb +66 -0
- data/lib/vellum_ai/types/build_status_enum.rb +18 -0
- data/lib/vellum_ai/types/chat_history_input.rb +73 -0
- data/lib/vellum_ai/types/chat_history_input_request.rb +46 -28
- data/lib/vellum_ai/types/chat_history_vellum_value.rb +68 -0
- data/lib/vellum_ai/types/chat_history_vellum_value_request.rb +68 -0
- data/lib/vellum_ai/types/chat_message.rb +55 -38
- data/lib/vellum_ai/types/chat_message_content.rb +100 -94
- data/lib/vellum_ai/types/chat_message_content_request.rb +100 -94
- data/lib/vellum_ai/types/chat_message_prompt_block.rb +111 -0
- data/lib/vellum_ai/types/chat_message_request.rb +55 -38
- data/lib/vellum_ai/types/chat_message_role.rb +13 -3
- data/lib/vellum_ai/types/code_execution_node_array_result.rb +50 -30
- data/lib/vellum_ai/types/code_execution_node_chat_history_result.rb +49 -29
- data/lib/vellum_ai/types/code_execution_node_error_result.rb +50 -30
- data/lib/vellum_ai/types/code_execution_node_function_call_result.rb +50 -30
- data/lib/vellum_ai/types/code_execution_node_json_result.rb +45 -27
- data/lib/vellum_ai/types/code_execution_node_number_result.rb +47 -27
- data/lib/vellum_ai/types/code_execution_node_result.rb +43 -27
- data/lib/vellum_ai/types/code_execution_node_result_data.rb +43 -30
- data/lib/vellum_ai/types/code_execution_node_result_output.rb +129 -143
- data/lib/vellum_ai/types/code_execution_node_search_results_result.rb +49 -29
- data/lib/vellum_ai/types/code_execution_node_string_result.rb +47 -27
- data/lib/vellum_ai/types/code_execution_package.rb +61 -0
- data/lib/vellum_ai/types/code_execution_runtime.rb +12 -0
- data/lib/vellum_ai/types/code_executor_input.rb +170 -0
- data/lib/vellum_ai/types/code_executor_response.rb +67 -0
- data/lib/vellum_ai/types/code_executor_secret_input.rb +69 -0
- data/lib/vellum_ai/types/code_resource_definition.rb +62 -0
- data/lib/vellum_ai/types/compile_prompt_deployment_expand_meta_request.rb +76 -0
- data/lib/vellum_ai/types/compile_prompt_meta.rb +72 -0
- data/lib/vellum_ai/types/components_schemas_pdf_search_result_meta_source.rb +6 -0
- data/lib/vellum_ai/types/components_schemas_pdf_search_result_meta_source_request.rb +6 -0
- data/lib/vellum_ai/types/components_schemas_prompt_version_build_config_sandbox.rb +6 -0
- data/lib/vellum_ai/types/condition_combinator.rb +12 -0
- data/lib/vellum_ai/types/conditional_node_result.rb +43 -27
- data/lib/vellum_ai/types/conditional_node_result_data.rb +31 -23
- data/lib/vellum_ai/types/container_image_build_config.rb +55 -0
- data/lib/vellum_ai/types/container_image_container_image_tag.rb +66 -0
- data/lib/vellum_ai/types/container_image_read.rb +141 -0
- data/lib/vellum_ai/types/create_test_suite_test_case_request.rb +89 -0
- data/lib/vellum_ai/types/deployment_history_item.rb +107 -0
- data/lib/vellum_ai/types/deployment_provider_payload_response.rb +54 -24
- data/lib/vellum_ai/types/deployment_provider_payload_response_payload.rb +57 -0
- data/lib/vellum_ai/types/deployment_read.rb +113 -76
- data/lib/vellum_ai/types/deployment_release_tag_deployment_history_item.rb +68 -0
- data/lib/vellum_ai/types/deployment_release_tag_read.rb +92 -0
- data/lib/vellum_ai/types/docker_service_token.rb +68 -0
- data/lib/vellum_ai/types/document_chat_message_content.rb +68 -0
- data/lib/vellum_ai/types/document_chat_message_content_request.rb +68 -0
- data/lib/vellum_ai/types/document_document_to_document_index.rb +76 -43
- data/lib/vellum_ai/types/document_index_chunking.rb +74 -0
- data/lib/vellum_ai/types/document_index_chunking_request.rb +74 -0
- data/lib/vellum_ai/types/document_index_indexing_config.rb +75 -0
- data/lib/vellum_ai/types/document_index_indexing_config_request.rb +75 -0
- data/lib/vellum_ai/types/document_index_read.rb +73 -64
- data/lib/vellum_ai/types/document_processing_state.rb +18 -0
- data/lib/vellum_ai/types/document_prompt_block.rb +92 -0
- data/lib/vellum_ai/types/document_read.rb +91 -83
- data/lib/vellum_ai/types/document_status.rb +1 -1
- data/lib/vellum_ai/types/document_vellum_value.rb +70 -0
- data/lib/vellum_ai/types/document_vellum_value_request.rb +70 -0
- data/lib/vellum_ai/types/enriched_normalized_completion.rb +97 -78
- data/lib/vellum_ai/types/entity_status.rb +9 -3
- data/lib/vellum_ai/types/entity_visibility.rb +16 -0
- data/lib/vellum_ai/types/environment_enum.rb +11 -3
- data/lib/vellum_ai/types/ephemeral_prompt_cache_config.rb +54 -0
- data/lib/vellum_ai/types/ephemeral_prompt_cache_config_type_enum.rb +5 -0
- data/lib/vellum_ai/types/error_input.rb +75 -0
- data/lib/vellum_ai/types/error_vellum_value.rb +70 -0
- data/lib/vellum_ai/types/error_vellum_value_request.rb +70 -0
- data/lib/vellum_ai/types/execute_api_request_bearer_token.rb +57 -0
- data/lib/vellum_ai/types/execute_api_request_body.rb +71 -0
- data/lib/vellum_ai/types/execute_api_request_headers_value.rb +57 -0
- data/lib/vellum_ai/types/execute_api_response.rb +83 -0
- data/lib/vellum_ai/types/execute_api_response_json.rb +56 -0
- data/lib/vellum_ai/types/execute_prompt_event.rb +68 -94
- data/lib/vellum_ai/types/execute_prompt_response.rb +38 -70
- data/lib/vellum_ai/types/execute_workflow_response.rb +54 -38
- data/lib/vellum_ai/types/execute_workflow_workflow_result_event.rb +38 -70
- data/lib/vellum_ai/types/execution_array_vellum_value.rb +55 -32
- data/lib/vellum_ai/types/execution_chat_history_vellum_value.rb +54 -31
- data/lib/vellum_ai/types/execution_error_vellum_value.rb +55 -32
- data/lib/vellum_ai/types/execution_function_call_vellum_value.rb +55 -32
- data/lib/vellum_ai/types/execution_json_vellum_value.rb +50 -29
- data/lib/vellum_ai/types/execution_number_vellum_value.rb +52 -29
- data/lib/vellum_ai/types/execution_search_results_vellum_value.rb +54 -31
- data/lib/vellum_ai/types/execution_string_vellum_value.rb +52 -29
- data/lib/vellum_ai/types/execution_vellum_value.rb +129 -143
- data/lib/vellum_ai/types/external_input_descriptor.rb +86 -0
- data/lib/vellum_ai/types/external_test_case_execution.rb +67 -0
- data/lib/vellum_ai/types/external_test_case_execution_request.rb +67 -0
- data/lib/vellum_ai/types/fast_embed_vectorizer_baai_bge_small_en_v_15.rb +52 -0
- data/lib/vellum_ai/types/fast_embed_vectorizer_baai_bge_small_en_v_15_request.rb +54 -0
- data/lib/vellum_ai/types/finish_reason_enum.rb +11 -3
- data/lib/vellum_ai/types/folder_entity.rb +122 -0
- data/lib/vellum_ai/types/folder_entity_dataset.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_dataset_data.rb +101 -0
- data/lib/vellum_ai/types/folder_entity_document_index.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_document_index_data.rb +106 -0
- data/lib/vellum_ai/types/folder_entity_folder.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_folder_data.rb +92 -0
- data/lib/vellum_ai/types/folder_entity_prompt_sandbox.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_prompt_sandbox_data.rb +114 -0
- data/lib/vellum_ai/types/folder_entity_test_suite.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_test_suite_data.rb +93 -0
- data/lib/vellum_ai/types/folder_entity_workflow_sandbox.rb +75 -0
- data/lib/vellum_ai/types/folder_entity_workflow_sandbox_data.rb +114 -0
- data/lib/vellum_ai/types/fulfilled_ad_hoc_execute_prompt_event.rb +89 -0
- data/lib/vellum_ai/types/fulfilled_execute_prompt_event.rb +60 -37
- data/lib/vellum_ai/types/fulfilled_execute_prompt_response.rb +67 -40
- data/lib/vellum_ai/types/fulfilled_execute_workflow_workflow_result_event.rb +59 -32
- data/lib/vellum_ai/types/fulfilled_prompt_execution_meta.rb +69 -29
- data/lib/vellum_ai/types/fulfilled_workflow_node_result_event.rb +92 -68
- data/lib/vellum_ai/types/function_call.rb +53 -72
- data/lib/vellum_ai/types/function_call_chat_message_content.rb +43 -27
- data/lib/vellum_ai/types/function_call_chat_message_content_request.rb +44 -27
- data/lib/vellum_ai/types/function_call_chat_message_content_value.rb +46 -31
- data/lib/vellum_ai/types/function_call_chat_message_content_value_request.rb +48 -31
- data/lib/vellum_ai/types/function_call_input.rb +75 -0
- data/lib/vellum_ai/types/function_call_prompt_block.rb +99 -0
- data/lib/vellum_ai/types/function_call_request.rb +71 -0
- data/lib/vellum_ai/types/function_call_vellum_value.rb +70 -0
- data/lib/vellum_ai/types/function_call_vellum_value_request.rb +70 -0
- data/lib/vellum_ai/types/function_definition.rb +109 -0
- data/lib/vellum_ai/types/generate_options_request.rb +35 -27
- data/lib/vellum_ai/types/generate_request.rb +52 -34
- data/lib/vellum_ai/types/generate_response.rb +29 -23
- data/lib/vellum_ai/types/generate_result.rb +52 -35
- data/lib/vellum_ai/types/generate_result_data.rb +29 -23
- data/lib/vellum_ai/types/generate_result_error.rb +26 -20
- data/lib/vellum_ai/types/generate_stream_response.rb +30 -24
- data/lib/vellum_ai/types/generate_stream_result.rb +53 -38
- data/lib/vellum_ai/types/generate_stream_result_data.rb +39 -28
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_config.rb +61 -0
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_config_request.rb +62 -0
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_text_embedding_004.rb +69 -0
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_text_embedding_004_request.rb +69 -0
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_text_multilingual_embedding_002.rb +69 -0
- data/lib/vellum_ai/types/google_vertex_ai_vectorizer_text_multilingual_embedding_002_request.rb +69 -0
- data/lib/vellum_ai/types/hkunlp_instructor_xl_vectorizer.rb +68 -0
- data/lib/vellum_ai/types/hkunlp_instructor_xl_vectorizer_request.rb +68 -0
- data/lib/vellum_ai/types/image_chat_message_content.rb +43 -27
- data/lib/vellum_ai/types/image_chat_message_content_request.rb +43 -27
- data/lib/vellum_ai/types/image_prompt_block.rb +92 -0
- data/lib/vellum_ai/types/image_vellum_value.rb +70 -0
- data/lib/vellum_ai/types/image_vellum_value_request.rb +70 -0
- data/lib/vellum_ai/types/indexing_config_vectorizer.rb +186 -0
- data/lib/vellum_ai/types/indexing_config_vectorizer_request.rb +186 -0
- data/lib/vellum_ai/types/indexing_state_enum.rb +15 -9
- data/lib/vellum_ai/types/initiated_ad_hoc_execute_prompt_event.rb +78 -0
- data/lib/vellum_ai/types/initiated_execute_prompt_event.rb +52 -31
- data/lib/vellum_ai/types/initiated_prompt_execution_meta.rb +55 -44
- data/lib/vellum_ai/types/initiated_workflow_node_result_event.rb +86 -62
- data/lib/vellum_ai/types/instructor_vectorizer_config.rb +69 -0
- data/lib/vellum_ai/types/instructor_vectorizer_config_request.rb +69 -0
- data/lib/vellum_ai/types/invoked_port.rb +51 -0
- data/lib/vellum_ai/types/iteration_state_enum.rb +14 -0
- data/lib/vellum_ai/types/jinja_prompt_block.rb +85 -0
- data/lib/vellum_ai/types/json_input.rb +69 -0
- data/lib/vellum_ai/types/json_input_request.rb +46 -28
- data/lib/vellum_ai/types/json_vellum_value.rb +62 -0
- data/lib/vellum_ai/types/json_vellum_value_request.rb +62 -0
- data/lib/vellum_ai/types/logical_operator.rb +57 -22
- data/lib/vellum_ai/types/logprobs_enum.rb +9 -3
- data/lib/vellum_ai/types/map_node_result.rb +70 -0
- data/lib/vellum_ai/types/map_node_result_data.rb +64 -0
- data/lib/vellum_ai/types/merge_node_result.rb +68 -0
- data/lib/vellum_ai/types/merge_node_result_data.rb +53 -0
- data/lib/vellum_ai/types/metadata_filter_config_request.rb +71 -57
- data/lib/vellum_ai/types/metadata_filter_rule_combinator.rb +9 -3
- data/lib/vellum_ai/types/metadata_filter_rule_request.rb +69 -57
- data/lib/vellum_ai/types/metadata_filters_request.rb +58 -0
- data/lib/vellum_ai/types/method_enum.rb +18 -0
- data/lib/vellum_ai/types/metric_definition_execution.rb +55 -0
- data/lib/vellum_ai/types/metric_definition_history_item.rb +96 -0
- data/lib/vellum_ai/types/metric_definition_input.rb +90 -0
- data/lib/vellum_ai/types/metric_node_result.rb +52 -0
- data/lib/vellum_ai/types/ml_model_read.rb +62 -0
- data/lib/vellum_ai/types/ml_model_usage.rb +98 -0
- data/lib/vellum_ai/types/ml_model_usage_wrapper.rb +67 -0
- data/lib/vellum_ai/types/named_scenario_input_chat_history_variable_value_request.rb +77 -0
- data/lib/vellum_ai/types/named_scenario_input_json_variable_value_request.rb +71 -0
- data/lib/vellum_ai/types/named_scenario_input_request.rb +74 -0
- data/lib/vellum_ai/types/named_scenario_input_string_variable_value_request.rb +73 -0
- data/lib/vellum_ai/types/named_test_case_array_variable_value.rb +75 -0
- data/lib/vellum_ai/types/named_test_case_array_variable_value_request.rb +76 -0
- data/lib/vellum_ai/types/named_test_case_chat_history_variable_value.rb +76 -0
- data/lib/vellum_ai/types/named_test_case_chat_history_variable_value_request.rb +53 -30
- data/lib/vellum_ai/types/named_test_case_error_variable_value.rb +77 -0
- data/lib/vellum_ai/types/named_test_case_error_variable_value_request.rb +52 -30
- data/lib/vellum_ai/types/named_test_case_function_call_variable_value.rb +78 -0
- data/lib/vellum_ai/types/named_test_case_function_call_variable_value_request.rb +79 -0
- data/lib/vellum_ai/types/named_test_case_json_variable_value.rb +69 -0
- data/lib/vellum_ai/types/named_test_case_json_variable_value_request.rb +48 -28
- data/lib/vellum_ai/types/named_test_case_number_variable_value.rb +71 -0
- data/lib/vellum_ai/types/named_test_case_number_variable_value_request.rb +51 -28
- data/lib/vellum_ai/types/named_test_case_search_results_variable_value.rb +77 -0
- data/lib/vellum_ai/types/named_test_case_search_results_variable_value_request.rb +53 -30
- data/lib/vellum_ai/types/named_test_case_string_variable_value.rb +71 -0
- data/lib/vellum_ai/types/named_test_case_string_variable_value_request.rb +51 -28
- data/lib/vellum_ai/types/named_test_case_variable_value.rb +154 -0
- data/lib/vellum_ai/types/named_test_case_variable_value_request.rb +131 -119
- data/lib/vellum_ai/types/new_member_join_behavior_enum.rb +14 -0
- data/lib/vellum_ai/types/node_execution_fulfilled_body.rb +87 -0
- data/lib/vellum_ai/types/node_execution_fulfilled_event.rb +134 -0
- data/lib/vellum_ai/types/node_execution_initiated_body.rb +67 -0
- data/lib/vellum_ai/types/node_execution_initiated_event.rb +134 -0
- data/lib/vellum_ai/types/node_execution_paused_body.rb +57 -0
- data/lib/vellum_ai/types/node_execution_paused_event.rb +134 -0
- data/lib/vellum_ai/types/node_execution_rejected_body.rb +73 -0
- data/lib/vellum_ai/types/node_execution_rejected_event.rb +134 -0
- data/lib/vellum_ai/types/node_execution_resumed_body.rb +57 -0
- data/lib/vellum_ai/types/node_execution_resumed_event.rb +134 -0
- data/lib/vellum_ai/types/node_execution_span.rb +118 -0
- data/lib/vellum_ai/types/node_execution_span_attributes.rb +51 -0
- data/lib/vellum_ai/types/node_execution_streaming_body.rb +73 -0
- data/lib/vellum_ai/types/node_execution_streaming_event.rb +134 -0
- data/lib/vellum_ai/types/node_input_compiled_array_value.rb +55 -33
- data/lib/vellum_ai/types/node_input_compiled_chat_history_value.rb +54 -32
- data/lib/vellum_ai/types/node_input_compiled_error_value.rb +55 -33
- data/lib/vellum_ai/types/node_input_compiled_function_call_value.rb +83 -0
- data/lib/vellum_ai/types/node_input_compiled_json_value.rb +50 -30
- data/lib/vellum_ai/types/node_input_compiled_number_value.rb +52 -30
- data/lib/vellum_ai/types/node_input_compiled_search_results_value.rb +54 -32
- data/lib/vellum_ai/types/node_input_compiled_secret_value.rb +81 -0
- data/lib/vellum_ai/types/node_input_compiled_string_value.rb +52 -30
- data/lib/vellum_ai/types/node_input_variable_compiled_value.rb +146 -144
- data/lib/vellum_ai/types/node_output_compiled_array_value.rb +60 -31
- data/lib/vellum_ai/types/node_output_compiled_chat_history_value.rb +59 -30
- data/lib/vellum_ai/types/node_output_compiled_error_value.rb +59 -30
- data/lib/vellum_ai/types/node_output_compiled_function_call_value.rb +85 -0
- data/lib/vellum_ai/types/node_output_compiled_json_value.rb +57 -28
- data/lib/vellum_ai/types/node_output_compiled_number_value.rb +57 -28
- data/lib/vellum_ai/types/node_output_compiled_search_results_value.rb +59 -30
- data/lib/vellum_ai/types/node_output_compiled_string_value.rb +57 -28
- data/lib/vellum_ai/types/node_output_compiled_value.rb +130 -144
- data/lib/vellum_ai/types/node_parent_context.rb +100 -0
- data/lib/vellum_ai/types/normalized_log_probs.rb +42 -29
- data/lib/vellum_ai/types/normalized_token_log_probs.rb +51 -35
- data/lib/vellum_ai/types/number_input.rb +69 -0
- data/lib/vellum_ai/types/number_vellum_value.rb +64 -0
- data/lib/vellum_ai/types/number_vellum_value_request.rb +64 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_config.rb +54 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_config_request.rb +54 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_3_large.rb +68 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_3_large_request.rb +70 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_3_small.rb +68 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_3_small_request.rb +70 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_ada_002.rb +68 -0
- data/lib/vellum_ai/types/open_ai_vectorizer_text_embedding_ada_002_request.rb +70 -0
- data/lib/vellum_ai/types/organization_read.rb +78 -0
- data/lib/vellum_ai/types/paginated_container_image_read_list.rb +81 -0
- data/lib/vellum_ai/types/paginated_deployment_release_tag_read_list.rb +82 -0
- data/lib/vellum_ai/types/paginated_document_index_read_list.rb +55 -38
- data/lib/vellum_ai/types/paginated_folder_entity_list.rb +81 -0
- data/lib/vellum_ai/types/paginated_slim_deployment_read_list.rb +55 -38
- data/lib/vellum_ai/types/paginated_slim_document_list.rb +55 -38
- data/lib/vellum_ai/types/paginated_slim_workflow_deployment_list.rb +55 -38
- data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +53 -36
- data/lib/vellum_ai/types/paginated_test_suite_test_case_list.rb +81 -0
- data/lib/vellum_ai/types/paginated_workflow_release_tag_read_list.rb +81 -0
- data/lib/vellum_ai/types/paginated_workflow_sandbox_example_list.rb +81 -0
- data/lib/vellum_ai/types/parent_context.rb +122 -0
- data/lib/vellum_ai/types/pdf_search_result_meta_source.rb +75 -0
- data/lib/vellum_ai/types/pdf_search_result_meta_source_request.rb +75 -0
- data/lib/vellum_ai/types/plain_text_prompt_block.rb +85 -0
- data/lib/vellum_ai/types/price.rb +62 -0
- data/lib/vellum_ai/types/processing_failure_reason_enum.rb +9 -6
- data/lib/vellum_ai/types/prompt_block.rb +154 -0
- data/lib/vellum_ai/types/prompt_block_state.rb +12 -0
- data/lib/vellum_ai/types/prompt_deployment_expand_meta_request.rb +110 -0
- data/lib/vellum_ai/types/prompt_deployment_input_request.rb +53 -82
- data/lib/vellum_ai/types/prompt_deployment_parent_context.rb +143 -0
- data/lib/vellum_ai/types/prompt_deployment_release.rb +149 -0
- data/lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb +53 -0
- data/lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb +68 -0
- data/lib/vellum_ai/types/prompt_exec_config.rb +115 -0
- data/lib/vellum_ai/types/prompt_execution_meta.rb +87 -50
- data/lib/vellum_ai/types/prompt_node_execution_meta.rb +84 -0
- data/lib/vellum_ai/types/prompt_node_result.rb +43 -27
- data/lib/vellum_ai/types/prompt_node_result_data.rb +72 -36
- data/lib/vellum_ai/types/prompt_output.rb +72 -98
- data/lib/vellum_ai/types/prompt_parameters.rb +112 -0
- data/lib/vellum_ai/types/prompt_push_response.rb +61 -0
- data/lib/vellum_ai/types/prompt_request_chat_history_input.rb +72 -0
- data/lib/vellum_ai/types/prompt_request_input.rb +74 -0
- data/lib/vellum_ai/types/prompt_request_json_input.rb +68 -0
- data/lib/vellum_ai/types/prompt_request_string_input.rb +68 -0
- data/lib/vellum_ai/types/prompt_settings.rb +63 -0
- data/lib/vellum_ai/types/prompt_version_build_config_sandbox.rb +75 -0
- data/lib/vellum_ai/types/raw_prompt_execution_overrides_request.rb +45 -30
- data/lib/vellum_ai/types/reducto_chunker_config.rb +54 -0
- data/lib/vellum_ai/types/reducto_chunker_config_request.rb +54 -0
- data/lib/vellum_ai/types/reducto_chunking.rb +70 -0
- data/lib/vellum_ai/types/reducto_chunking_request.rb +70 -0
- data/lib/vellum_ai/types/rejected_ad_hoc_execute_prompt_event.rb +90 -0
- data/lib/vellum_ai/types/rejected_execute_prompt_event.rb +60 -38
- data/lib/vellum_ai/types/rejected_execute_prompt_response.rb +67 -41
- data/lib/vellum_ai/types/rejected_execute_workflow_workflow_result_event.rb +60 -33
- data/lib/vellum_ai/types/rejected_prompt_execution_meta.rb +43 -29
- data/lib/vellum_ai/types/rejected_workflow_node_result_event.rb +86 -62
- data/lib/vellum_ai/types/release_created_by.rb +70 -0
- data/lib/vellum_ai/types/release_environment.rb +68 -0
- data/lib/vellum_ai/types/release_release_tag.rb +66 -0
- data/lib/vellum_ai/types/release_review_reviewer.rb +63 -0
- data/lib/vellum_ai/types/release_review_state.rb +14 -0
- data/lib/vellum_ai/types/release_tag_release.rb +66 -0
- data/lib/vellum_ai/types/release_tag_source.rb +12 -0
- data/lib/vellum_ai/types/replace_test_suite_test_case_request.rb +98 -0
- data/lib/vellum_ai/types/rich_text_child_block.rb +58 -0
- data/lib/vellum_ai/types/rich_text_prompt_block.rb +89 -0
- data/lib/vellum_ai/types/sandbox_scenario.rb +47 -31
- data/lib/vellum_ai/types/scenario_input.rb +57 -53
- data/lib/vellum_ai/types/scenario_input_chat_history_variable_value.rb +76 -0
- data/lib/vellum_ai/types/scenario_input_json_variable_value.rb +69 -0
- data/lib/vellum_ai/types/scenario_input_string_variable_value.rb +71 -0
- data/lib/vellum_ai/types/search_filters_request.rb +44 -31
- data/lib/vellum_ai/types/search_node_result.rb +43 -27
- data/lib/vellum_ai/types/search_node_result_data.rb +54 -41
- data/lib/vellum_ai/types/search_request_options_request.rb +63 -47
- data/lib/vellum_ai/types/search_response.rb +31 -23
- data/lib/vellum_ai/types/search_result.rb +62 -32
- data/lib/vellum_ai/types/search_result_document.rb +55 -34
- data/lib/vellum_ai/types/search_result_document_request.rb +56 -30
- data/lib/vellum_ai/types/search_result_merging_request.rb +30 -22
- data/lib/vellum_ai/types/search_result_meta.rb +60 -0
- data/lib/vellum_ai/types/search_result_meta_request.rb +60 -0
- data/lib/vellum_ai/types/search_result_request.rb +62 -32
- data/lib/vellum_ai/types/search_results_input.rb +73 -0
- data/lib/vellum_ai/types/search_results_vellum_value.rb +68 -0
- data/lib/vellum_ai/types/search_results_vellum_value_request.rb +68 -0
- data/lib/vellum_ai/types/search_weights_request.rb +39 -26
- data/lib/vellum_ai/types/secret_type_enum.rb +16 -0
- data/lib/vellum_ai/types/sentence_chunker_config.rb +64 -0
- data/lib/vellum_ai/types/sentence_chunker_config_request.rb +64 -0
- data/lib/vellum_ai/types/sentence_chunking.rb +70 -0
- data/lib/vellum_ai/types/sentence_chunking_request.rb +70 -0
- data/lib/vellum_ai/types/slim_deployment_read.rb +99 -70
- data/lib/vellum_ai/types/slim_document.rb +102 -85
- data/lib/vellum_ai/types/slim_document_document_to_document_index.rb +96 -0
- data/lib/vellum_ai/types/slim_release_review.rb +87 -0
- data/lib/vellum_ai/types/slim_workflow_deployment.rb +109 -77
- data/lib/vellum_ai/types/slim_workflow_execution_read.rb +162 -0
- data/lib/vellum_ai/types/span_link.rb +75 -0
- data/lib/vellum_ai/types/{chat_history_enum.rb → span_link_type_enum.rb} +2 -2
- data/lib/vellum_ai/types/streaming_ad_hoc_execute_prompt_event.rb +106 -0
- data/lib/vellum_ai/types/streaming_execute_prompt_event.rb +73 -52
- data/lib/vellum_ai/types/streaming_prompt_execution_meta.rb +33 -24
- data/lib/vellum_ai/types/streaming_workflow_node_result_event.rb +93 -69
- data/lib/vellum_ai/types/string_chat_message_content.rb +40 -24
- data/lib/vellum_ai/types/string_chat_message_content_request.rb +40 -24
- data/lib/vellum_ai/types/string_input.rb +69 -0
- data/lib/vellum_ai/types/string_input_request.rb +45 -27
- data/lib/vellum_ai/types/string_vellum_value.rb +64 -0
- data/lib/vellum_ai/types/string_vellum_value_request.rb +64 -0
- data/lib/vellum_ai/types/submit_completion_actual_request.rb +76 -39
- data/lib/vellum_ai/types/submit_workflow_execution_actual_request.rb +53 -82
- data/lib/vellum_ai/types/subworkflow_node_result.rb +51 -21
- data/lib/vellum_ai/types/subworkflow_node_result_data.rb +53 -0
- data/lib/vellum_ai/types/templating_node_array_result.rb +50 -30
- data/lib/vellum_ai/types/templating_node_chat_history_result.rb +49 -29
- data/lib/vellum_ai/types/templating_node_error_result.rb +50 -30
- data/lib/vellum_ai/types/templating_node_function_call_result.rb +50 -30
- data/lib/vellum_ai/types/templating_node_json_result.rb +45 -27
- data/lib/vellum_ai/types/templating_node_number_result.rb +47 -27
- data/lib/vellum_ai/types/templating_node_result.rb +43 -27
- data/lib/vellum_ai/types/templating_node_result_data.rb +30 -24
- data/lib/vellum_ai/types/templating_node_result_output.rb +129 -143
- data/lib/vellum_ai/types/templating_node_search_results_result.rb +49 -29
- data/lib/vellum_ai/types/templating_node_string_result.rb +47 -27
- data/lib/vellum_ai/types/terminal_node_array_result.rb +55 -33
- data/lib/vellum_ai/types/terminal_node_chat_history_result.rb +54 -32
- data/lib/vellum_ai/types/terminal_node_error_result.rb +55 -33
- data/lib/vellum_ai/types/terminal_node_function_call_result.rb +55 -33
- data/lib/vellum_ai/types/terminal_node_json_result.rb +52 -30
- data/lib/vellum_ai/types/terminal_node_number_result.rb +52 -30
- data/lib/vellum_ai/types/terminal_node_result.rb +43 -27
- data/lib/vellum_ai/types/terminal_node_result_data.rb +30 -24
- data/lib/vellum_ai/types/terminal_node_result_output.rb +130 -144
- data/lib/vellum_ai/types/terminal_node_search_results_result.rb +54 -32
- data/lib/vellum_ai/types/terminal_node_string_result.rb +52 -30
- data/lib/vellum_ai/types/test_case_array_variable_value.rb +82 -0
- data/lib/vellum_ai/types/test_case_chat_history_variable_value.rb +57 -29
- data/lib/vellum_ai/types/test_case_error_variable_value.rb +58 -30
- data/lib/vellum_ai/types/test_case_function_call_variable_value.rb +84 -0
- data/lib/vellum_ai/types/test_case_json_variable_value.rb +53 -27
- data/lib/vellum_ai/types/test_case_number_variable_value.rb +55 -27
- data/lib/vellum_ai/types/test_case_search_results_variable_value.rb +57 -29
- data/lib/vellum_ai/types/test_case_string_variable_value.rb +55 -27
- data/lib/vellum_ai/types/test_case_variable_value.rb +131 -119
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config.rb +55 -31
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data.rb +43 -26
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request.rb +43 -26
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request.rb +55 -31
- data/lib/vellum_ai/types/test_suite_run_exec_config.rb +86 -70
- data/lib/vellum_ai/types/test_suite_run_exec_config_request.rb +118 -70
- data/lib/vellum_ai/types/test_suite_run_execution.rb +51 -37
- data/lib/vellum_ai/types/test_suite_run_execution_array_output.rb +83 -0
- data/lib/vellum_ai/types/test_suite_run_execution_chat_history_output.rb +60 -30
- data/lib/vellum_ai/types/test_suite_run_execution_error_output.rb +59 -30
- data/lib/vellum_ai/types/test_suite_run_execution_function_call_output.rb +87 -0
- data/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +55 -28
- data/lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb +71 -0
- data/lib/vellum_ai/types/test_suite_run_execution_metric_result.rb +60 -27
- data/lib/vellum_ai/types/test_suite_run_execution_number_output.rb +57 -28
- data/lib/vellum_ai/types/test_suite_run_execution_output.rb +131 -119
- data/lib/vellum_ai/types/test_suite_run_execution_search_results_output.rb +61 -30
- data/lib/vellum_ai/types/test_suite_run_execution_string_output.rb +57 -28
- data/lib/vellum_ai/types/test_suite_run_external_exec_config.rb +80 -0
- data/lib/vellum_ai/types/test_suite_run_external_exec_config_data.rb +57 -0
- data/lib/vellum_ai/types/test_suite_run_external_exec_config_data_request.rb +59 -0
- data/lib/vellum_ai/types/test_suite_run_external_exec_config_request.rb +81 -0
- data/lib/vellum_ai/types/test_suite_run_metric_array_output.rb +75 -0
- data/lib/vellum_ai/types/test_suite_run_metric_error_output.rb +48 -30
- data/lib/vellum_ai/types/test_suite_run_metric_json_output.rb +69 -0
- data/lib/vellum_ai/types/test_suite_run_metric_number_output.rb +49 -29
- data/lib/vellum_ai/types/test_suite_run_metric_output.rb +86 -70
- data/lib/vellum_ai/types/test_suite_run_metric_string_output.rb +71 -0
- data/lib/vellum_ai/types/test_suite_run_progress.rb +61 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_exec_config_data_request.rb +65 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_exec_config_request.rb +81 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_history_item_exec_config.rb +82 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_history_item_exec_config_data.rb +65 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_history_item_exec_config_data_request.rb +65 -0
- data/lib/vellum_ai/types/test_suite_run_prompt_sandbox_history_item_exec_config_request.rb +82 -0
- data/lib/vellum_ai/types/test_suite_run_read.rb +89 -60
- data/lib/vellum_ai/types/test_suite_run_state.rb +15 -9
- data/lib/vellum_ai/types/test_suite_run_test_suite.rb +41 -28
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config.rb +55 -31
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data.rb +43 -26
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request.rb +43 -26
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request.rb +55 -31
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_exec_config_data_request.rb +53 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_exec_config_request.rb +81 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_history_item_exec_config.rb +82 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_history_item_exec_config_data.rb +67 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_history_item_exec_config_data_request.rb +67 -0
- data/lib/vellum_ai/types/test_suite_run_workflow_sandbox_history_item_exec_config_request.rb +82 -0
- data/lib/vellum_ai/types/test_suite_test_case.rb +63 -40
- data/lib/vellum_ai/types/test_suite_test_case_bulk_operation_request.rb +91 -0
- data/lib/vellum_ai/types/test_suite_test_case_bulk_result.rb +90 -0
- data/lib/vellum_ai/types/test_suite_test_case_create_bulk_operation_request.rb +79 -0
- data/lib/vellum_ai/types/test_suite_test_case_created_bulk_result.rb +75 -0
- data/lib/vellum_ai/types/test_suite_test_case_created_bulk_result_data.rb +53 -0
- data/lib/vellum_ai/types/test_suite_test_case_delete_bulk_operation_data_request.rb +53 -0
- data/lib/vellum_ai/types/test_suite_test_case_delete_bulk_operation_request.rb +79 -0
- data/lib/vellum_ai/types/test_suite_test_case_deleted_bulk_result.rb +77 -0
- data/lib/vellum_ai/types/test_suite_test_case_deleted_bulk_result_data.rb +53 -0
- data/lib/vellum_ai/types/test_suite_test_case_rejected_bulk_result.rb +73 -0
- data/lib/vellum_ai/types/test_suite_test_case_replace_bulk_operation_request.rb +79 -0
- data/lib/vellum_ai/types/test_suite_test_case_replaced_bulk_result.rb +77 -0
- data/lib/vellum_ai/types/test_suite_test_case_replaced_bulk_result_data.rb +54 -0
- data/lib/vellum_ai/types/test_suite_test_case_upsert_bulk_operation_request.rb +79 -0
- data/lib/vellum_ai/types/token_overlapping_window_chunker_config.rb +64 -0
- data/lib/vellum_ai/types/token_overlapping_window_chunker_config_request.rb +66 -0
- data/lib/vellum_ai/types/token_overlapping_window_chunking.rb +70 -0
- data/lib/vellum_ai/types/token_overlapping_window_chunking_request.rb +71 -0
- data/lib/vellum_ai/types/{json_enum.rb → unit_enum.rb} +2 -2
- data/lib/vellum_ai/types/upload_document_response.rb +26 -20
- data/lib/vellum_ai/types/upsert_test_suite_test_case_request.rb +103 -0
- data/lib/vellum_ai/types/variable_prompt_block.rb +85 -0
- data/lib/vellum_ai/types/vellum_audio.rb +63 -0
- data/lib/vellum_ai/types/vellum_audio_request.rb +63 -0
- data/lib/vellum_ai/types/vellum_code_resource_definition.rb +68 -0
- data/lib/vellum_ai/types/vellum_document.rb +63 -0
- data/lib/vellum_ai/types/vellum_document_request.rb +63 -0
- data/lib/vellum_ai/types/vellum_error.rb +36 -25
- data/lib/vellum_ai/types/vellum_error_code_enum.rb +17 -8
- data/lib/vellum_ai/types/vellum_error_request.rb +36 -25
- data/lib/vellum_ai/types/vellum_image.rb +40 -27
- data/lib/vellum_ai/types/vellum_image_request.rb +40 -27
- data/lib/vellum_ai/types/vellum_node_execution_event.rb +122 -0
- data/lib/vellum_ai/types/vellum_sdk_error.rb +62 -0
- data/lib/vellum_ai/types/vellum_sdk_error_code_enum.rb +32 -0
- data/lib/vellum_ai/types/vellum_secret.rb +51 -0
- data/lib/vellum_ai/types/vellum_span.rb +58 -0
- data/lib/vellum_ai/types/vellum_value.rb +202 -0
- data/lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb +84 -0
- data/lib/vellum_ai/types/vellum_value_logical_condition_request.rb +88 -0
- data/lib/vellum_ai/types/vellum_value_logical_expression_request.rb +58 -0
- data/lib/vellum_ai/types/vellum_value_request.rb +202 -0
- data/lib/vellum_ai/types/vellum_variable.rb +77 -29
- data/lib/vellum_ai/types/vellum_variable_extensions.rb +54 -0
- data/lib/vellum_ai/types/vellum_variable_type.rb +29 -13
- data/lib/vellum_ai/types/vellum_workflow_execution_event.rb +138 -0
- data/lib/vellum_ai/types/workflow_deployment_event_executions_response.rb +67 -0
- data/lib/vellum_ai/types/workflow_deployment_history_item.rb +117 -0
- data/lib/vellum_ai/types/workflow_deployment_parent_context.rb +143 -0
- data/lib/vellum_ai/types/workflow_deployment_read.rb +120 -77
- data/lib/vellum_ai/types/workflow_deployment_release.rb +149 -0
- data/lib/vellum_ai/types/workflow_deployment_release_workflow_deployment.rb +53 -0
- data/lib/vellum_ai/types/workflow_deployment_release_workflow_version.rb +77 -0
- data/lib/vellum_ai/types/workflow_error.rb +58 -0
- data/lib/vellum_ai/types/workflow_event_error.rb +36 -25
- data/lib/vellum_ai/types/workflow_event_execution_read.rb +173 -0
- data/lib/vellum_ai/types/workflow_execution_actual.rb +88 -0
- data/lib/vellum_ai/types/workflow_execution_actual_chat_history_request.rb +87 -50
- data/lib/vellum_ai/types/workflow_execution_actual_json_request.rb +83 -48
- data/lib/vellum_ai/types/workflow_execution_actual_string_request.rb +82 -47
- data/lib/vellum_ai/types/workflow_execution_event_error_code.rb +25 -12
- data/lib/vellum_ai/types/workflow_execution_event_type.rb +9 -3
- data/lib/vellum_ai/types/workflow_execution_fulfilled_body.rb +67 -0
- data/lib/vellum_ai/types/workflow_execution_fulfilled_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_initiated_body.rb +67 -0
- data/lib/vellum_ai/types/workflow_execution_initiated_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_node_result_event.rb +62 -39
- data/lib/vellum_ai/types/workflow_execution_paused_body.rb +71 -0
- data/lib/vellum_ai/types/workflow_execution_paused_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_rejected_body.rb +73 -0
- data/lib/vellum_ai/types/workflow_execution_rejected_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_resumed_body.rb +57 -0
- data/lib/vellum_ai/types/workflow_execution_resumed_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_snapshotted_body.rb +67 -0
- data/lib/vellum_ai/types/workflow_execution_snapshotted_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_span.rb +118 -0
- data/lib/vellum_ai/types/workflow_execution_span_attributes.rb +51 -0
- data/lib/vellum_ai/types/workflow_execution_streaming_body.rb +73 -0
- data/lib/vellum_ai/types/workflow_execution_streaming_event.rb +134 -0
- data/lib/vellum_ai/types/workflow_execution_usage_calculation_error.rb +63 -0
- data/lib/vellum_ai/types/workflow_execution_usage_calculation_error_code_enum.rb +16 -0
- data/lib/vellum_ai/types/workflow_execution_usage_result.rb +84 -0
- data/lib/vellum_ai/types/workflow_execution_view_online_eval_metric_result.rb +74 -0
- data/lib/vellum_ai/types/workflow_execution_workflow_result_event.rb +62 -39
- data/lib/vellum_ai/types/workflow_expand_meta_request.rb +74 -0
- data/lib/vellum_ai/types/workflow_initialization_error.rb +62 -0
- data/lib/vellum_ai/types/workflow_node_result_data.rb +177 -143
- data/lib/vellum_ai/types/workflow_node_result_event.rb +68 -94
- data/lib/vellum_ai/types/workflow_node_result_event_state.rb +13 -8
- data/lib/vellum_ai/types/workflow_output.rb +144 -155
- data/lib/vellum_ai/types/workflow_output_array.rb +55 -33
- data/lib/vellum_ai/types/workflow_output_chat_history.rb +54 -32
- data/lib/vellum_ai/types/workflow_output_error.rb +55 -33
- data/lib/vellum_ai/types/workflow_output_function_call.rb +55 -33
- data/lib/vellum_ai/types/workflow_output_image.rb +55 -33
- data/lib/vellum_ai/types/workflow_output_json.rb +50 -30
- data/lib/vellum_ai/types/workflow_output_number.rb +52 -30
- data/lib/vellum_ai/types/workflow_output_search_results.rb +54 -32
- data/lib/vellum_ai/types/workflow_output_string.rb +52 -30
- data/lib/vellum_ai/types/workflow_parent_context.rb +100 -0
- data/lib/vellum_ai/types/workflow_push_deployment_config_request.rb +77 -0
- data/lib/vellum_ai/types/workflow_push_response.rb +70 -0
- data/lib/vellum_ai/types/workflow_release_tag_read.rb +92 -0
- data/lib/vellum_ai/types/workflow_release_tag_workflow_deployment_history_item.rb +68 -0
- data/lib/vellum_ai/types/workflow_request_chat_history_input_request.rb +47 -28
- data/lib/vellum_ai/types/workflow_request_input_request.rb +68 -94
- data/lib/vellum_ai/types/workflow_request_json_input_request.rb +45 -27
- data/lib/vellum_ai/types/workflow_request_number_input_request.rb +44 -26
- data/lib/vellum_ai/types/workflow_request_string_input_request.rb +44 -26
- data/lib/vellum_ai/types/workflow_result_event.rb +86 -68
- data/lib/vellum_ai/types/workflow_result_event_output_data.rb +129 -143
- data/lib/vellum_ai/types/workflow_result_event_output_data_array.rb +76 -53
- data/lib/vellum_ai/types/workflow_result_event_output_data_chat_history.rb +77 -52
- data/lib/vellum_ai/types/workflow_result_event_output_data_error.rb +76 -53
- data/lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb +78 -53
- data/lib/vellum_ai/types/workflow_result_event_output_data_json.rb +72 -49
- data/lib/vellum_ai/types/workflow_result_event_output_data_number.rb +72 -49
- data/lib/vellum_ai/types/workflow_result_event_output_data_search_results.rb +77 -52
- data/lib/vellum_ai/types/workflow_result_event_output_data_string.rb +71 -48
- data/lib/vellum_ai/types/workflow_sandbox_example.rb +77 -0
- data/lib/vellum_ai/types/workflow_sandbox_parent_context.rb +108 -0
- data/lib/vellum_ai/types/workflow_stream_event.rb +38 -70
- data/lib/vellum_ai/types/workspace_read.rb +80 -0
- data/lib/vellum_ai/types/workspace_secret_read.rb +88 -0
- data/lib/vellum_ai/workflow_deployments/client.rb +534 -66
- data/lib/vellum_ai/workflow_deployments/types/list_workflow_release_tags_request_source.rb +12 -0
- data/lib/vellum_ai/workflow_deployments/types/workflow_deployments_list_request_status.rb +7 -3
- data/lib/vellum_ai/workflow_sandboxes/client.rb +183 -0
- data/lib/vellum_ai/workflow_sandboxes/types/list_workflow_sandbox_examples_request_tag.rb +12 -0
- data/lib/vellum_ai/workflows/client.rb +169 -0
- data/lib/vellum_ai/workspace_secrets/client.rb +159 -0
- data/lib/vellum_ai/workspaces/client.rb +92 -0
- data/lib/vellum_ai.rb +786 -392
- metadata +434 -96
- data/lib/vellum_ai/model_versions/client.rb +0 -61
- data/lib/vellum_ai/registered_prompts/client.rb +0 -154
- data/lib/vellum_ai/types/array_enum.rb +0 -5
- data/lib/vellum_ai/types/array_variable_value_item.rb +0 -168
- data/lib/vellum_ai/types/block_type_enum.rb +0 -11
- data/lib/vellum_ai/types/chat_history_variable_value.rb +0 -49
- data/lib/vellum_ai/types/error_enum.rb +0 -5
- data/lib/vellum_ai/types/error_variable_value.rb +0 -51
- data/lib/vellum_ai/types/execute_prompt_api_error_response.rb +0 -45
- data/lib/vellum_ai/types/execute_workflow_error_response.rb +0 -45
- data/lib/vellum_ai/types/execute_workflow_stream_error_response.rb +0 -45
- data/lib/vellum_ai/types/fulfilled_enum.rb +0 -5
- data/lib/vellum_ai/types/fulfilled_function_call.rb +0 -56
- data/lib/vellum_ai/types/function_call_enum.rb +0 -5
- data/lib/vellum_ai/types/function_call_variable_value.rb +0 -51
- data/lib/vellum_ai/types/generate_error_response.rb +0 -45
- data/lib/vellum_ai/types/image_variable_value.rb +0 -52
- data/lib/vellum_ai/types/initiated_enum.rb +0 -5
- data/lib/vellum_ai/types/json_variable_value.rb +0 -45
- data/lib/vellum_ai/types/model_version_build_config.rb +0 -66
- data/lib/vellum_ai/types/model_version_exec_config.rb +0 -90
- data/lib/vellum_ai/types/model_version_exec_config_parameters.rb +0 -98
- data/lib/vellum_ai/types/model_version_read.rb +0 -133
- data/lib/vellum_ai/types/model_version_read_status_enum.rb +0 -11
- data/lib/vellum_ai/types/model_version_sandbox_snapshot.rb +0 -61
- data/lib/vellum_ai/types/node_input_compiled_function_call.rb +0 -61
- data/lib/vellum_ai/types/node_output_compiled_function_value.rb +0 -56
- data/lib/vellum_ai/types/number_enum.rb +0 -5
- data/lib/vellum_ai/types/number_variable_value.rb +0 -45
- data/lib/vellum_ai/types/processing_state_enum.rb +0 -11
- data/lib/vellum_ai/types/prompt_deployment_expand_meta_request_request.rb +0 -74
- data/lib/vellum_ai/types/prompt_template_block.rb +0 -62
- data/lib/vellum_ai/types/prompt_template_block_data.rb +0 -54
- data/lib/vellum_ai/types/prompt_template_block_data_request.rb +0 -54
- data/lib/vellum_ai/types/prompt_template_block_properties.rb +0 -110
- data/lib/vellum_ai/types/prompt_template_block_properties_request.rb +0 -110
- data/lib/vellum_ai/types/prompt_template_block_request.rb +0 -62
- data/lib/vellum_ai/types/provider_enum.rb +0 -20
- data/lib/vellum_ai/types/register_prompt_error_response.rb +0 -45
- data/lib/vellum_ai/types/register_prompt_model_parameters_request.rb +0 -98
- data/lib/vellum_ai/types/register_prompt_prompt.rb +0 -50
- data/lib/vellum_ai/types/register_prompt_prompt_info_request.rb +0 -60
- data/lib/vellum_ai/types/register_prompt_response.rb +0 -110
- data/lib/vellum_ai/types/registered_prompt_deployment.rb +0 -55
- data/lib/vellum_ai/types/registered_prompt_input_variable_request.rb +0 -56
- data/lib/vellum_ai/types/registered_prompt_model_version.rb +0 -50
- data/lib/vellum_ai/types/registered_prompt_sandbox.rb +0 -50
- data/lib/vellum_ai/types/registered_prompt_sandbox_snapshot.rb +0 -45
- data/lib/vellum_ai/types/rejected_enum.rb +0 -5
- data/lib/vellum_ai/types/rejected_function_call.rb +0 -62
- data/lib/vellum_ai/types/scenario_input_request.rb +0 -70
- data/lib/vellum_ai/types/scenario_input_type_enum.rb +0 -6
- data/lib/vellum_ai/types/search_error_response.rb +0 -45
- data/lib/vellum_ai/types/search_results_enum.rb +0 -5
- data/lib/vellum_ai/types/search_results_variable_value.rb +0 -49
- data/lib/vellum_ai/types/streaming_enum.rb +0 -5
- data/lib/vellum_ai/types/string_enum.rb +0 -5
- data/lib/vellum_ai/types/string_variable_value.rb +0 -45
- data/lib/vellum_ai/types/submit_completion_actuals_error_response.rb +0 -45
- data/lib/vellum_ai/types/subworkflow_enum.rb +0 -5
- data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum.rb +0 -5
- data/lib/vellum_ai/types/test_suite_run_metric_error_output_type_enum.rb +0 -5
- data/lib/vellum_ai/types/test_suite_run_metric_number_output_type_enum.rb +0 -5
- data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum.rb +0 -5
- data/lib/vellum_ai/types/upload_document_error_response.rb +0 -45
data/lib/vellum_ai.rb
CHANGED
@@ -1,23 +1,41 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
require_relative "environment"
|
4
3
|
require_relative "types_export"
|
5
4
|
require_relative "requests"
|
5
|
+
require_relative "vellum_ai/ad_hoc/client"
|
6
|
+
require_relative "vellum_ai/container_images/client"
|
6
7
|
require_relative "vellum_ai/deployments/client"
|
7
8
|
require_relative "vellum_ai/document_indexes/client"
|
8
9
|
require_relative "vellum_ai/documents/client"
|
9
10
|
require_relative "vellum_ai/folder_entities/client"
|
10
|
-
require_relative "vellum_ai/
|
11
|
-
require_relative "vellum_ai/
|
11
|
+
require_relative "vellum_ai/metric_definitions/client"
|
12
|
+
require_relative "vellum_ai/ml_models/client"
|
13
|
+
require_relative "vellum_ai/organizations/client"
|
14
|
+
require_relative "vellum_ai/prompts/client"
|
12
15
|
require_relative "vellum_ai/sandboxes/client"
|
13
16
|
require_relative "vellum_ai/test_suite_runs/client"
|
14
17
|
require_relative "vellum_ai/test_suites/client"
|
15
18
|
require_relative "vellum_ai/workflow_deployments/client"
|
19
|
+
require_relative "vellum_ai/release_reviews/client"
|
20
|
+
require_relative "vellum_ai/workflow_sandboxes/client"
|
21
|
+
require_relative "vellum_ai/workflows/client"
|
22
|
+
require_relative "vellum_ai/workspace_secrets/client"
|
23
|
+
require_relative "vellum_ai/workspaces/client"
|
24
|
+
require_relative "vellum_ai/types/method_enum"
|
25
|
+
require_relative "vellum_ai/types/execute_api_request_body"
|
26
|
+
require_relative "vellum_ai/types/execute_api_request_bearer_token"
|
27
|
+
require_relative "vellum_ai/types/execute_api_response"
|
28
|
+
require_relative "vellum_ai/types/code_execution_runtime"
|
29
|
+
require_relative "vellum_ai/types/code_executor_input"
|
30
|
+
require_relative "vellum_ai/types/code_execution_package"
|
31
|
+
require_relative "vellum_ai/types/vellum_variable_type"
|
32
|
+
require_relative "vellum_ai/types/code_executor_response"
|
16
33
|
require_relative "vellum_ai/types/prompt_deployment_input_request"
|
17
|
-
require_relative "vellum_ai/types/
|
34
|
+
require_relative "vellum_ai/types/prompt_deployment_expand_meta_request"
|
18
35
|
require_relative "vellum_ai/types/raw_prompt_execution_overrides_request"
|
19
36
|
require_relative "vellum_ai/types/execute_prompt_response"
|
20
37
|
require_relative "vellum_ai/types/workflow_request_input_request"
|
38
|
+
require_relative "vellum_ai/types/workflow_expand_meta_request"
|
21
39
|
require_relative "vellum_ai/types/execute_workflow_response"
|
22
40
|
require_relative "vellum_ai/types/generate_request"
|
23
41
|
require_relative "vellum_ai/types/generate_options_request"
|
@@ -26,451 +44,827 @@ require_relative "vellum_ai/types/search_request_options_request"
|
|
26
44
|
require_relative "vellum_ai/types/search_response"
|
27
45
|
require_relative "vellum_ai/types/submit_completion_actual_request"
|
28
46
|
require_relative "vellum_ai/types/submit_workflow_execution_actual_request"
|
47
|
+
require_relative "requests"
|
29
48
|
|
30
49
|
module Vellum
|
31
50
|
class Client
|
32
|
-
|
33
|
-
|
51
|
+
# @return [Vellum::AdHocClient]
|
52
|
+
attr_reader :ad_hoc
|
53
|
+
# @return [Vellum::ContainerImagesClient]
|
54
|
+
attr_reader :container_images
|
55
|
+
# @return [Vellum::DeploymentsClient]
|
56
|
+
attr_reader :deployments
|
57
|
+
# @return [Vellum::DocumentIndexesClient]
|
58
|
+
attr_reader :document_indexes
|
59
|
+
# @return [Vellum::DocumentsClient]
|
60
|
+
attr_reader :documents
|
61
|
+
# @return [Vellum::FolderEntitiesClient]
|
62
|
+
attr_reader :folder_entities
|
63
|
+
# @return [Vellum::MetricDefinitionsClient]
|
64
|
+
attr_reader :metric_definitions
|
65
|
+
# @return [Vellum::MlModelsClient]
|
66
|
+
attr_reader :ml_models
|
67
|
+
# @return [Vellum::OrganizationsClient]
|
68
|
+
attr_reader :organizations
|
69
|
+
# @return [Vellum::PromptsClient]
|
70
|
+
attr_reader :prompts
|
71
|
+
# @return [Vellum::SandboxesClient]
|
72
|
+
attr_reader :sandboxes
|
73
|
+
# @return [Vellum::TestSuiteRunsClient]
|
74
|
+
attr_reader :test_suite_runs
|
75
|
+
# @return [Vellum::TestSuitesClient]
|
76
|
+
attr_reader :test_suites
|
77
|
+
# @return [Vellum::WorkflowDeploymentsClient]
|
78
|
+
attr_reader :workflow_deployments
|
79
|
+
# @return [Vellum::ReleaseReviewsClient]
|
80
|
+
attr_reader :release_reviews
|
81
|
+
# @return [Vellum::WorkflowSandboxesClient]
|
82
|
+
attr_reader :workflow_sandboxes
|
83
|
+
# @return [Vellum::WorkflowsClient]
|
84
|
+
attr_reader :workflows
|
85
|
+
# @return [Vellum::WorkspaceSecretsClient]
|
86
|
+
attr_reader :workspace_secrets
|
87
|
+
# @return [Vellum::WorkspacesClient]
|
88
|
+
attr_reader :workspaces
|
89
|
+
|
34
90
|
|
35
|
-
# @param
|
91
|
+
# @param base_url [String]
|
92
|
+
# @param environment [Vellum::Environment]
|
36
93
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
37
|
-
# @param timeout_in_seconds [Long]
|
38
|
-
# @param api_key [String]
|
39
|
-
# @return [Client]
|
40
|
-
def initialize(
|
41
|
-
@request_client = RequestClient.new(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
@
|
49
|
-
@
|
50
|
-
@
|
51
|
-
@
|
52
|
-
@
|
94
|
+
# @param timeout_in_seconds [Long]
|
95
|
+
# @param api_key [String]
|
96
|
+
# @return [Vellum::Client]
|
97
|
+
def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, api_key:)
|
98
|
+
@request_client = Vellum::RequestClient.new(
|
99
|
+
base_url: base_url,
|
100
|
+
environment: environment,
|
101
|
+
max_retries: max_retries,
|
102
|
+
timeout_in_seconds: timeout_in_seconds,
|
103
|
+
api_key: api_key
|
104
|
+
)
|
105
|
+
@ad_hoc = Vellum::AdHocClient.new(request_client: @request_client)
|
106
|
+
@container_images = Vellum::ContainerImagesClient.new(request_client: @request_client)
|
107
|
+
@deployments = Vellum::DeploymentsClient.new(request_client: @request_client)
|
108
|
+
@document_indexes = Vellum::DocumentIndexesClient.new(request_client: @request_client)
|
109
|
+
@documents = Vellum::DocumentsClient.new(request_client: @request_client)
|
110
|
+
@folder_entities = Vellum::FolderEntitiesClient.new(request_client: @request_client)
|
111
|
+
@metric_definitions = Vellum::MetricDefinitionsClient.new(request_client: @request_client)
|
112
|
+
@ml_models = Vellum::MlModelsClient.new(request_client: @request_client)
|
113
|
+
@organizations = Vellum::OrganizationsClient.new(request_client: @request_client)
|
114
|
+
@prompts = Vellum::PromptsClient.new(request_client: @request_client)
|
115
|
+
@sandboxes = Vellum::SandboxesClient.new(request_client: @request_client)
|
116
|
+
@test_suite_runs = Vellum::TestSuiteRunsClient.new(request_client: @request_client)
|
117
|
+
@test_suites = Vellum::TestSuitesClient.new(request_client: @request_client)
|
118
|
+
@workflow_deployments = Vellum::WorkflowDeploymentsClient.new(request_client: @request_client)
|
119
|
+
@release_reviews = Vellum::ReleaseReviewsClient.new(request_client: @request_client)
|
120
|
+
@workflow_sandboxes = Vellum::WorkflowSandboxesClient.new(request_client: @request_client)
|
121
|
+
@workflows = Vellum::WorkflowsClient.new(request_client: @request_client)
|
122
|
+
@workspace_secrets = Vellum::WorkspaceSecretsClient.new(request_client: @request_client)
|
123
|
+
@workspaces = Vellum::WorkspacesClient.new(request_client: @request_client)
|
53
124
|
end
|
54
|
-
|
55
|
-
#
|
56
|
-
#
|
57
|
-
# @param
|
58
|
-
# @param
|
59
|
-
# @param
|
60
|
-
# @
|
61
|
-
# @
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
inputs: inputs,
|
85
|
-
prompt_deployment_id: prompt_deployment_id,
|
86
|
-
prompt_deployment_name: prompt_deployment_name,
|
87
|
-
release_tag: release_tag,
|
88
|
-
external_id: external_id,
|
89
|
-
expand_meta: expand_meta,
|
90
|
-
raw_overrides: raw_overrides,
|
91
|
-
expand_raw: expand_raw,
|
92
|
-
metadata: metadata
|
93
|
-
}.compact
|
94
|
-
req.url "#{@request_client.default_environment[:Predict]}/v1/execute-prompt"
|
95
|
-
end
|
96
|
-
ExecutePromptResponse.from_json(json_object: response.body)
|
125
|
+
# @param url [String]
|
126
|
+
# @param method [Vellum::MethodEnum]
|
127
|
+
# @param body [String, Array<Object>, Hash{String => Object}]
|
128
|
+
# @param headers [Hash{String => Vellum::ExecuteApiRequestHeadersValue}]
|
129
|
+
# @param bearer_token [String, Vellum::VellumSecret]
|
130
|
+
# @param request_options [Vellum::RequestOptions]
|
131
|
+
# @return [Vellum::ExecuteApiResponse]
|
132
|
+
# @example
|
133
|
+
# api = Vellum::Client.new(
|
134
|
+
# base_url: "https://api.example.com",
|
135
|
+
# environment: Vellum::Environment::PRODUCTION,
|
136
|
+
# api_key: "YOUR_API_KEY"
|
137
|
+
# )
|
138
|
+
# api.execute_api(url: "url")
|
139
|
+
def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil)
|
140
|
+
response = @request_client.conn.post do | req |
|
141
|
+
unless request_options&.timeout_in_seconds.nil?
|
142
|
+
req.options.timeout = request_options.timeout_in_seconds
|
143
|
+
end
|
144
|
+
unless request_options&.api_key.nil?
|
145
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
146
|
+
end
|
147
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
148
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
149
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
150
|
+
end
|
151
|
+
req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method, body: body, headers: headers, bearer_token: bearer_token }.compact
|
152
|
+
req.url "#{@request_client.get_url(environment: Default, request_options: request_options)}/v1/execute-api"
|
153
|
+
end
|
154
|
+
Vellum::ExecuteApiResponse.from_json(json_object: response.body)
|
97
155
|
end
|
98
|
-
|
99
|
-
#
|
156
|
+
# @param code [String]
|
157
|
+
# @param runtime [Vellum::CodeExecutionRuntime]
|
158
|
+
# @param input_values [Array<Hash>] Request of type Array<Vellum::CodeExecutorInput>, as a Hash
|
159
|
+
# @param packages [Array<Hash>] Request of type Array<Vellum::CodeExecutionPackage>, as a Hash
|
160
|
+
# * :version (String)
|
161
|
+
# * :name (String)
|
162
|
+
# @param output_type [Vellum::VellumVariableType]
|
163
|
+
# @param request_options [Vellum::RequestOptions]
|
164
|
+
# @return [Vellum::CodeExecutorResponse]
|
165
|
+
# @example
|
166
|
+
# api = Vellum::Client.new(
|
167
|
+
# base_url: "https://api.example.com",
|
168
|
+
# environment: Vellum::Environment::PRODUCTION,
|
169
|
+
# api_key: "YOUR_API_KEY"
|
170
|
+
# )
|
171
|
+
# api.execute_code(
|
172
|
+
# code: "code",
|
173
|
+
# runtime: PYTHON_3_11_6,
|
174
|
+
# input_values: [{ name: "name", type: "STRING", value: "value" }],
|
175
|
+
# packages: [{ version: "version", name: "name" }],
|
176
|
+
# output_type: STRING
|
177
|
+
# )
|
178
|
+
def execute_code(code:, runtime:, input_values:, packages:, output_type:, request_options: nil)
|
179
|
+
response = @request_client.conn.post do | req |
|
180
|
+
unless request_options&.timeout_in_seconds.nil?
|
181
|
+
req.options.timeout = request_options.timeout_in_seconds
|
182
|
+
end
|
183
|
+
unless request_options&.api_key.nil?
|
184
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
185
|
+
end
|
186
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
187
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
188
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
189
|
+
end
|
190
|
+
req.body = { **(request_options&.additional_body_parameters || {}), code: code, runtime: runtime, input_values: input_values, packages: packages, output_type: output_type }.compact
|
191
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-code"
|
192
|
+
end
|
193
|
+
Vellum::CodeExecutorResponse.from_json(json_object: response.body)
|
194
|
+
end
|
195
|
+
# Executes a deployed Prompt and returns the result.
|
100
196
|
#
|
101
|
-
# @param inputs [Array<Hash>]
|
102
|
-
# @param
|
103
|
-
|
104
|
-
# @param
|
105
|
-
|
106
|
-
# @param
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
197
|
+
# @param inputs [Array<Hash>] A list consisting of the Prompt Deployment's input variables and their values.Request of type Array<Vellum::PromptDeploymentInputRequest>, as a Hash
|
198
|
+
# @param prompt_deployment_id [String] The ID of the Prompt Deployment. Must provide either this or
|
199
|
+
# prompt_deployment_name.
|
200
|
+
# @param prompt_deployment_name [String] The unique name of the Prompt Deployment. Must provide either this or
|
201
|
+
# prompt_deployment_id.
|
202
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
203
|
+
# Prompt Deployment
|
204
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
205
|
+
# within a given Workspace.
|
206
|
+
# @param expand_meta [Hash] An optionally specified configuration used to opt in to including additional
|
207
|
+
# metadata about this prompt execution in the API response. Corresponding values
|
208
|
+
# will be returned under the `meta` key of the API response.Request of type Vellum::PromptDeploymentExpandMetaRequest, as a Hash
|
209
|
+
# * :model_name (Boolean)
|
210
|
+
# * :usage (Boolean)
|
211
|
+
# * :cost (Boolean)
|
212
|
+
# * :finish_reason (Boolean)
|
213
|
+
# * :latency (Boolean)
|
214
|
+
# * :deployment_release_tag (Boolean)
|
215
|
+
# * :prompt_version_id (Boolean)
|
216
|
+
# @param raw_overrides [Hash] Overrides for the raw API request sent to the model host. Combined with
|
217
|
+
# `expand_raw`, it can be used to access new features from models.Request of type Vellum::RawPromptExecutionOverridesRequest, as a Hash
|
218
|
+
# * :body (Hash{String => Object})
|
219
|
+
# * :headers (Hash{String => String})
|
220
|
+
# * :url (String)
|
221
|
+
# @param expand_raw [Array<String>] A list of keys whose values you'd like to directly return from the JSON response
|
222
|
+
# of the model provider. Useful if you need lower-level info returned by model
|
223
|
+
# providers that Vellum would otherwise omit. Corresponding key/value pairs will
|
224
|
+
# be returned under the `raw` key of the API response.
|
225
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
226
|
+
# additional monitoring data such as user id, session id, etc. for future
|
227
|
+
# analysis.
|
228
|
+
# @param request_options [Vellum::RequestOptions]
|
229
|
+
# @return [Vellum::FulfilledExecutePromptResponse, Vellum::RejectedExecutePromptResponse]
|
230
|
+
# @example
|
231
|
+
# api = Vellum::Client.new(
|
232
|
+
# base_url: "https://api.example.com",
|
233
|
+
# environment: Vellum::Environment::PRODUCTION,
|
234
|
+
# api_key: "YOUR_API_KEY"
|
235
|
+
# )
|
236
|
+
# api.execute_prompt(inputs: [{ name: "name", type: "STRING", value: "value" }])
|
237
|
+
def execute_prompt(inputs:, prompt_deployment_id: nil, prompt_deployment_name: nil, release_tag: nil, external_id: nil, expand_meta: nil, raw_overrides: nil, expand_raw: nil, metadata: nil, request_options: nil)
|
238
|
+
response = @request_client.conn.post do | req |
|
239
|
+
unless request_options&.timeout_in_seconds.nil?
|
240
|
+
req.options.timeout = request_options.timeout_in_seconds
|
241
|
+
end
|
242
|
+
unless request_options&.api_key.nil?
|
243
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
244
|
+
end
|
245
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
246
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
247
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
248
|
+
end
|
249
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, prompt_deployment_id: prompt_deployment_id, prompt_deployment_name: prompt_deployment_name, release_tag: release_tag, external_id: external_id, expand_meta: expand_meta, raw_overrides: raw_overrides, expand_raw: expand_raw, metadata: metadata }.compact
|
250
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-prompt"
|
251
|
+
end
|
252
|
+
Vellum::ExecutePromptResponse.from_json(json_object: response.body)
|
125
253
|
end
|
126
|
-
|
127
|
-
# Generate a completion using a previously defined deployment.
|
254
|
+
# Executes a deployed Workflow and returns its outputs.
|
128
255
|
#
|
129
|
-
#
|
256
|
+
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding
|
257
|
+
# values.Request of type Array<Vellum::WorkflowRequestInputRequest>, as a Hash
|
258
|
+
# @param expand_meta [Hash] An optionally specified configuration used to opt in to including additional
|
259
|
+
# metadata about this workflow execution in the API response. Corresponding values
|
260
|
+
# will be returned under the `execution_meta` key within NODE events in the
|
261
|
+
# response stream.Request of type Vellum::WorkflowExpandMetaRequest, as a Hash
|
262
|
+
# * :usage (Boolean)
|
263
|
+
# * :cost (Boolean)
|
264
|
+
# * :model_name (Boolean)
|
265
|
+
# @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or
|
266
|
+
# workflow_deployment_name.
|
267
|
+
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or
|
268
|
+
# workflow_deployment_id.
|
269
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
270
|
+
# Workflow Deployment
|
271
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
272
|
+
# within a given Workspace.
|
273
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
274
|
+
# additional monitoring data such as user id, session id, etc. for future
|
275
|
+
# analysis.
|
276
|
+
# @param request_options [Vellum::RequestOptions]
|
277
|
+
# @return [Vellum::ExecuteWorkflowResponse]
|
278
|
+
# @example
|
279
|
+
# api = Vellum::Client.new(
|
280
|
+
# base_url: "https://api.example.com",
|
281
|
+
# environment: Vellum::Environment::PRODUCTION,
|
282
|
+
# api_key: "YOUR_API_KEY"
|
283
|
+
# )
|
284
|
+
# api.execute_workflow(inputs: [{ name: "name", type: "STRING", value: "value" }])
|
285
|
+
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, request_options: nil)
|
286
|
+
response = @request_client.conn.post do | req |
|
287
|
+
unless request_options&.timeout_in_seconds.nil?
|
288
|
+
req.options.timeout = request_options.timeout_in_seconds
|
289
|
+
end
|
290
|
+
unless request_options&.api_key.nil?
|
291
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
292
|
+
end
|
293
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
294
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
295
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
296
|
+
end
|
297
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata }.compact
|
298
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow"
|
299
|
+
end
|
300
|
+
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
301
|
+
end
|
302
|
+
# Generate a completion using a previously defined deployment.
|
303
|
+
# Important: This endpoint is DEPRECATED and has been superseded by
|
304
|
+
# [execute-prompt](/api-reference/api-reference/execute-prompt).
|
130
305
|
#
|
131
306
|
# @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
|
132
307
|
# @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
|
133
|
-
# @param requests [Array<Hash>] The generation request to make. Bulk requests are no longer supported, this
|
134
|
-
|
135
|
-
# * :
|
136
|
-
# * :
|
137
|
-
#
|
138
|
-
#
|
139
|
-
|
140
|
-
#
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
308
|
+
# @param requests [Array<Hash>] The generation request to make. Bulk requests are no longer supported, this
|
309
|
+
# field must be an array of length 1.Request of type Array<Vellum::GenerateRequest>, as a Hash
|
310
|
+
# * :input_values (Hash{String => Object})
|
311
|
+
# * :chat_history (Array<Vellum::ChatMessageRequest>)
|
312
|
+
# * :external_ids (Array<String>)
|
313
|
+
# @param options [Hash] Additional configuration that can be used to control what's included in the
|
314
|
+
# response.Request of type Vellum::GenerateOptionsRequest, as a Hash
|
315
|
+
# * :logprobs (Vellum::LogprobsEnum)
|
316
|
+
# @param request_options [Vellum::RequestOptions]
|
317
|
+
# @return [Vellum::GenerateResponse]
|
318
|
+
# @example
|
319
|
+
# api = Vellum::Client.new(
|
320
|
+
# base_url: "https://api.example.com",
|
321
|
+
# environment: Vellum::Environment::PRODUCTION,
|
322
|
+
# api_key: "YOUR_API_KEY"
|
323
|
+
# )
|
324
|
+
# api.generate(requests: [{ input_values: { "key": "value" } }])
|
325
|
+
def generate(deployment_id: nil, deployment_name: nil, requests:, options: nil, request_options: nil)
|
326
|
+
response = @request_client.conn.post do | req |
|
327
|
+
unless request_options&.timeout_in_seconds.nil?
|
328
|
+
req.options.timeout = request_options.timeout_in_seconds
|
329
|
+
end
|
330
|
+
unless request_options&.api_key.nil?
|
331
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
332
|
+
end
|
333
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
334
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
335
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
336
|
+
end
|
337
|
+
req.body = { **(request_options&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, requests: requests, options: options }.compact
|
338
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/generate"
|
339
|
+
end
|
340
|
+
Vellum::GenerateResponse.from_json(json_object: response.body)
|
156
341
|
end
|
157
|
-
|
158
|
-
# Perform a search against a document index.
|
342
|
+
# Perform a search against a document index.
|
159
343
|
#
|
160
|
-
#
|
161
|
-
|
162
|
-
# @param
|
163
|
-
|
344
|
+
# @param index_id [String] The ID of the index to search against. Must provide either this, index_name or
|
345
|
+
# document_index.
|
346
|
+
# @param index_name [String] The name of the index to search against. Must provide either this, index_id or
|
347
|
+
# document_index.
|
164
348
|
# @param query [String] The query to search for.
|
165
|
-
# @param options [Hash] Configuration options for the search.Request of type SearchRequestOptionsRequest, as a Hash
|
166
|
-
# * :limit (Integer)
|
349
|
+
# @param options [Hash] Configuration options for the search.Request of type Vellum::SearchRequestOptionsRequest, as a Hash
|
350
|
+
# * :limit (Integer)
|
167
351
|
# * :weights (Hash)
|
168
|
-
# * :semantic_similarity (Float)
|
169
|
-
# * :keywords (Float)
|
352
|
+
# * :semantic_similarity (Float)
|
353
|
+
# * :keywords (Float)
|
170
354
|
# * :result_merging (Hash)
|
171
|
-
# * :enabled (Boolean)
|
355
|
+
# * :enabled (Boolean)
|
172
356
|
# * :filters (Hash)
|
173
|
-
# * :external_ids (Array<String>)
|
357
|
+
# * :external_ids (Array<String>)
|
174
358
|
# * :metadata (Hash)
|
175
|
-
#
|
176
|
-
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
359
|
+
# @param document_index [String] Either the index name or index ID to search against. Must provide either this,
|
360
|
+
# index_id or index_name.
|
361
|
+
# @param request_options [Vellum::RequestOptions]
|
362
|
+
# @return [Vellum::SearchResponse]
|
363
|
+
# @example
|
364
|
+
# api = Vellum::Client.new(
|
365
|
+
# base_url: "https://api.example.com",
|
366
|
+
# environment: Vellum::Environment::PRODUCTION,
|
367
|
+
# api_key: "YOUR_API_KEY"
|
368
|
+
# )
|
369
|
+
# api.search(query: "query")
|
370
|
+
def search(index_id: nil, index_name: nil, query:, options: nil, document_index: nil, request_options: nil)
|
371
|
+
response = @request_client.conn.post do | req |
|
372
|
+
unless request_options&.timeout_in_seconds.nil?
|
373
|
+
req.options.timeout = request_options.timeout_in_seconds
|
374
|
+
end
|
375
|
+
unless request_options&.api_key.nil?
|
376
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
377
|
+
end
|
378
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
379
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
380
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
381
|
+
end
|
382
|
+
req.body = { **(request_options&.additional_body_parameters || {}), index_id: index_id, index_name: index_name, query: query, options: options, document_index: document_index }.compact
|
383
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/search"
|
384
|
+
end
|
385
|
+
Vellum::SearchResponse.from_json(json_object: response.body)
|
198
386
|
end
|
199
|
-
|
200
|
-
|
201
|
-
#
|
202
|
-
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
387
|
+
# Used to submit feedback regarding the quality of previously generated
|
388
|
+
# completions.
|
203
389
|
#
|
204
390
|
# @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
|
205
391
|
# @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
|
206
|
-
# @param actuals [Array<Hash>] Feedback regarding the quality of previously generated completionsRequest of type Array<SubmitCompletionActualRequest>, as a Hash
|
207
|
-
# * :id (String)
|
208
|
-
# * :external_id (String)
|
209
|
-
# * :text (String)
|
210
|
-
# * :quality (Float)
|
211
|
-
# * :timestamp (DateTime)
|
212
|
-
#
|
392
|
+
# @param actuals [Array<Hash>] Feedback regarding the quality of previously generated completionsRequest of type Array<Vellum::SubmitCompletionActualRequest>, as a Hash
|
393
|
+
# * :id (String)
|
394
|
+
# * :external_id (String)
|
395
|
+
# * :text (String)
|
396
|
+
# * :quality (Float)
|
397
|
+
# * :timestamp (DateTime)
|
398
|
+
# * :metadata (Hash{String => Object})
|
399
|
+
# @param request_options [Vellum::RequestOptions]
|
213
400
|
# @return [Void]
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
401
|
+
# @example
|
402
|
+
# api = Vellum::Client.new(
|
403
|
+
# base_url: "https://api.example.com",
|
404
|
+
# environment: Vellum::Environment::PRODUCTION,
|
405
|
+
# api_key: "YOUR_API_KEY"
|
406
|
+
# )
|
407
|
+
# api.submit_completion_actuals(actuals: [{ }])
|
408
|
+
def submit_completion_actuals(deployment_id: nil, deployment_name: nil, actuals:, request_options: nil)
|
409
|
+
response = @request_client.conn.post do | req |
|
410
|
+
unless request_options&.timeout_in_seconds.nil?
|
411
|
+
req.options.timeout = request_options.timeout_in_seconds
|
412
|
+
end
|
413
|
+
unless request_options&.api_key.nil?
|
414
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
415
|
+
end
|
416
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
417
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
418
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
419
|
+
end
|
420
|
+
req.body = { **(request_options&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, actuals: actuals }.compact
|
421
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/submit-completion-actuals"
|
422
|
+
end
|
227
423
|
end
|
228
|
-
|
229
|
-
|
424
|
+
# Used to submit feedback regarding the quality of previous workflow execution
|
425
|
+
# and its outputs.
|
426
|
+
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
230
427
|
#
|
231
|
-
#
|
232
|
-
#
|
233
|
-
|
234
|
-
# @param
|
235
|
-
|
236
|
-
|
428
|
+
# @param actuals [Array<Hash>] Feedback regarding the quality of an output on a previously executed workflow.Request of type Array<Vellum::SubmitWorkflowExecutionActualRequest>, as a Hash
|
429
|
+
# @param execution_id [String] The Vellum-generated ID of a previously executed workflow. Must provide either
|
430
|
+
# this or external_id.
|
431
|
+
# @param external_id [String] The external ID that was originally provided by when executing the workflow, if
|
432
|
+
# applicable, that you'd now like to submit actuals for. Must provide either this
|
433
|
+
# or execution_id.
|
434
|
+
# @param request_options [Vellum::RequestOptions]
|
237
435
|
# @return [Void]
|
436
|
+
# @example
|
437
|
+
# api = Vellum::Client.new(
|
438
|
+
# base_url: "https://api.example.com",
|
439
|
+
# environment: Vellum::Environment::PRODUCTION,
|
440
|
+
# api_key: "YOUR_API_KEY"
|
441
|
+
# )
|
442
|
+
# api.submit_workflow_execution_actuals(actuals: [{ output_type: "STRING" }])
|
238
443
|
def submit_workflow_execution_actuals(actuals:, execution_id: nil, external_id: nil, request_options: nil)
|
239
|
-
@request_client.conn.post do |req|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
444
|
+
response = @request_client.conn.post do | req |
|
445
|
+
unless request_options&.timeout_in_seconds.nil?
|
446
|
+
req.options.timeout = request_options.timeout_in_seconds
|
447
|
+
end
|
448
|
+
unless request_options&.api_key.nil?
|
449
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
450
|
+
end
|
451
|
+
req.headers = { **(req.headers || {}), **@request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
452
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
453
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
454
|
+
end
|
455
|
+
req.body = { **(request_options&.additional_body_parameters || {}), actuals: actuals, execution_id: execution_id, external_id: external_id }.compact
|
456
|
+
req.url "#{@request_client.get_url(environment: Predict, request_options: request_options)}/v1/submit-workflow-execution-actuals"
|
457
|
+
end
|
251
458
|
end
|
252
459
|
end
|
253
|
-
|
254
460
|
class AsyncClient
|
255
|
-
|
256
|
-
|
461
|
+
# @return [Vellum::AsyncAdHocClient]
|
462
|
+
attr_reader :ad_hoc
|
463
|
+
# @return [Vellum::AsyncContainerImagesClient]
|
464
|
+
attr_reader :container_images
|
465
|
+
# @return [Vellum::AsyncDeploymentsClient]
|
466
|
+
attr_reader :deployments
|
467
|
+
# @return [Vellum::AsyncDocumentIndexesClient]
|
468
|
+
attr_reader :document_indexes
|
469
|
+
# @return [Vellum::AsyncDocumentsClient]
|
470
|
+
attr_reader :documents
|
471
|
+
# @return [Vellum::AsyncFolderEntitiesClient]
|
472
|
+
attr_reader :folder_entities
|
473
|
+
# @return [Vellum::AsyncMetricDefinitionsClient]
|
474
|
+
attr_reader :metric_definitions
|
475
|
+
# @return [Vellum::AsyncMlModelsClient]
|
476
|
+
attr_reader :ml_models
|
477
|
+
# @return [Vellum::AsyncOrganizationsClient]
|
478
|
+
attr_reader :organizations
|
479
|
+
# @return [Vellum::AsyncPromptsClient]
|
480
|
+
attr_reader :prompts
|
481
|
+
# @return [Vellum::AsyncSandboxesClient]
|
482
|
+
attr_reader :sandboxes
|
483
|
+
# @return [Vellum::AsyncTestSuiteRunsClient]
|
484
|
+
attr_reader :test_suite_runs
|
485
|
+
# @return [Vellum::AsyncTestSuitesClient]
|
486
|
+
attr_reader :test_suites
|
487
|
+
# @return [Vellum::AsyncWorkflowDeploymentsClient]
|
488
|
+
attr_reader :workflow_deployments
|
489
|
+
# @return [Vellum::AsyncReleaseReviewsClient]
|
490
|
+
attr_reader :release_reviews
|
491
|
+
# @return [Vellum::AsyncWorkflowSandboxesClient]
|
492
|
+
attr_reader :workflow_sandboxes
|
493
|
+
# @return [Vellum::AsyncWorkflowsClient]
|
494
|
+
attr_reader :workflows
|
495
|
+
# @return [Vellum::AsyncWorkspaceSecretsClient]
|
496
|
+
attr_reader :workspace_secrets
|
497
|
+
# @return [Vellum::AsyncWorkspacesClient]
|
498
|
+
attr_reader :workspaces
|
499
|
+
|
257
500
|
|
258
|
-
# @param
|
501
|
+
# @param base_url [String]
|
502
|
+
# @param environment [Vellum::Environment]
|
259
503
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
260
|
-
# @param timeout_in_seconds [Long]
|
261
|
-
# @param api_key [String]
|
262
|
-
# @return [AsyncClient]
|
263
|
-
def initialize(
|
264
|
-
@async_request_client = AsyncRequestClient.new(
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
@
|
272
|
-
@
|
273
|
-
@
|
274
|
-
@
|
275
|
-
@
|
504
|
+
# @param timeout_in_seconds [Long]
|
505
|
+
# @param api_key [String]
|
506
|
+
# @return [Vellum::AsyncClient]
|
507
|
+
def initialize(base_url: nil, environment: Vellum::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil, api_key:)
|
508
|
+
@async_request_client = Vellum::AsyncRequestClient.new(
|
509
|
+
base_url: base_url,
|
510
|
+
environment: environment,
|
511
|
+
max_retries: max_retries,
|
512
|
+
timeout_in_seconds: timeout_in_seconds,
|
513
|
+
api_key: api_key
|
514
|
+
)
|
515
|
+
@ad_hoc = Vellum::AsyncAdHocClient.new(request_client: @async_request_client)
|
516
|
+
@container_images = Vellum::AsyncContainerImagesClient.new(request_client: @async_request_client)
|
517
|
+
@deployments = Vellum::AsyncDeploymentsClient.new(request_client: @async_request_client)
|
518
|
+
@document_indexes = Vellum::AsyncDocumentIndexesClient.new(request_client: @async_request_client)
|
519
|
+
@documents = Vellum::AsyncDocumentsClient.new(request_client: @async_request_client)
|
520
|
+
@folder_entities = Vellum::AsyncFolderEntitiesClient.new(request_client: @async_request_client)
|
521
|
+
@metric_definitions = Vellum::AsyncMetricDefinitionsClient.new(request_client: @async_request_client)
|
522
|
+
@ml_models = Vellum::AsyncMlModelsClient.new(request_client: @async_request_client)
|
523
|
+
@organizations = Vellum::AsyncOrganizationsClient.new(request_client: @async_request_client)
|
524
|
+
@prompts = Vellum::AsyncPromptsClient.new(request_client: @async_request_client)
|
525
|
+
@sandboxes = Vellum::AsyncSandboxesClient.new(request_client: @async_request_client)
|
526
|
+
@test_suite_runs = Vellum::AsyncTestSuiteRunsClient.new(request_client: @async_request_client)
|
527
|
+
@test_suites = Vellum::AsyncTestSuitesClient.new(request_client: @async_request_client)
|
528
|
+
@workflow_deployments = Vellum::AsyncWorkflowDeploymentsClient.new(request_client: @async_request_client)
|
529
|
+
@release_reviews = Vellum::AsyncReleaseReviewsClient.new(request_client: @async_request_client)
|
530
|
+
@workflow_sandboxes = Vellum::AsyncWorkflowSandboxesClient.new(request_client: @async_request_client)
|
531
|
+
@workflows = Vellum::AsyncWorkflowsClient.new(request_client: @async_request_client)
|
532
|
+
@workspace_secrets = Vellum::AsyncWorkspaceSecretsClient.new(request_client: @async_request_client)
|
533
|
+
@workspaces = Vellum::AsyncWorkspacesClient.new(request_client: @async_request_client)
|
276
534
|
end
|
277
|
-
|
278
|
-
#
|
279
|
-
#
|
280
|
-
# @param
|
281
|
-
# @param
|
282
|
-
# @param
|
283
|
-
# @
|
284
|
-
# @
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
inputs: inputs,
|
308
|
-
prompt_deployment_id: prompt_deployment_id,
|
309
|
-
prompt_deployment_name: prompt_deployment_name,
|
310
|
-
release_tag: release_tag,
|
311
|
-
external_id: external_id,
|
312
|
-
expand_meta: expand_meta,
|
313
|
-
raw_overrides: raw_overrides,
|
314
|
-
expand_raw: expand_raw,
|
315
|
-
metadata: metadata
|
316
|
-
}.compact
|
317
|
-
req.url "#{@async_request_client.default_environment[:Predict]}/v1/execute-prompt"
|
318
|
-
end
|
319
|
-
ExecutePromptResponse.from_json(json_object: response.body)
|
535
|
+
# @param url [String]
|
536
|
+
# @param method [Vellum::MethodEnum]
|
537
|
+
# @param body [String, Array<Object>, Hash{String => Object}]
|
538
|
+
# @param headers [Hash{String => Vellum::ExecuteApiRequestHeadersValue}]
|
539
|
+
# @param bearer_token [String, Vellum::VellumSecret]
|
540
|
+
# @param request_options [Vellum::RequestOptions]
|
541
|
+
# @return [Vellum::ExecuteApiResponse]
|
542
|
+
# @example
|
543
|
+
# api = Vellum::Client.new(
|
544
|
+
# base_url: "https://api.example.com",
|
545
|
+
# environment: Vellum::Environment::PRODUCTION,
|
546
|
+
# api_key: "YOUR_API_KEY"
|
547
|
+
# )
|
548
|
+
# api.execute_api(url: "url")
|
549
|
+
def execute_api(url:, method: nil, body: nil, headers: nil, bearer_token: nil, request_options: nil)
|
550
|
+
response = @async_request_client.conn.post do | req |
|
551
|
+
unless request_options&.timeout_in_seconds.nil?
|
552
|
+
req.options.timeout = request_options.timeout_in_seconds
|
553
|
+
end
|
554
|
+
unless request_options&.api_key.nil?
|
555
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
556
|
+
end
|
557
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
558
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
559
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
560
|
+
end
|
561
|
+
req.body = { **(request_options&.additional_body_parameters || {}), url: url, method: method, body: body, headers: headers, bearer_token: bearer_token }.compact
|
562
|
+
req.url "#{@async_request_client.get_url(environment: Default, request_options: request_options)}/v1/execute-api"
|
563
|
+
end
|
564
|
+
Vellum::ExecuteApiResponse.from_json(json_object: response.body)
|
320
565
|
end
|
321
|
-
|
322
|
-
#
|
566
|
+
# @param code [String]
|
567
|
+
# @param runtime [Vellum::CodeExecutionRuntime]
|
568
|
+
# @param input_values [Array<Hash>] Request of type Array<Vellum::CodeExecutorInput>, as a Hash
|
569
|
+
# @param packages [Array<Hash>] Request of type Array<Vellum::CodeExecutionPackage>, as a Hash
|
570
|
+
# * :version (String)
|
571
|
+
# * :name (String)
|
572
|
+
# @param output_type [Vellum::VellumVariableType]
|
573
|
+
# @param request_options [Vellum::RequestOptions]
|
574
|
+
# @return [Vellum::CodeExecutorResponse]
|
575
|
+
# @example
|
576
|
+
# api = Vellum::Client.new(
|
577
|
+
# base_url: "https://api.example.com",
|
578
|
+
# environment: Vellum::Environment::PRODUCTION,
|
579
|
+
# api_key: "YOUR_API_KEY"
|
580
|
+
# )
|
581
|
+
# api.execute_code(
|
582
|
+
# code: "code",
|
583
|
+
# runtime: PYTHON_3_11_6,
|
584
|
+
# input_values: [{ name: "name", type: "STRING", value: "value" }],
|
585
|
+
# packages: [{ version: "version", name: "name" }],
|
586
|
+
# output_type: STRING
|
587
|
+
# )
|
588
|
+
def execute_code(code:, runtime:, input_values:, packages:, output_type:, request_options: nil)
|
589
|
+
response = @async_request_client.conn.post do | req |
|
590
|
+
unless request_options&.timeout_in_seconds.nil?
|
591
|
+
req.options.timeout = request_options.timeout_in_seconds
|
592
|
+
end
|
593
|
+
unless request_options&.api_key.nil?
|
594
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
595
|
+
end
|
596
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
597
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
598
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
599
|
+
end
|
600
|
+
req.body = { **(request_options&.additional_body_parameters || {}), code: code, runtime: runtime, input_values: input_values, packages: packages, output_type: output_type }.compact
|
601
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-code"
|
602
|
+
end
|
603
|
+
Vellum::CodeExecutorResponse.from_json(json_object: response.body)
|
604
|
+
end
|
605
|
+
# Executes a deployed Prompt and returns the result.
|
323
606
|
#
|
324
|
-
# @param inputs [Array<Hash>]
|
325
|
-
# @param
|
326
|
-
|
327
|
-
# @param
|
328
|
-
|
329
|
-
# @param
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
607
|
+
# @param inputs [Array<Hash>] A list consisting of the Prompt Deployment's input variables and their values.Request of type Array<Vellum::PromptDeploymentInputRequest>, as a Hash
|
608
|
+
# @param prompt_deployment_id [String] The ID of the Prompt Deployment. Must provide either this or
|
609
|
+
# prompt_deployment_name.
|
610
|
+
# @param prompt_deployment_name [String] The unique name of the Prompt Deployment. Must provide either this or
|
611
|
+
# prompt_deployment_id.
|
612
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
613
|
+
# Prompt Deployment
|
614
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
615
|
+
# within a given Workspace.
|
616
|
+
# @param expand_meta [Hash] An optionally specified configuration used to opt in to including additional
|
617
|
+
# metadata about this prompt execution in the API response. Corresponding values
|
618
|
+
# will be returned under the `meta` key of the API response.Request of type Vellum::PromptDeploymentExpandMetaRequest, as a Hash
|
619
|
+
# * :model_name (Boolean)
|
620
|
+
# * :usage (Boolean)
|
621
|
+
# * :cost (Boolean)
|
622
|
+
# * :finish_reason (Boolean)
|
623
|
+
# * :latency (Boolean)
|
624
|
+
# * :deployment_release_tag (Boolean)
|
625
|
+
# * :prompt_version_id (Boolean)
|
626
|
+
# @param raw_overrides [Hash] Overrides for the raw API request sent to the model host. Combined with
|
627
|
+
# `expand_raw`, it can be used to access new features from models.Request of type Vellum::RawPromptExecutionOverridesRequest, as a Hash
|
628
|
+
# * :body (Hash{String => Object})
|
629
|
+
# * :headers (Hash{String => String})
|
630
|
+
# * :url (String)
|
631
|
+
# @param expand_raw [Array<String>] A list of keys whose values you'd like to directly return from the JSON response
|
632
|
+
# of the model provider. Useful if you need lower-level info returned by model
|
633
|
+
# providers that Vellum would otherwise omit. Corresponding key/value pairs will
|
634
|
+
# be returned under the `raw` key of the API response.
|
635
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
636
|
+
# additional monitoring data such as user id, session id, etc. for future
|
637
|
+
# analysis.
|
638
|
+
# @param request_options [Vellum::RequestOptions]
|
639
|
+
# @return [Vellum::FulfilledExecutePromptResponse, Vellum::RejectedExecutePromptResponse]
|
640
|
+
# @example
|
641
|
+
# api = Vellum::Client.new(
|
642
|
+
# base_url: "https://api.example.com",
|
643
|
+
# environment: Vellum::Environment::PRODUCTION,
|
644
|
+
# api_key: "YOUR_API_KEY"
|
645
|
+
# )
|
646
|
+
# api.execute_prompt(inputs: [{ name: "name", type: "STRING", value: "value" }])
|
647
|
+
def execute_prompt(inputs:, prompt_deployment_id: nil, prompt_deployment_name: nil, release_tag: nil, external_id: nil, expand_meta: nil, raw_overrides: nil, expand_raw: nil, metadata: nil, request_options: nil)
|
648
|
+
response = @async_request_client.conn.post do | req |
|
649
|
+
unless request_options&.timeout_in_seconds.nil?
|
650
|
+
req.options.timeout = request_options.timeout_in_seconds
|
651
|
+
end
|
652
|
+
unless request_options&.api_key.nil?
|
653
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
654
|
+
end
|
655
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
656
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
657
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
658
|
+
end
|
659
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, prompt_deployment_id: prompt_deployment_id, prompt_deployment_name: prompt_deployment_name, release_tag: release_tag, external_id: external_id, expand_meta: expand_meta, raw_overrides: raw_overrides, expand_raw: expand_raw, metadata: metadata }.compact
|
660
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-prompt"
|
661
|
+
end
|
662
|
+
Vellum::ExecutePromptResponse.from_json(json_object: response.body)
|
348
663
|
end
|
349
|
-
|
350
|
-
# Generate a completion using a previously defined deployment.
|
664
|
+
# Executes a deployed Workflow and returns its outputs.
|
351
665
|
#
|
352
|
-
#
|
666
|
+
# @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding
|
667
|
+
# values.Request of type Array<Vellum::WorkflowRequestInputRequest>, as a Hash
|
668
|
+
# @param expand_meta [Hash] An optionally specified configuration used to opt in to including additional
|
669
|
+
# metadata about this workflow execution in the API response. Corresponding values
|
670
|
+
# will be returned under the `execution_meta` key within NODE events in the
|
671
|
+
# response stream.Request of type Vellum::WorkflowExpandMetaRequest, as a Hash
|
672
|
+
# * :usage (Boolean)
|
673
|
+
# * :cost (Boolean)
|
674
|
+
# * :model_name (Boolean)
|
675
|
+
# @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or
|
676
|
+
# workflow_deployment_name.
|
677
|
+
# @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or
|
678
|
+
# workflow_deployment_id.
|
679
|
+
# @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the
|
680
|
+
# Workflow Deployment
|
681
|
+
# @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique
|
682
|
+
# within a given Workspace.
|
683
|
+
# @param metadata [Hash{String => Object}] Arbitrary JSON metadata associated with this request. Can be used to capture
|
684
|
+
# additional monitoring data such as user id, session id, etc. for future
|
685
|
+
# analysis.
|
686
|
+
# @param request_options [Vellum::RequestOptions]
|
687
|
+
# @return [Vellum::ExecuteWorkflowResponse]
|
688
|
+
# @example
|
689
|
+
# api = Vellum::Client.new(
|
690
|
+
# base_url: "https://api.example.com",
|
691
|
+
# environment: Vellum::Environment::PRODUCTION,
|
692
|
+
# api_key: "YOUR_API_KEY"
|
693
|
+
# )
|
694
|
+
# api.execute_workflow(inputs: [{ name: "name", type: "STRING", value: "value" }])
|
695
|
+
def execute_workflow(inputs:, expand_meta: nil, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil, external_id: nil, metadata: nil, request_options: nil)
|
696
|
+
response = @async_request_client.conn.post do | req |
|
697
|
+
unless request_options&.timeout_in_seconds.nil?
|
698
|
+
req.options.timeout = request_options.timeout_in_seconds
|
699
|
+
end
|
700
|
+
unless request_options&.api_key.nil?
|
701
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
702
|
+
end
|
703
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
704
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
705
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
706
|
+
end
|
707
|
+
req.body = { **(request_options&.additional_body_parameters || {}), inputs: inputs, expand_meta: expand_meta, workflow_deployment_id: workflow_deployment_id, workflow_deployment_name: workflow_deployment_name, release_tag: release_tag, external_id: external_id, metadata: metadata }.compact
|
708
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/execute-workflow"
|
709
|
+
end
|
710
|
+
Vellum::ExecuteWorkflowResponse.from_json(json_object: response.body)
|
711
|
+
end
|
712
|
+
# Generate a completion using a previously defined deployment.
|
713
|
+
# Important: This endpoint is DEPRECATED and has been superseded by
|
714
|
+
# [execute-prompt](/api-reference/api-reference/execute-prompt).
|
353
715
|
#
|
354
716
|
# @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
|
355
717
|
# @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
|
356
|
-
# @param requests [Array<Hash>] The generation request to make. Bulk requests are no longer supported, this
|
357
|
-
|
358
|
-
# * :
|
359
|
-
# * :
|
360
|
-
#
|
361
|
-
#
|
362
|
-
|
363
|
-
#
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
718
|
+
# @param requests [Array<Hash>] The generation request to make. Bulk requests are no longer supported, this
|
719
|
+
# field must be an array of length 1.Request of type Array<Vellum::GenerateRequest>, as a Hash
|
720
|
+
# * :input_values (Hash{String => Object})
|
721
|
+
# * :chat_history (Array<Vellum::ChatMessageRequest>)
|
722
|
+
# * :external_ids (Array<String>)
|
723
|
+
# @param options [Hash] Additional configuration that can be used to control what's included in the
|
724
|
+
# response.Request of type Vellum::GenerateOptionsRequest, as a Hash
|
725
|
+
# * :logprobs (Vellum::LogprobsEnum)
|
726
|
+
# @param request_options [Vellum::RequestOptions]
|
727
|
+
# @return [Vellum::GenerateResponse]
|
728
|
+
# @example
|
729
|
+
# api = Vellum::Client.new(
|
730
|
+
# base_url: "https://api.example.com",
|
731
|
+
# environment: Vellum::Environment::PRODUCTION,
|
732
|
+
# api_key: "YOUR_API_KEY"
|
733
|
+
# )
|
734
|
+
# api.generate(requests: [{ input_values: { "key": "value" } }])
|
735
|
+
def generate(deployment_id: nil, deployment_name: nil, requests:, options: nil, request_options: nil)
|
736
|
+
response = @async_request_client.conn.post do | req |
|
737
|
+
unless request_options&.timeout_in_seconds.nil?
|
738
|
+
req.options.timeout = request_options.timeout_in_seconds
|
739
|
+
end
|
740
|
+
unless request_options&.api_key.nil?
|
741
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
742
|
+
end
|
743
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
744
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
745
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
746
|
+
end
|
747
|
+
req.body = { **(request_options&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, requests: requests, options: options }.compact
|
748
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/generate"
|
749
|
+
end
|
750
|
+
Vellum::GenerateResponse.from_json(json_object: response.body)
|
379
751
|
end
|
380
|
-
|
381
|
-
# Perform a search against a document index.
|
382
|
-
#
|
383
|
-
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
752
|
+
# Perform a search against a document index.
|
384
753
|
#
|
385
|
-
# @param index_id [String] The ID of the index to search against. Must provide either this or
|
386
|
-
|
754
|
+
# @param index_id [String] The ID of the index to search against. Must provide either this, index_name or
|
755
|
+
# document_index.
|
756
|
+
# @param index_name [String] The name of the index to search against. Must provide either this, index_id or
|
757
|
+
# document_index.
|
387
758
|
# @param query [String] The query to search for.
|
388
|
-
# @param options [Hash] Configuration options for the search.Request of type SearchRequestOptionsRequest, as a Hash
|
389
|
-
# * :limit (Integer)
|
759
|
+
# @param options [Hash] Configuration options for the search.Request of type Vellum::SearchRequestOptionsRequest, as a Hash
|
760
|
+
# * :limit (Integer)
|
390
761
|
# * :weights (Hash)
|
391
|
-
# * :semantic_similarity (Float)
|
392
|
-
# * :keywords (Float)
|
762
|
+
# * :semantic_similarity (Float)
|
763
|
+
# * :keywords (Float)
|
393
764
|
# * :result_merging (Hash)
|
394
|
-
# * :enabled (Boolean)
|
765
|
+
# * :enabled (Boolean)
|
395
766
|
# * :filters (Hash)
|
396
|
-
# * :external_ids (Array<String>)
|
767
|
+
# * :external_ids (Array<String>)
|
397
768
|
# * :metadata (Hash)
|
398
|
-
#
|
399
|
-
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
769
|
+
# @param document_index [String] Either the index name or index ID to search against. Must provide either this,
|
770
|
+
# index_id or index_name.
|
771
|
+
# @param request_options [Vellum::RequestOptions]
|
772
|
+
# @return [Vellum::SearchResponse]
|
773
|
+
# @example
|
774
|
+
# api = Vellum::Client.new(
|
775
|
+
# base_url: "https://api.example.com",
|
776
|
+
# environment: Vellum::Environment::PRODUCTION,
|
777
|
+
# api_key: "YOUR_API_KEY"
|
778
|
+
# )
|
779
|
+
# api.search(query: "query")
|
780
|
+
def search(index_id: nil, index_name: nil, query:, options: nil, document_index: nil, request_options: nil)
|
781
|
+
response = @async_request_client.conn.post do | req |
|
782
|
+
unless request_options&.timeout_in_seconds.nil?
|
783
|
+
req.options.timeout = request_options.timeout_in_seconds
|
784
|
+
end
|
785
|
+
unless request_options&.api_key.nil?
|
786
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
787
|
+
end
|
788
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
789
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
790
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
791
|
+
end
|
792
|
+
req.body = { **(request_options&.additional_body_parameters || {}), index_id: index_id, index_name: index_name, query: query, options: options, document_index: document_index }.compact
|
793
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/search"
|
794
|
+
end
|
795
|
+
Vellum::SearchResponse.from_json(json_object: response.body)
|
421
796
|
end
|
422
|
-
|
423
|
-
|
424
|
-
#
|
425
|
-
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
797
|
+
# Used to submit feedback regarding the quality of previously generated
|
798
|
+
# completions.
|
426
799
|
#
|
427
800
|
# @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
|
428
801
|
# @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
|
429
|
-
# @param actuals [Array<Hash>] Feedback regarding the quality of previously generated completionsRequest of type Array<SubmitCompletionActualRequest>, as a Hash
|
430
|
-
# * :id (String)
|
431
|
-
# * :external_id (String)
|
432
|
-
# * :text (String)
|
433
|
-
# * :quality (Float)
|
434
|
-
# * :timestamp (DateTime)
|
435
|
-
#
|
802
|
+
# @param actuals [Array<Hash>] Feedback regarding the quality of previously generated completionsRequest of type Array<Vellum::SubmitCompletionActualRequest>, as a Hash
|
803
|
+
# * :id (String)
|
804
|
+
# * :external_id (String)
|
805
|
+
# * :text (String)
|
806
|
+
# * :quality (Float)
|
807
|
+
# * :timestamp (DateTime)
|
808
|
+
# * :metadata (Hash{String => Object})
|
809
|
+
# @param request_options [Vellum::RequestOptions]
|
436
810
|
# @return [Void]
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
811
|
+
# @example
|
812
|
+
# api = Vellum::Client.new(
|
813
|
+
# base_url: "https://api.example.com",
|
814
|
+
# environment: Vellum::Environment::PRODUCTION,
|
815
|
+
# api_key: "YOUR_API_KEY"
|
816
|
+
# )
|
817
|
+
# api.submit_completion_actuals(actuals: [{ }])
|
818
|
+
def submit_completion_actuals(deployment_id: nil, deployment_name: nil, actuals:, request_options: nil)
|
819
|
+
response = @async_request_client.conn.post do | req |
|
820
|
+
unless request_options&.timeout_in_seconds.nil?
|
821
|
+
req.options.timeout = request_options.timeout_in_seconds
|
822
|
+
end
|
823
|
+
unless request_options&.api_key.nil?
|
824
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
825
|
+
end
|
826
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
827
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
828
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
829
|
+
end
|
830
|
+
req.body = { **(request_options&.additional_body_parameters || {}), deployment_id: deployment_id, deployment_name: deployment_name, actuals: actuals }.compact
|
831
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/submit-completion-actuals"
|
832
|
+
end
|
450
833
|
end
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
834
|
+
# Used to submit feedback regarding the quality of previous workflow execution
|
835
|
+
# and its outputs.
|
836
|
+
# **Note:** Uses a base url of `https://predict.vellum.ai`.
|
455
837
|
#
|
456
|
-
# @param actuals [Array<Hash>] Feedback regarding the quality of an output on a previously executed workflow.Request of type Array<SubmitWorkflowExecutionActualRequest>, as a Hash
|
457
|
-
# @param execution_id [String] The Vellum-generated ID of a previously executed workflow. Must provide either
|
458
|
-
|
459
|
-
# @param
|
838
|
+
# @param actuals [Array<Hash>] Feedback regarding the quality of an output on a previously executed workflow.Request of type Array<Vellum::SubmitWorkflowExecutionActualRequest>, as a Hash
|
839
|
+
# @param execution_id [String] The Vellum-generated ID of a previously executed workflow. Must provide either
|
840
|
+
# this or external_id.
|
841
|
+
# @param external_id [String] The external ID that was originally provided by when executing the workflow, if
|
842
|
+
# applicable, that you'd now like to submit actuals for. Must provide either this
|
843
|
+
# or execution_id.
|
844
|
+
# @param request_options [Vellum::RequestOptions]
|
460
845
|
# @return [Void]
|
846
|
+
# @example
|
847
|
+
# api = Vellum::Client.new(
|
848
|
+
# base_url: "https://api.example.com",
|
849
|
+
# environment: Vellum::Environment::PRODUCTION,
|
850
|
+
# api_key: "YOUR_API_KEY"
|
851
|
+
# )
|
852
|
+
# api.submit_workflow_execution_actuals(actuals: [{ output_type: "STRING" }])
|
461
853
|
def submit_workflow_execution_actuals(actuals:, execution_id: nil, external_id: nil, request_options: nil)
|
462
|
-
@async_request_client.conn.post do |req|
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
req.url "#{@async_request_client.default_environment[:Predict]}/v1/submit-workflow-execution-actuals"
|
473
|
-
end
|
474
|
-
end
|
854
|
+
response = @async_request_client.conn.post do | req |
|
855
|
+
unless request_options&.timeout_in_seconds.nil?
|
856
|
+
req.options.timeout = request_options.timeout_in_seconds
|
857
|
+
end
|
858
|
+
unless request_options&.api_key.nil?
|
859
|
+
req.headers["X-API-KEY"] = request_options.api_key
|
860
|
+
end
|
861
|
+
req.headers = { **(req.headers || {}), **@async_request_client.get_headers, **(request_options&.additional_headers || {}) }.compact
|
862
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
863
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
475
864
|
end
|
865
|
+
req.body = { **(request_options&.additional_body_parameters || {}), actuals: actuals, execution_id: execution_id, external_id: external_id }.compact
|
866
|
+
req.url "#{@async_request_client.get_url(environment: Predict, request_options: request_options)}/v1/submit-workflow-execution-actuals"
|
476
867
|
end
|
868
|
+
end
|
869
|
+
end
|
870
|
+
end
|