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