vellum-ai 0.7.2__py3-none-any.whl → 0.7.5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (483) hide show
  1. vellum/__init__.py +146 -94
  2. vellum/client.py +1051 -1097
  3. vellum/core/__init__.py +4 -1
  4. vellum/core/client_wrapper.py +7 -3
  5. vellum/core/http_client.py +365 -20
  6. vellum/core/jsonable_encoder.py +3 -0
  7. vellum/core/pydantic_utilities.py +16 -0
  8. vellum/core/query_encoder.py +33 -0
  9. vellum/core/remove_none_from_dict.py +2 -2
  10. vellum/core/request_options.py +2 -2
  11. vellum/resources/__init__.py +2 -0
  12. vellum/resources/deployments/client.py +354 -371
  13. vellum/resources/document_indexes/client.py +542 -610
  14. vellum/resources/documents/client.py +327 -399
  15. vellum/resources/folder_entities/client.py +56 -72
  16. vellum/{types/map_enum.py → resources/ml_models/__init__.py} +0 -3
  17. vellum/resources/ml_models/client.py +837 -0
  18. vellum/resources/sandboxes/client.py +204 -242
  19. vellum/resources/test_suite_runs/client.py +183 -213
  20. vellum/resources/test_suites/client.py +307 -311
  21. vellum/resources/workflow_deployments/client.py +230 -268
  22. vellum/resources/workflow_sandboxes/client.py +82 -96
  23. vellum/terraform/_jsii/vellum-ai_vellum@0.0.0.jsii.tgz +0 -0
  24. vellum/terraform/data_vellum_document_index/__init__.py +10 -10
  25. vellum/terraform/document_index/__init__.py +17 -17
  26. vellum/terraform/provider/__init__.py +57 -12
  27. vellum/terraform/versions.json +1 -1
  28. vellum/types/__init__.py +152 -96
  29. vellum/types/api_node_result.py +7 -3
  30. vellum/types/api_node_result_data.py +7 -3
  31. vellum/types/array_chat_message_content.py +7 -3
  32. vellum/types/array_chat_message_content_item.py +53 -12
  33. vellum/types/array_chat_message_content_item_request.py +53 -12
  34. vellum/types/array_chat_message_content_request.py +7 -3
  35. vellum/types/array_parameter_config.py +50 -0
  36. vellum/types/array_parameter_config_request.py +50 -0
  37. vellum/types/array_variable_value_item.py +102 -24
  38. vellum/types/array_vellum_value_item.py +102 -24
  39. vellum/types/array_vellum_value_item_request.py +102 -24
  40. vellum/types/basic_vectorizer_intfloat_multilingual_e_5_large.py +7 -3
  41. vellum/types/basic_vectorizer_intfloat_multilingual_e_5_large_request.py +7 -3
  42. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1.py +7 -3
  43. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1_request.py +7 -3
  44. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1.py +7 -3
  45. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1_request.py +7 -3
  46. vellum/types/boolean_parameter_config.py +35 -0
  47. vellum/types/boolean_parameter_config_request.py +35 -0
  48. vellum/types/chat_history_input_request.py +7 -3
  49. vellum/types/chat_message.py +7 -3
  50. vellum/types/chat_message_content.py +70 -16
  51. vellum/types/chat_message_content_request.py +70 -16
  52. vellum/types/chat_message_request.py +7 -3
  53. vellum/types/code_execution_node_array_result.py +7 -3
  54. vellum/types/code_execution_node_chat_history_result.py +7 -3
  55. vellum/types/code_execution_node_error_result.py +7 -3
  56. vellum/types/code_execution_node_function_call_result.py +7 -3
  57. vellum/types/code_execution_node_json_result.py +7 -3
  58. vellum/types/code_execution_node_number_result.py +7 -3
  59. vellum/types/code_execution_node_result.py +7 -3
  60. vellum/types/code_execution_node_result_data.py +7 -3
  61. vellum/types/code_execution_node_result_output.py +144 -32
  62. vellum/types/code_execution_node_search_results_result.py +7 -3
  63. vellum/types/code_execution_node_string_result.py +7 -3
  64. vellum/types/compile_prompt_deployment_expand_meta_request.py +42 -0
  65. vellum/types/compile_prompt_meta.py +35 -0
  66. vellum/types/conditional_node_result.py +7 -3
  67. vellum/types/conditional_node_result_data.py +7 -3
  68. vellum/types/const_parameter_config.py +35 -0
  69. vellum/types/const_parameter_config_request.py +35 -0
  70. vellum/types/create_test_suite_test_case_request.py +7 -3
  71. vellum/types/deployment_provider_payload_response.py +9 -3
  72. vellum/types/deployment_read.py +12 -3
  73. vellum/types/deployment_release_tag_deployment_history_item.py +7 -3
  74. vellum/types/deployment_release_tag_read.py +7 -3
  75. vellum/types/document_document_to_document_index.py +7 -3
  76. vellum/types/document_index_chunking.py +54 -12
  77. vellum/types/document_index_chunking_request.py +54 -12
  78. vellum/types/document_index_indexing_config.py +7 -3
  79. vellum/types/document_index_indexing_config_request.py +7 -3
  80. vellum/types/document_index_read.py +7 -3
  81. vellum/types/document_read.py +7 -3
  82. vellum/types/enriched_normalized_completion.py +7 -3
  83. vellum/types/error_variable_value.py +7 -3
  84. vellum/types/error_vellum_value.py +7 -3
  85. vellum/types/error_vellum_value_request.py +7 -3
  86. vellum/types/execute_prompt_event.py +82 -16
  87. vellum/types/execute_prompt_response.py +44 -8
  88. vellum/types/execute_workflow_response.py +7 -3
  89. vellum/types/execute_workflow_workflow_result_event.py +41 -8
  90. vellum/types/execution_array_vellum_value.py +7 -3
  91. vellum/types/execution_chat_history_vellum_value.py +7 -3
  92. vellum/types/execution_error_vellum_value.py +7 -3
  93. vellum/types/execution_function_call_vellum_value.py +7 -3
  94. vellum/types/execution_json_vellum_value.py +7 -3
  95. vellum/types/execution_number_vellum_value.py +7 -3
  96. vellum/types/execution_search_results_vellum_value.py +7 -3
  97. vellum/types/execution_string_vellum_value.py +7 -3
  98. vellum/types/execution_vellum_value.py +152 -32
  99. vellum/types/external_test_case_execution.py +7 -3
  100. vellum/types/external_test_case_execution_request.py +7 -3
  101. vellum/types/fulfilled_execute_prompt_event.py +7 -3
  102. vellum/types/fulfilled_execute_prompt_response.py +7 -3
  103. vellum/types/fulfilled_execute_workflow_workflow_result_event.py +7 -3
  104. vellum/types/fulfilled_prompt_execution_meta.py +7 -3
  105. vellum/types/fulfilled_workflow_node_result_event.py +7 -3
  106. vellum/types/function_call.py +7 -3
  107. vellum/types/function_call_chat_message_content.py +7 -3
  108. vellum/types/function_call_chat_message_content_request.py +7 -3
  109. vellum/types/function_call_chat_message_content_value.py +7 -3
  110. vellum/types/function_call_chat_message_content_value_request.py +7 -3
  111. vellum/types/function_call_request.py +7 -3
  112. vellum/types/function_call_variable_value.py +7 -3
  113. vellum/types/function_call_vellum_value.py +7 -3
  114. vellum/types/function_call_vellum_value_request.py +7 -3
  115. vellum/types/generate_options_request.py +7 -3
  116. vellum/types/generate_request.py +7 -3
  117. vellum/types/generate_result.py +7 -3
  118. vellum/types/generate_result_data.py +7 -3
  119. vellum/types/generate_result_error.py +7 -3
  120. vellum/types/generate_stream_response.py +7 -3
  121. vellum/types/generate_stream_result.py +7 -3
  122. vellum/types/generate_stream_result_data.py +7 -3
  123. vellum/types/hkunlp_instructor_xl_vectorizer.py +7 -3
  124. vellum/types/hkunlp_instructor_xl_vectorizer_request.py +7 -3
  125. vellum/types/hosted_by_enum.py +26 -0
  126. vellum/types/hugging_face_tokenizer_config.py +34 -0
  127. vellum/types/hugging_face_tokenizer_config_request.py +34 -0
  128. vellum/types/image_chat_message_content.py +7 -3
  129. vellum/types/image_chat_message_content_request.py +7 -3
  130. vellum/types/image_variable_value.py +7 -3
  131. vellum/types/image_vellum_value.py +7 -3
  132. vellum/types/image_vellum_value_request.py +7 -3
  133. vellum/types/indexing_config_vectorizer.py +117 -36
  134. vellum/types/indexing_config_vectorizer_request.py +117 -36
  135. vellum/types/initiated_execute_prompt_event.py +7 -3
  136. vellum/types/initiated_prompt_execution_meta.py +7 -3
  137. vellum/types/initiated_workflow_node_result_event.py +7 -3
  138. vellum/types/instructor_vectorizer_config.py +7 -3
  139. vellum/types/instructor_vectorizer_config_request.py +7 -3
  140. vellum/types/integer_parameter_config.py +39 -0
  141. vellum/types/integer_parameter_config_request.py +39 -0
  142. vellum/types/json_input_request.py +7 -3
  143. vellum/types/json_variable_value.py +7 -3
  144. vellum/types/json_vellum_value.py +7 -3
  145. vellum/types/json_vellum_value_request.py +7 -3
  146. vellum/types/map_node_result.py +7 -3
  147. vellum/types/map_node_result_data.py +7 -3
  148. vellum/types/merge_node_result.py +7 -3
  149. vellum/types/merge_node_result_data.py +7 -3
  150. vellum/types/metadata_filter_config_request.py +7 -3
  151. vellum/types/metadata_filter_rule_request.py +7 -3
  152. vellum/types/metric_node_result.py +7 -3
  153. vellum/types/{execute_workflow_stream_error_response.py → ml_model_build_config.py} +9 -8
  154. vellum/types/{execute_prompt_api_error_response.py → ml_model_build_config_request.py} +9 -8
  155. vellum/types/ml_model_developer.py +27 -0
  156. vellum/types/ml_model_developer_enum_value_label.py +31 -0
  157. vellum/types/ml_model_display_config_labelled.py +33 -0
  158. vellum/types/ml_model_display_config_request.py +33 -0
  159. vellum/types/ml_model_display_tag.py +7 -0
  160. vellum/types/ml_model_display_tag_enum_value_label.py +31 -0
  161. vellum/types/ml_model_exec_config.py +40 -0
  162. vellum/types/ml_model_exec_config_request.py +40 -0
  163. vellum/types/ml_model_family.py +29 -0
  164. vellum/types/ml_model_family_enum_value_label.py +31 -0
  165. vellum/types/ml_model_feature.py +18 -0
  166. vellum/types/ml_model_parameter_config.py +42 -0
  167. vellum/types/ml_model_parameter_config_request.py +42 -0
  168. vellum/types/ml_model_read.py +108 -0
  169. vellum/types/ml_model_request_authorization_config.py +30 -0
  170. vellum/types/ml_model_request_authorization_config_request.py +30 -0
  171. vellum/types/ml_model_request_authorization_config_type_enum.py +5 -0
  172. vellum/types/ml_model_request_config.py +32 -0
  173. vellum/types/ml_model_request_config_request.py +32 -0
  174. vellum/types/ml_model_response_config.py +31 -0
  175. vellum/types/ml_model_response_config_request.py +31 -0
  176. vellum/types/ml_model_tokenizer_config.py +59 -0
  177. vellum/types/ml_model_tokenizer_config_request.py +61 -0
  178. vellum/types/ml_model_usage.py +7 -3
  179. vellum/types/named_scenario_input_chat_history_variable_value_request.py +7 -3
  180. vellum/types/named_scenario_input_request.py +38 -8
  181. vellum/types/named_scenario_input_string_variable_value_request.py +7 -3
  182. vellum/types/named_test_case_array_variable_value.py +7 -3
  183. vellum/types/named_test_case_array_variable_value_request.py +7 -3
  184. vellum/types/named_test_case_chat_history_variable_value.py +7 -3
  185. vellum/types/named_test_case_chat_history_variable_value_request.py +7 -3
  186. vellum/types/named_test_case_error_variable_value.py +7 -3
  187. vellum/types/named_test_case_error_variable_value_request.py +7 -3
  188. vellum/types/named_test_case_function_call_variable_value.py +7 -3
  189. vellum/types/named_test_case_function_call_variable_value_request.py +7 -3
  190. vellum/types/named_test_case_json_variable_value.py +7 -3
  191. vellum/types/named_test_case_json_variable_value_request.py +7 -3
  192. vellum/types/named_test_case_number_variable_value.py +7 -3
  193. vellum/types/named_test_case_number_variable_value_request.py +7 -3
  194. vellum/types/named_test_case_search_results_variable_value.py +7 -3
  195. vellum/types/named_test_case_search_results_variable_value_request.py +7 -3
  196. vellum/types/named_test_case_string_variable_value.py +7 -3
  197. vellum/types/named_test_case_string_variable_value_request.py +7 -3
  198. vellum/types/named_test_case_variable_value.py +144 -32
  199. vellum/types/named_test_case_variable_value_request.py +144 -32
  200. vellum/types/node_input_compiled_array_value.py +7 -3
  201. vellum/types/node_input_compiled_chat_history_value.py +7 -3
  202. vellum/types/node_input_compiled_error_value.py +7 -3
  203. vellum/types/node_input_compiled_function_call.py +7 -3
  204. vellum/types/node_input_compiled_json_value.py +7 -3
  205. vellum/types/node_input_compiled_number_value.py +7 -3
  206. vellum/types/node_input_compiled_search_results_value.py +7 -3
  207. vellum/types/node_input_compiled_string_value.py +7 -3
  208. vellum/types/node_input_variable_compiled_value.py +152 -32
  209. vellum/types/node_output_compiled_array_value.py +7 -3
  210. vellum/types/node_output_compiled_chat_history_value.py +7 -3
  211. vellum/types/node_output_compiled_error_value.py +7 -3
  212. vellum/types/node_output_compiled_function_call_value.py +7 -3
  213. vellum/types/node_output_compiled_json_value.py +7 -3
  214. vellum/types/node_output_compiled_number_value.py +7 -3
  215. vellum/types/node_output_compiled_search_results_value.py +7 -3
  216. vellum/types/node_output_compiled_string_value.py +7 -3
  217. vellum/types/node_output_compiled_value.py +153 -32
  218. vellum/types/normalized_log_probs.py +7 -3
  219. vellum/types/normalized_token_log_probs.py +7 -3
  220. vellum/types/number_parameter_config.py +40 -0
  221. vellum/types/number_parameter_config_request.py +40 -0
  222. vellum/types/number_variable_value.py +7 -3
  223. vellum/types/number_vellum_value.py +7 -3
  224. vellum/types/number_vellum_value_request.py +7 -3
  225. vellum/types/object_parameter_config.py +49 -0
  226. vellum/types/object_parameter_config_request.py +49 -0
  227. vellum/types/one_of_parameter_config.py +44 -0
  228. vellum/types/one_of_parameter_config_request.py +44 -0
  229. vellum/types/open_ai_vectorizer_config.py +7 -3
  230. vellum/types/open_ai_vectorizer_config_request.py +7 -3
  231. vellum/types/open_ai_vectorizer_text_embedding_3_large.py +7 -3
  232. vellum/types/open_ai_vectorizer_text_embedding_3_large_request.py +7 -3
  233. vellum/types/open_ai_vectorizer_text_embedding_3_small.py +7 -3
  234. vellum/types/open_ai_vectorizer_text_embedding_3_small_request.py +7 -3
  235. vellum/types/open_ai_vectorizer_text_embedding_ada_002.py +7 -3
  236. vellum/types/open_ai_vectorizer_text_embedding_ada_002_request.py +7 -3
  237. vellum/types/paginated_document_index_read_list.py +7 -3
  238. vellum/types/paginated_ml_model_read_list.py +33 -0
  239. vellum/types/paginated_slim_deployment_read_list.py +7 -3
  240. vellum/types/paginated_slim_document_list.py +7 -3
  241. vellum/types/paginated_slim_workflow_deployment_list.py +7 -3
  242. vellum/types/paginated_test_suite_run_execution_list.py +7 -3
  243. vellum/types/paginated_test_suite_test_case_list.py +7 -3
  244. vellum/types/parameter_config.py +251 -0
  245. vellum/types/parameter_config_request.py +251 -0
  246. vellum/types/pdf_search_result_meta_source.py +7 -3
  247. vellum/types/pdf_search_result_meta_source_request.py +7 -3
  248. vellum/types/prompt_deployment_expand_meta_request_request.py +7 -3
  249. vellum/types/prompt_deployment_input_request.py +55 -12
  250. vellum/types/prompt_execution_meta.py +7 -3
  251. vellum/types/prompt_node_execution_meta.py +7 -3
  252. vellum/types/prompt_node_result.py +7 -3
  253. vellum/types/prompt_node_result_data.py +7 -3
  254. vellum/types/prompt_output.py +69 -16
  255. vellum/types/raw_prompt_execution_overrides_request.py +7 -3
  256. vellum/types/reducto_chunker_config.py +7 -3
  257. vellum/types/reducto_chunker_config_request.py +7 -3
  258. vellum/types/reducto_chunking.py +7 -3
  259. vellum/types/reducto_chunking_request.py +7 -3
  260. vellum/types/rejected_execute_prompt_event.py +7 -3
  261. vellum/types/rejected_execute_prompt_response.py +7 -3
  262. vellum/types/rejected_execute_workflow_workflow_result_event.py +7 -3
  263. vellum/types/rejected_prompt_execution_meta.py +7 -3
  264. vellum/types/rejected_workflow_node_result_event.py +7 -3
  265. vellum/types/replace_test_suite_test_case_request.py +7 -3
  266. vellum/types/sandbox_scenario.py +7 -3
  267. vellum/types/scenario_input.py +38 -8
  268. vellum/types/scenario_input_chat_history_variable_value.py +7 -3
  269. vellum/types/scenario_input_string_variable_value.py +7 -3
  270. vellum/types/search_filters_request.py +7 -3
  271. vellum/types/search_node_result.py +7 -3
  272. vellum/types/search_node_result_data.py +7 -3
  273. vellum/types/search_request_options_request.py +7 -3
  274. vellum/types/search_response.py +7 -3
  275. vellum/types/search_result.py +7 -3
  276. vellum/types/search_result_document.py +7 -3
  277. vellum/types/search_result_document_request.py +7 -3
  278. vellum/types/search_result_merging_request.py +7 -3
  279. vellum/types/search_result_meta.py +7 -3
  280. vellum/types/search_result_meta_request.py +7 -3
  281. vellum/types/search_result_meta_source.py +21 -5
  282. vellum/types/search_result_meta_source_request.py +21 -5
  283. vellum/types/search_result_request.py +7 -3
  284. vellum/types/search_weights_request.py +7 -3
  285. vellum/types/sentence_chunker_config.py +7 -3
  286. vellum/types/sentence_chunker_config_request.py +7 -3
  287. vellum/types/sentence_chunking.py +7 -3
  288. vellum/types/sentence_chunking_request.py +7 -3
  289. vellum/types/slim_deployment_read.py +11 -3
  290. vellum/types/slim_document.py +7 -3
  291. vellum/types/slim_workflow_deployment.py +12 -3
  292. vellum/types/streaming_execute_prompt_event.py +7 -3
  293. vellum/types/streaming_prompt_execution_meta.py +7 -3
  294. vellum/types/streaming_workflow_node_result_event.py +7 -3
  295. vellum/types/string_chat_message_content.py +7 -3
  296. vellum/types/string_chat_message_content_request.py +7 -3
  297. vellum/types/string_input_request.py +7 -3
  298. vellum/types/string_parameter_config.py +39 -0
  299. vellum/types/string_parameter_config_request.py +39 -0
  300. vellum/types/string_variable_value.py +7 -3
  301. vellum/types/string_vellum_value.py +7 -3
  302. vellum/types/string_vellum_value_request.py +7 -3
  303. vellum/types/submit_completion_actual_request.py +7 -3
  304. vellum/types/submit_workflow_execution_actual_request.py +67 -12
  305. vellum/types/subworkflow_node_result.py +7 -3
  306. vellum/types/subworkflow_node_result_data.py +7 -3
  307. vellum/types/templating_node_array_result.py +7 -3
  308. vellum/types/templating_node_chat_history_result.py +7 -3
  309. vellum/types/templating_node_error_result.py +7 -3
  310. vellum/types/templating_node_function_call_result.py +7 -3
  311. vellum/types/templating_node_json_result.py +7 -3
  312. vellum/types/templating_node_number_result.py +7 -3
  313. vellum/types/templating_node_result.py +7 -3
  314. vellum/types/templating_node_result_data.py +7 -3
  315. vellum/types/templating_node_result_output.py +144 -32
  316. vellum/types/templating_node_search_results_result.py +7 -3
  317. vellum/types/templating_node_string_result.py +7 -3
  318. vellum/types/terminal_node_array_result.py +7 -3
  319. vellum/types/terminal_node_chat_history_result.py +7 -3
  320. vellum/types/terminal_node_error_result.py +7 -3
  321. vellum/types/terminal_node_function_call_result.py +7 -3
  322. vellum/types/terminal_node_json_result.py +7 -3
  323. vellum/types/terminal_node_number_result.py +7 -3
  324. vellum/types/terminal_node_result.py +7 -3
  325. vellum/types/terminal_node_result_data.py +7 -3
  326. vellum/types/terminal_node_result_output.py +152 -32
  327. vellum/types/terminal_node_search_results_result.py +7 -3
  328. vellum/types/terminal_node_string_result.py +7 -3
  329. vellum/types/test_case_array_variable_value.py +7 -3
  330. vellum/types/test_case_chat_history_variable_value.py +7 -3
  331. vellum/types/test_case_error_variable_value.py +7 -3
  332. vellum/types/test_case_function_call_variable_value.py +7 -3
  333. vellum/types/test_case_json_variable_value.py +8 -4
  334. vellum/types/test_case_number_variable_value.py +7 -3
  335. vellum/types/test_case_search_results_variable_value.py +7 -3
  336. vellum/types/test_case_string_variable_value.py +7 -3
  337. vellum/types/test_case_variable_value.py +152 -32
  338. vellum/types/test_suite_run_deployment_release_tag_exec_config.py +7 -3
  339. vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +7 -3
  340. vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +7 -3
  341. vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +7 -3
  342. vellum/types/test_suite_run_exec_config.py +57 -12
  343. vellum/types/test_suite_run_exec_config_request.py +61 -12
  344. vellum/types/test_suite_run_execution.py +7 -3
  345. vellum/types/test_suite_run_execution_array_output.py +7 -3
  346. vellum/types/test_suite_run_execution_chat_history_output.py +7 -3
  347. vellum/types/test_suite_run_execution_error_output.py +7 -3
  348. vellum/types/test_suite_run_execution_function_call_output.py +7 -3
  349. vellum/types/test_suite_run_execution_json_output.py +7 -3
  350. vellum/types/test_suite_run_execution_metric_definition.py +7 -3
  351. vellum/types/test_suite_run_execution_metric_result.py +7 -3
  352. vellum/types/test_suite_run_execution_number_output.py +7 -3
  353. vellum/types/test_suite_run_execution_output.py +152 -32
  354. vellum/types/test_suite_run_execution_search_results_output.py +7 -3
  355. vellum/types/test_suite_run_execution_string_output.py +7 -3
  356. vellum/types/test_suite_run_external_exec_config.py +7 -3
  357. vellum/types/test_suite_run_external_exec_config_data.py +7 -3
  358. vellum/types/test_suite_run_external_exec_config_data_request.py +7 -3
  359. vellum/types/test_suite_run_external_exec_config_request.py +7 -3
  360. vellum/types/test_suite_run_metric_error_output.py +7 -3
  361. vellum/types/test_suite_run_metric_number_output.py +7 -3
  362. vellum/types/test_suite_run_metric_output.py +55 -12
  363. vellum/types/test_suite_run_metric_string_output.py +7 -3
  364. vellum/types/test_suite_run_read.py +7 -3
  365. vellum/types/test_suite_run_test_suite.py +7 -3
  366. vellum/types/test_suite_run_workflow_release_tag_exec_config.py +7 -3
  367. vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +7 -3
  368. vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +7 -3
  369. vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +7 -3
  370. vellum/types/test_suite_test_case.py +7 -3
  371. vellum/types/test_suite_test_case_bulk_operation_request.py +75 -16
  372. vellum/types/test_suite_test_case_bulk_result.py +74 -16
  373. vellum/types/test_suite_test_case_create_bulk_operation_request.py +7 -3
  374. vellum/types/test_suite_test_case_created_bulk_result.py +7 -3
  375. vellum/types/test_suite_test_case_created_bulk_result_data.py +7 -3
  376. vellum/types/test_suite_test_case_delete_bulk_operation_data_request.py +7 -3
  377. vellum/types/test_suite_test_case_delete_bulk_operation_request.py +7 -3
  378. vellum/types/test_suite_test_case_deleted_bulk_result.py +7 -3
  379. vellum/types/test_suite_test_case_deleted_bulk_result_data.py +7 -3
  380. vellum/types/test_suite_test_case_rejected_bulk_result.py +7 -3
  381. vellum/types/test_suite_test_case_replace_bulk_operation_request.py +7 -3
  382. vellum/types/test_suite_test_case_replaced_bulk_result.py +7 -3
  383. vellum/types/test_suite_test_case_replaced_bulk_result_data.py +7 -3
  384. vellum/types/test_suite_test_case_upsert_bulk_operation_request.py +7 -3
  385. vellum/types/{execute_workflow_error_response.py → tik_token_tokenizer_config.py} +11 -6
  386. vellum/types/{generate_error_response.py → tik_token_tokenizer_config_request.py} +11 -6
  387. vellum/types/token_overlapping_window_chunker_config.py +7 -3
  388. vellum/types/token_overlapping_window_chunker_config_request.py +7 -3
  389. vellum/types/token_overlapping_window_chunking.py +7 -3
  390. vellum/types/token_overlapping_window_chunking_request.py +7 -3
  391. vellum/types/upload_document_response.py +7 -3
  392. vellum/types/upsert_test_suite_test_case_request.py +7 -3
  393. vellum/types/vellum_error.py +7 -3
  394. vellum/types/vellum_error_request.py +7 -3
  395. vellum/types/vellum_image.py +7 -3
  396. vellum/types/vellum_image_request.py +7 -3
  397. vellum/types/vellum_variable.py +7 -3
  398. vellum/types/visibility_enum.py +5 -0
  399. vellum/types/workflow_deployment_read.py +12 -3
  400. vellum/types/workflow_event_error.py +7 -3
  401. vellum/types/workflow_execution_actual_chat_history_request.py +7 -3
  402. vellum/types/workflow_execution_actual_json_request.py +7 -3
  403. vellum/types/workflow_execution_actual_string_request.py +7 -3
  404. vellum/types/workflow_execution_node_result_event.py +7 -3
  405. vellum/types/workflow_execution_workflow_result_event.py +7 -3
  406. vellum/types/workflow_expand_meta_request.py +7 -3
  407. vellum/types/workflow_node_result_data.py +189 -45
  408. vellum/types/workflow_node_result_event.py +101 -20
  409. vellum/types/workflow_output.py +171 -36
  410. vellum/types/workflow_output_array.py +7 -3
  411. vellum/types/workflow_output_chat_history.py +7 -3
  412. vellum/types/workflow_output_error.py +7 -3
  413. vellum/types/workflow_output_function_call.py +7 -3
  414. vellum/types/workflow_output_image.py +7 -3
  415. vellum/types/workflow_output_json.py +7 -3
  416. vellum/types/workflow_output_number.py +7 -3
  417. vellum/types/workflow_output_search_results.py +7 -3
  418. vellum/types/workflow_output_string.py +7 -3
  419. vellum/types/workflow_release_tag_read.py +7 -3
  420. vellum/types/workflow_release_tag_workflow_deployment_history_item.py +7 -3
  421. vellum/types/workflow_request_chat_history_input_request.py +7 -3
  422. vellum/types/workflow_request_input_request.py +72 -16
  423. vellum/types/workflow_request_json_input_request.py +7 -3
  424. vellum/types/workflow_request_number_input_request.py +7 -3
  425. vellum/types/workflow_request_string_input_request.py +7 -3
  426. vellum/types/workflow_result_event.py +7 -3
  427. vellum/types/workflow_result_event_output_data.py +178 -33
  428. vellum/types/workflow_result_event_output_data_array.py +7 -3
  429. vellum/types/workflow_result_event_output_data_chat_history.py +7 -3
  430. vellum/types/workflow_result_event_output_data_error.py +7 -3
  431. vellum/types/workflow_result_event_output_data_function_call.py +7 -3
  432. vellum/types/workflow_result_event_output_data_json.py +7 -3
  433. vellum/types/workflow_result_event_output_data_number.py +7 -3
  434. vellum/types/workflow_result_event_output_data_search_results.py +7 -3
  435. vellum/types/workflow_result_event_output_data_string.py +7 -3
  436. vellum/types/workflow_stream_event.py +43 -8
  437. {vellum_ai-0.7.2.dist-info → vellum_ai-0.7.5.dist-info}/METADATA +13 -1
  438. vellum_ai-0.7.5.dist-info/RECORD +502 -0
  439. vellum/types/array_enum.py +0 -5
  440. vellum/types/chat_history_enum.py +0 -5
  441. vellum/types/create_enum.py +0 -5
  442. vellum/types/created_enum.py +0 -5
  443. vellum/types/delete_enum.py +0 -5
  444. vellum/types/deleted_enum.py +0 -5
  445. vellum/types/error_enum.py +0 -5
  446. vellum/types/function_call_enum.py +0 -5
  447. vellum/types/hkunlp_instructor_xl_enum.py +0 -5
  448. vellum/types/image_enum.py +0 -5
  449. vellum/types/initiated_enum.py +0 -5
  450. vellum/types/intfloat_multilingual_e_5_large_enum.py +0 -5
  451. vellum/types/json_enum.py +0 -5
  452. vellum/types/merge_enum.py +0 -5
  453. vellum/types/metric_enum.py +0 -5
  454. vellum/types/number_enum.py +0 -5
  455. vellum/types/pdf_enum.py +0 -5
  456. vellum/types/reducto_chunker_enum.py +0 -5
  457. vellum/types/rejected_enum.py +0 -5
  458. vellum/types/replace_enum.py +0 -5
  459. vellum/types/replaced_enum.py +0 -5
  460. vellum/types/search_error_response.py +0 -28
  461. vellum/types/search_results_enum.py +0 -5
  462. vellum/types/sentence_chunker_enum.py +0 -5
  463. vellum/types/sentence_transformers_multi_qa_mpnet_base_cos_v_1_enum.py +0 -5
  464. vellum/types/sentence_transformers_multi_qa_mpnet_base_dot_v_1_enum.py +0 -5
  465. vellum/types/streaming_enum.py +0 -5
  466. vellum/types/string_enum.py +0 -5
  467. vellum/types/submit_completion_actuals_error_response.py +0 -25
  468. vellum/types/subworkflow_enum.py +0 -5
  469. vellum/types/test_suite_run_deployment_release_tag_exec_config_type_enum.py +0 -5
  470. vellum/types/test_suite_run_external_exec_config_type_enum.py +0 -5
  471. vellum/types/test_suite_run_metric_error_output_type_enum.py +0 -5
  472. vellum/types/test_suite_run_metric_number_output_type_enum.py +0 -5
  473. vellum/types/test_suite_run_metric_string_output_type_enum.py +0 -5
  474. vellum/types/test_suite_run_workflow_release_tag_exec_config_type_enum.py +0 -5
  475. vellum/types/text_embedding_3_large_enum.py +0 -5
  476. vellum/types/text_embedding_3_small_enum.py +0 -5
  477. vellum/types/text_embedding_ada_002_enum.py +0 -5
  478. vellum/types/token_overlapping_window_chunker_enum.py +0 -5
  479. vellum/types/upload_document_error_response.py +0 -25
  480. vellum/types/upsert_enum.py +0 -5
  481. vellum_ai-0.7.2.dist-info/RECORD +0 -494
  482. {vellum_ai-0.7.2.dist-info → vellum_ai-0.7.5.dist-info}/LICENSE +0 -0
  483. {vellum_ai-0.7.2.dist-info → vellum_ai-0.7.5.dist-info}/WHEEL +0 -0
@@ -1,7 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- import urllib.parse
5
4
  from json.decoder import JSONDecodeError
6
5
 
7
6
  from ... import core
@@ -9,7 +8,6 @@ from ...core.api_error import ApiError
9
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
10
9
  from ...core.jsonable_encoder import jsonable_encoder
11
10
  from ...core.pydantic_utilities import pydantic_v1
12
- from ...core.remove_none_from_dict import remove_none_from_dict
13
11
  from ...core.request_options import RequestOptions
14
12
  from ...errors.bad_request_error import BadRequestError
15
13
  from ...errors.internal_server_error import InternalServerError
@@ -39,17 +37,30 @@ class DocumentsClient:
39
37
  """
40
38
  Used to list documents. Optionally filter on supported fields.
41
39
 
42
- Parameters:
43
- - document_index_id: typing.Optional[str]. Filter down to only those documents that are included in the specified index. You may provide either the Vellum-generated ID or the unique name of the index specified upon initial creation.
40
+ Parameters
41
+ ----------
42
+ document_index_id : typing.Optional[str]
43
+ Filter down to only those documents that are included in the specified index. You may provide either the Vellum-generated ID or the unique name of the index specified upon initial creation.
44
44
 
45
- - limit: typing.Optional[int]. Number of results to return per page.
45
+ limit : typing.Optional[int]
46
+ Number of results to return per page.
46
47
 
47
- - offset: typing.Optional[int]. The initial index from which to return the results.
48
+ offset : typing.Optional[int]
49
+ The initial index from which to return the results.
48
50
 
49
- - ordering: typing.Optional[str]. Which field to use when ordering the results.
51
+ ordering : typing.Optional[str]
52
+ Which field to use when ordering the results.
50
53
 
51
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
52
- ---
54
+ request_options : typing.Optional[RequestOptions]
55
+ Request-specific configuration.
56
+
57
+ Returns
58
+ -------
59
+ PaginatedSlimDocumentList
60
+
61
+
62
+ Examples
63
+ --------
53
64
  from vellum.client import Vellum
54
65
 
55
66
  client = Vellum(
@@ -58,40 +69,15 @@ class DocumentsClient:
58
69
  client.documents.list()
59
70
  """
60
71
  _response = self._client_wrapper.httpx_client.request(
72
+ "v1/documents",
73
+ base_url=self._client_wrapper.get_environment().default,
61
74
  method="GET",
62
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/documents"),
63
- params=jsonable_encoder(
64
- remove_none_from_dict(
65
- {
66
- "document_index_id": document_index_id,
67
- "limit": limit,
68
- "offset": offset,
69
- "ordering": ordering,
70
- **(
71
- request_options.get("additional_query_parameters", {})
72
- if request_options is not None
73
- else {}
74
- ),
75
- }
76
- )
77
- ),
78
- headers=jsonable_encoder(
79
- remove_none_from_dict(
80
- {
81
- **self._client_wrapper.get_headers(),
82
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
83
- }
84
- )
85
- ),
86
- timeout=request_options.get("timeout_in_seconds")
87
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
88
- else self._client_wrapper.get_timeout(),
89
- retries=0,
90
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
75
+ params={"document_index_id": document_index_id, "limit": limit, "offset": offset, "ordering": ordering},
76
+ request_options=request_options,
91
77
  )
92
- if 200 <= _response.status_code < 300:
93
- return pydantic_v1.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
94
78
  try:
79
+ if 200 <= _response.status_code < 300:
80
+ return pydantic_v1.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
95
81
  _response_json = _response.json()
96
82
  except JSONDecodeError:
97
83
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -101,11 +87,21 @@ class DocumentsClient:
101
87
  """
102
88
  Retrieve a Document, keying off of either its Vellum-generated ID or its external ID.
103
89
 
104
- Parameters:
105
- - id: str. A UUID string identifying this document.
90
+ Parameters
91
+ ----------
92
+ id : str
93
+ A UUID string identifying this document.
94
+
95
+ request_options : typing.Optional[RequestOptions]
96
+ Request-specific configuration.
97
+
98
+ Returns
99
+ -------
100
+ DocumentRead
106
101
 
107
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
108
- ---
102
+
103
+ Examples
104
+ --------
109
105
  from vellum.client import Vellum
110
106
 
111
107
  client = Vellum(
@@ -116,30 +112,14 @@ class DocumentsClient:
116
112
  )
117
113
  """
118
114
  _response = self._client_wrapper.httpx_client.request(
115
+ f"v1/documents/{jsonable_encoder(id)}",
116
+ base_url=self._client_wrapper.get_environment().default,
119
117
  method="GET",
120
- url=urllib.parse.urljoin(
121
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
122
- ),
123
- params=jsonable_encoder(
124
- request_options.get("additional_query_parameters") if request_options is not None else None
125
- ),
126
- headers=jsonable_encoder(
127
- remove_none_from_dict(
128
- {
129
- **self._client_wrapper.get_headers(),
130
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
131
- }
132
- )
133
- ),
134
- timeout=request_options.get("timeout_in_seconds")
135
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
136
- else self._client_wrapper.get_timeout(),
137
- retries=0,
138
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
118
+ request_options=request_options,
139
119
  )
140
- if 200 <= _response.status_code < 300:
141
- return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
142
120
  try:
121
+ if 200 <= _response.status_code < 300:
122
+ return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
143
123
  _response_json = _response.json()
144
124
  except JSONDecodeError:
145
125
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -149,11 +129,20 @@ class DocumentsClient:
149
129
  """
150
130
  Delete a Document, keying off of either its Vellum-generated ID or its external ID.
151
131
 
152
- Parameters:
153
- - id: str. A UUID string identifying this document.
132
+ Parameters
133
+ ----------
134
+ id : str
135
+ A UUID string identifying this document.
136
+
137
+ request_options : typing.Optional[RequestOptions]
138
+ Request-specific configuration.
139
+
140
+ Returns
141
+ -------
142
+ None
154
143
 
155
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
156
- ---
144
+ Examples
145
+ --------
157
146
  from vellum.client import Vellum
158
147
 
159
148
  client = Vellum(
@@ -164,30 +153,14 @@ class DocumentsClient:
164
153
  )
165
154
  """
166
155
  _response = self._client_wrapper.httpx_client.request(
156
+ f"v1/documents/{jsonable_encoder(id)}",
157
+ base_url=self._client_wrapper.get_environment().default,
167
158
  method="DELETE",
168
- url=urllib.parse.urljoin(
169
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
170
- ),
171
- params=jsonable_encoder(
172
- request_options.get("additional_query_parameters") if request_options is not None else None
173
- ),
174
- headers=jsonable_encoder(
175
- remove_none_from_dict(
176
- {
177
- **self._client_wrapper.get_headers(),
178
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
179
- }
180
- )
181
- ),
182
- timeout=request_options.get("timeout_in_seconds")
183
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
184
- else self._client_wrapper.get_timeout(),
185
- retries=0,
186
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
159
+ request_options=request_options,
187
160
  )
188
- if 200 <= _response.status_code < 300:
189
- return
190
161
  try:
162
+ if 200 <= _response.status_code < 300:
163
+ return
191
164
  _response_json = _response.json()
192
165
  except JSONDecodeError:
193
166
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -205,18 +178,32 @@ class DocumentsClient:
205
178
  """
206
179
  Update a Document, keying off of either its Vellum-generated ID or its external ID. Particularly useful for updating its metadata.
207
180
 
208
- Parameters:
209
- - id: str. A UUID string identifying this document.
181
+ Parameters
182
+ ----------
183
+ id : str
184
+ A UUID string identifying this document.
185
+
186
+ label : typing.Optional[str]
187
+ A human-readable label for the document. Defaults to the originally uploaded file's file name.
188
+
189
+ status : typing.Optional[DocumentStatus]
190
+ The current status of the document
210
191
 
211
- - label: typing.Optional[str]. A human-readable label for the document. Defaults to the originally uploaded file's file name.
192
+ * `ACTIVE` - Active
212
193
 
213
- - status: typing.Optional[DocumentStatus]. The current status of the document
194
+ metadata : typing.Optional[typing.Dict[str, typing.Any]]
195
+ A JSON object containing any metadata associated with the document that you'd like to filter upon later.
214
196
 
215
- * `ACTIVE` - Active
216
- - metadata: typing.Optional[typing.Dict[str, typing.Any]]. A JSON object containing any metadata associated with the document that you'd like to filter upon later.
197
+ request_options : typing.Optional[RequestOptions]
198
+ Request-specific configuration.
217
199
 
218
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
219
- ---
200
+ Returns
201
+ -------
202
+ DocumentRead
203
+
204
+
205
+ Examples
206
+ --------
220
207
  from vellum.client import Vellum
221
208
 
222
209
  client = Vellum(
@@ -226,44 +213,17 @@ class DocumentsClient:
226
213
  id="id",
227
214
  )
228
215
  """
229
- _request: typing.Dict[str, typing.Any] = {}
230
- if label is not OMIT:
231
- _request["label"] = label
232
- if status is not OMIT:
233
- _request["status"] = status
234
- if metadata is not OMIT:
235
- _request["metadata"] = metadata
236
216
  _response = self._client_wrapper.httpx_client.request(
217
+ f"v1/documents/{jsonable_encoder(id)}",
218
+ base_url=self._client_wrapper.get_environment().default,
237
219
  method="PATCH",
238
- url=urllib.parse.urljoin(
239
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
240
- ),
241
- params=jsonable_encoder(
242
- request_options.get("additional_query_parameters") if request_options is not None else None
243
- ),
244
- json=jsonable_encoder(_request)
245
- if request_options is None or request_options.get("additional_body_parameters") is None
246
- else {
247
- **jsonable_encoder(_request),
248
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
249
- },
250
- headers=jsonable_encoder(
251
- remove_none_from_dict(
252
- {
253
- **self._client_wrapper.get_headers(),
254
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
255
- }
256
- )
257
- ),
258
- timeout=request_options.get("timeout_in_seconds")
259
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
260
- else self._client_wrapper.get_timeout(),
261
- retries=0,
262
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
220
+ json={"label": label, "status": status, "metadata": metadata},
221
+ request_options=request_options,
222
+ omit=OMIT,
263
223
  )
264
- if 200 <= _response.status_code < 300:
265
- return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
266
224
  try:
225
+ if 200 <= _response.status_code < 300:
226
+ return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
267
227
  _response_json = _response.json()
268
228
  except JSONDecodeError:
269
229
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -272,10 +232,10 @@ class DocumentsClient:
272
232
  def upload(
273
233
  self,
274
234
  *,
275
- add_to_index_names: typing.Optional[typing.List[str]] = None,
276
- external_id: typing.Optional[str] = None,
277
235
  label: str,
278
236
  contents: core.File,
237
+ add_to_index_names: typing.Optional[typing.List[str]] = None,
238
+ external_id: typing.Optional[str] = None,
279
239
  keywords: typing.Optional[typing.List[str]] = None,
280
240
  metadata: typing.Optional[str] = None,
281
241
  request_options: typing.Optional[RequestOptions] = None,
@@ -293,21 +253,36 @@ class DocumentsClient:
293
253
  - `keywords: list[str] | None` - Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
294
254
  - `metadata: dict[str, Any]` - A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
295
255
 
296
- Parameters:
297
- - add_to_index_names: typing.Optional[typing.List[str]]. Optionally include the names of all indexes that you'd like this document to be included in
256
+ Parameters
257
+ ----------
258
+ label : str
259
+ A human-friendly name for this document. Typically the filename.
260
+
261
+ contents : core.File
262
+ See core.File for more documentation
263
+
264
+ add_to_index_names : typing.Optional[typing.List[str]]
265
+ Optionally include the names of all indexes that you'd like this document to be included in
266
+
267
+ external_id : typing.Optional[str]
268
+ Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed.
298
269
 
299
- - external_id: typing.Optional[str]. Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed.
270
+ keywords : typing.Optional[typing.List[str]]
271
+ Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
300
272
 
301
- - label: str. A human-friendly name for this document. Typically the filename.
273
+ metadata : typing.Optional[str]
274
+ A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
302
275
 
303
- - contents: core.File. See core.File for more documentation
276
+ request_options : typing.Optional[RequestOptions]
277
+ Request-specific configuration.
304
278
 
305
- - keywords: typing.Optional[typing.List[str]]. Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
279
+ Returns
280
+ -------
281
+ UploadDocumentResponse
306
282
 
307
- - metadata: typing.Optional[str]. A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
308
283
 
309
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
310
- ---
284
+ Examples
285
+ --------
311
286
  from vellum.client import Vellum
312
287
 
313
288
  client = Vellum(
@@ -318,61 +293,29 @@ class DocumentsClient:
318
293
  )
319
294
  """
320
295
  _response = self._client_wrapper.httpx_client.request(
296
+ "v1/upload-document",
297
+ base_url=self._client_wrapper.get_environment().documents,
321
298
  method="POST",
322
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().documents}/", "v1/upload-document"),
323
- params=jsonable_encoder(
324
- request_options.get("additional_query_parameters") if request_options is not None else None
325
- ),
326
- data=jsonable_encoder(
327
- remove_none_from_dict(
328
- {
329
- "add_to_index_names": add_to_index_names,
330
- "external_id": external_id,
331
- "label": label,
332
- "keywords": keywords,
333
- "metadata": metadata,
334
- }
335
- )
336
- )
337
- if request_options is None or request_options.get("additional_body_parameters") is None
338
- else {
339
- **jsonable_encoder(
340
- remove_none_from_dict(
341
- {
342
- "add_to_index_names": add_to_index_names,
343
- "external_id": external_id,
344
- "label": label,
345
- "keywords": keywords,
346
- "metadata": metadata,
347
- }
348
- )
349
- ),
350
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
299
+ data={
300
+ "add_to_index_names": add_to_index_names,
301
+ "external_id": external_id,
302
+ "label": label,
303
+ "keywords": keywords,
304
+ "metadata": metadata,
351
305
  },
352
- files=core.convert_file_dict_to_httpx_tuples(remove_none_from_dict({"contents": contents})),
353
- headers=jsonable_encoder(
354
- remove_none_from_dict(
355
- {
356
- **self._client_wrapper.get_headers(),
357
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
358
- }
359
- )
360
- ),
361
- timeout=request_options.get("timeout_in_seconds")
362
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
363
- else self._client_wrapper.get_timeout(),
364
- retries=0,
365
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
306
+ files={"contents": contents},
307
+ request_options=request_options,
308
+ omit=OMIT,
366
309
  )
367
- if 200 <= _response.status_code < 300:
368
- return pydantic_v1.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
369
- if _response.status_code == 400:
370
- raise BadRequestError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
371
- if _response.status_code == 404:
372
- raise NotFoundError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
373
- if _response.status_code == 500:
374
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
375
310
  try:
311
+ if 200 <= _response.status_code < 300:
312
+ return pydantic_v1.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
313
+ if _response.status_code == 400:
314
+ raise BadRequestError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
315
+ if _response.status_code == 404:
316
+ raise NotFoundError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
317
+ if _response.status_code == 500:
318
+ raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
376
319
  _response_json = _response.json()
377
320
  except JSONDecodeError:
378
321
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -395,59 +338,55 @@ class AsyncDocumentsClient:
395
338
  """
396
339
  Used to list documents. Optionally filter on supported fields.
397
340
 
398
- Parameters:
399
- - document_index_id: typing.Optional[str]. Filter down to only those documents that are included in the specified index. You may provide either the Vellum-generated ID or the unique name of the index specified upon initial creation.
341
+ Parameters
342
+ ----------
343
+ document_index_id : typing.Optional[str]
344
+ Filter down to only those documents that are included in the specified index. You may provide either the Vellum-generated ID or the unique name of the index specified upon initial creation.
345
+
346
+ limit : typing.Optional[int]
347
+ Number of results to return per page.
348
+
349
+ offset : typing.Optional[int]
350
+ The initial index from which to return the results.
351
+
352
+ ordering : typing.Optional[str]
353
+ Which field to use when ordering the results.
354
+
355
+ request_options : typing.Optional[RequestOptions]
356
+ Request-specific configuration.
400
357
 
401
- - limit: typing.Optional[int]. Number of results to return per page.
358
+ Returns
359
+ -------
360
+ PaginatedSlimDocumentList
402
361
 
403
- - offset: typing.Optional[int]. The initial index from which to return the results.
404
362
 
405
- - ordering: typing.Optional[str]. Which field to use when ordering the results.
363
+ Examples
364
+ --------
365
+ import asyncio
406
366
 
407
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
408
- ---
409
367
  from vellum.client import AsyncVellum
410
368
 
411
369
  client = AsyncVellum(
412
370
  api_key="YOUR_API_KEY",
413
371
  )
414
- await client.documents.list()
372
+
373
+
374
+ async def main() -> None:
375
+ await client.documents.list()
376
+
377
+
378
+ asyncio.run(main())
415
379
  """
416
380
  _response = await self._client_wrapper.httpx_client.request(
381
+ "v1/documents",
382
+ base_url=self._client_wrapper.get_environment().default,
417
383
  method="GET",
418
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/documents"),
419
- params=jsonable_encoder(
420
- remove_none_from_dict(
421
- {
422
- "document_index_id": document_index_id,
423
- "limit": limit,
424
- "offset": offset,
425
- "ordering": ordering,
426
- **(
427
- request_options.get("additional_query_parameters", {})
428
- if request_options is not None
429
- else {}
430
- ),
431
- }
432
- )
433
- ),
434
- headers=jsonable_encoder(
435
- remove_none_from_dict(
436
- {
437
- **self._client_wrapper.get_headers(),
438
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
439
- }
440
- )
441
- ),
442
- timeout=request_options.get("timeout_in_seconds")
443
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
444
- else self._client_wrapper.get_timeout(),
445
- retries=0,
446
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
384
+ params={"document_index_id": document_index_id, "limit": limit, "offset": offset, "ordering": ordering},
385
+ request_options=request_options,
447
386
  )
448
- if 200 <= _response.status_code < 300:
449
- return pydantic_v1.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
450
387
  try:
388
+ if 200 <= _response.status_code < 300:
389
+ return pydantic_v1.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
451
390
  _response_json = _response.json()
452
391
  except JSONDecodeError:
453
392
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -457,45 +396,47 @@ class AsyncDocumentsClient:
457
396
  """
458
397
  Retrieve a Document, keying off of either its Vellum-generated ID or its external ID.
459
398
 
460
- Parameters:
461
- - id: str. A UUID string identifying this document.
399
+ Parameters
400
+ ----------
401
+ id : str
402
+ A UUID string identifying this document.
403
+
404
+ request_options : typing.Optional[RequestOptions]
405
+ Request-specific configuration.
406
+
407
+ Returns
408
+ -------
409
+ DocumentRead
410
+
411
+
412
+ Examples
413
+ --------
414
+ import asyncio
462
415
 
463
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
464
- ---
465
416
  from vellum.client import AsyncVellum
466
417
 
467
418
  client = AsyncVellum(
468
419
  api_key="YOUR_API_KEY",
469
420
  )
470
- await client.documents.retrieve(
471
- id="id",
472
- )
421
+
422
+
423
+ async def main() -> None:
424
+ await client.documents.retrieve(
425
+ id="id",
426
+ )
427
+
428
+
429
+ asyncio.run(main())
473
430
  """
474
431
  _response = await self._client_wrapper.httpx_client.request(
432
+ f"v1/documents/{jsonable_encoder(id)}",
433
+ base_url=self._client_wrapper.get_environment().default,
475
434
  method="GET",
476
- url=urllib.parse.urljoin(
477
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
478
- ),
479
- params=jsonable_encoder(
480
- request_options.get("additional_query_parameters") if request_options is not None else None
481
- ),
482
- headers=jsonable_encoder(
483
- remove_none_from_dict(
484
- {
485
- **self._client_wrapper.get_headers(),
486
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
487
- }
488
- )
489
- ),
490
- timeout=request_options.get("timeout_in_seconds")
491
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
492
- else self._client_wrapper.get_timeout(),
493
- retries=0,
494
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
435
+ request_options=request_options,
495
436
  )
496
- if 200 <= _response.status_code < 300:
497
- return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
498
437
  try:
438
+ if 200 <= _response.status_code < 300:
439
+ return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
499
440
  _response_json = _response.json()
500
441
  except JSONDecodeError:
501
442
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -505,45 +446,46 @@ class AsyncDocumentsClient:
505
446
  """
506
447
  Delete a Document, keying off of either its Vellum-generated ID or its external ID.
507
448
 
508
- Parameters:
509
- - id: str. A UUID string identifying this document.
449
+ Parameters
450
+ ----------
451
+ id : str
452
+ A UUID string identifying this document.
453
+
454
+ request_options : typing.Optional[RequestOptions]
455
+ Request-specific configuration.
456
+
457
+ Returns
458
+ -------
459
+ None
460
+
461
+ Examples
462
+ --------
463
+ import asyncio
510
464
 
511
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
512
- ---
513
465
  from vellum.client import AsyncVellum
514
466
 
515
467
  client = AsyncVellum(
516
468
  api_key="YOUR_API_KEY",
517
469
  )
518
- await client.documents.destroy(
519
- id="id",
520
- )
470
+
471
+
472
+ async def main() -> None:
473
+ await client.documents.destroy(
474
+ id="id",
475
+ )
476
+
477
+
478
+ asyncio.run(main())
521
479
  """
522
480
  _response = await self._client_wrapper.httpx_client.request(
481
+ f"v1/documents/{jsonable_encoder(id)}",
482
+ base_url=self._client_wrapper.get_environment().default,
523
483
  method="DELETE",
524
- url=urllib.parse.urljoin(
525
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
526
- ),
527
- params=jsonable_encoder(
528
- request_options.get("additional_query_parameters") if request_options is not None else None
529
- ),
530
- headers=jsonable_encoder(
531
- remove_none_from_dict(
532
- {
533
- **self._client_wrapper.get_headers(),
534
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
535
- }
536
- )
537
- ),
538
- timeout=request_options.get("timeout_in_seconds")
539
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
540
- else self._client_wrapper.get_timeout(),
541
- retries=0,
542
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
484
+ request_options=request_options,
543
485
  )
544
- if 200 <= _response.status_code < 300:
545
- return
546
486
  try:
487
+ if 200 <= _response.status_code < 300:
488
+ return
547
489
  _response_json = _response.json()
548
490
  except JSONDecodeError:
549
491
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -561,65 +503,60 @@ class AsyncDocumentsClient:
561
503
  """
562
504
  Update a Document, keying off of either its Vellum-generated ID or its external ID. Particularly useful for updating its metadata.
563
505
 
564
- Parameters:
565
- - id: str. A UUID string identifying this document.
506
+ Parameters
507
+ ----------
508
+ id : str
509
+ A UUID string identifying this document.
566
510
 
567
- - label: typing.Optional[str]. A human-readable label for the document. Defaults to the originally uploaded file's file name.
511
+ label : typing.Optional[str]
512
+ A human-readable label for the document. Defaults to the originally uploaded file's file name.
568
513
 
569
- - status: typing.Optional[DocumentStatus]. The current status of the document
514
+ status : typing.Optional[DocumentStatus]
515
+ The current status of the document
570
516
 
571
- * `ACTIVE` - Active
572
- - metadata: typing.Optional[typing.Dict[str, typing.Any]]. A JSON object containing any metadata associated with the document that you'd like to filter upon later.
517
+ * `ACTIVE` - Active
518
+
519
+ metadata : typing.Optional[typing.Dict[str, typing.Any]]
520
+ A JSON object containing any metadata associated with the document that you'd like to filter upon later.
521
+
522
+ request_options : typing.Optional[RequestOptions]
523
+ Request-specific configuration.
524
+
525
+ Returns
526
+ -------
527
+ DocumentRead
528
+
529
+
530
+ Examples
531
+ --------
532
+ import asyncio
573
533
 
574
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
575
- ---
576
534
  from vellum.client import AsyncVellum
577
535
 
578
536
  client = AsyncVellum(
579
537
  api_key="YOUR_API_KEY",
580
538
  )
581
- await client.documents.partial_update(
582
- id="id",
583
- )
539
+
540
+
541
+ async def main() -> None:
542
+ await client.documents.partial_update(
543
+ id="id",
544
+ )
545
+
546
+
547
+ asyncio.run(main())
584
548
  """
585
- _request: typing.Dict[str, typing.Any] = {}
586
- if label is not OMIT:
587
- _request["label"] = label
588
- if status is not OMIT:
589
- _request["status"] = status
590
- if metadata is not OMIT:
591
- _request["metadata"] = metadata
592
549
  _response = await self._client_wrapper.httpx_client.request(
550
+ f"v1/documents/{jsonable_encoder(id)}",
551
+ base_url=self._client_wrapper.get_environment().default,
593
552
  method="PATCH",
594
- url=urllib.parse.urljoin(
595
- f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
596
- ),
597
- params=jsonable_encoder(
598
- request_options.get("additional_query_parameters") if request_options is not None else None
599
- ),
600
- json=jsonable_encoder(_request)
601
- if request_options is None or request_options.get("additional_body_parameters") is None
602
- else {
603
- **jsonable_encoder(_request),
604
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
605
- },
606
- headers=jsonable_encoder(
607
- remove_none_from_dict(
608
- {
609
- **self._client_wrapper.get_headers(),
610
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
611
- }
612
- )
613
- ),
614
- timeout=request_options.get("timeout_in_seconds")
615
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
616
- else self._client_wrapper.get_timeout(),
617
- retries=0,
618
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
553
+ json={"label": label, "status": status, "metadata": metadata},
554
+ request_options=request_options,
555
+ omit=OMIT,
619
556
  )
620
- if 200 <= _response.status_code < 300:
621
- return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
622
557
  try:
558
+ if 200 <= _response.status_code < 300:
559
+ return pydantic_v1.parse_obj_as(DocumentRead, _response.json()) # type: ignore
623
560
  _response_json = _response.json()
624
561
  except JSONDecodeError:
625
562
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -628,10 +565,10 @@ class AsyncDocumentsClient:
628
565
  async def upload(
629
566
  self,
630
567
  *,
631
- add_to_index_names: typing.Optional[typing.List[str]] = None,
632
- external_id: typing.Optional[str] = None,
633
568
  label: str,
634
569
  contents: core.File,
570
+ add_to_index_names: typing.Optional[typing.List[str]] = None,
571
+ external_id: typing.Optional[str] = None,
635
572
  keywords: typing.Optional[typing.List[str]] = None,
636
573
  metadata: typing.Optional[str] = None,
637
574
  request_options: typing.Optional[RequestOptions] = None,
@@ -649,86 +586,77 @@ class AsyncDocumentsClient:
649
586
  - `keywords: list[str] | None` - Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
650
587
  - `metadata: dict[str, Any]` - A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
651
588
 
652
- Parameters:
653
- - add_to_index_names: typing.Optional[typing.List[str]]. Optionally include the names of all indexes that you'd like this document to be included in
589
+ Parameters
590
+ ----------
591
+ label : str
592
+ A human-friendly name for this document. Typically the filename.
593
+
594
+ contents : core.File
595
+ See core.File for more documentation
596
+
597
+ add_to_index_names : typing.Optional[typing.List[str]]
598
+ Optionally include the names of all indexes that you'd like this document to be included in
599
+
600
+ external_id : typing.Optional[str]
601
+ Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed.
654
602
 
655
- - external_id: typing.Optional[str]. Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed.
603
+ keywords : typing.Optional[typing.List[str]]
604
+ Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
656
605
 
657
- - label: str. A human-friendly name for this document. Typically the filename.
606
+ metadata : typing.Optional[str]
607
+ A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
658
608
 
659
- - contents: core.File. See core.File for more documentation
609
+ request_options : typing.Optional[RequestOptions]
610
+ Request-specific configuration.
660
611
 
661
- - keywords: typing.Optional[typing.List[str]]. Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
612
+ Returns
613
+ -------
614
+ UploadDocumentResponse
662
615
 
663
- - metadata: typing.Optional[str]. A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
664
616
 
665
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
666
- ---
617
+ Examples
618
+ --------
619
+ import asyncio
620
+
667
621
  from vellum.client import AsyncVellum
668
622
 
669
623
  client = AsyncVellum(
670
624
  api_key="YOUR_API_KEY",
671
625
  )
672
- await client.documents.upload(
673
- label="label",
674
- )
626
+
627
+
628
+ async def main() -> None:
629
+ await client.documents.upload(
630
+ label="label",
631
+ )
632
+
633
+
634
+ asyncio.run(main())
675
635
  """
676
636
  _response = await self._client_wrapper.httpx_client.request(
637
+ "v1/upload-document",
638
+ base_url=self._client_wrapper.get_environment().documents,
677
639
  method="POST",
678
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().documents}/", "v1/upload-document"),
679
- params=jsonable_encoder(
680
- request_options.get("additional_query_parameters") if request_options is not None else None
681
- ),
682
- data=jsonable_encoder(
683
- remove_none_from_dict(
684
- {
685
- "add_to_index_names": add_to_index_names,
686
- "external_id": external_id,
687
- "label": label,
688
- "keywords": keywords,
689
- "metadata": metadata,
690
- }
691
- )
692
- )
693
- if request_options is None or request_options.get("additional_body_parameters") is None
694
- else {
695
- **jsonable_encoder(
696
- remove_none_from_dict(
697
- {
698
- "add_to_index_names": add_to_index_names,
699
- "external_id": external_id,
700
- "label": label,
701
- "keywords": keywords,
702
- "metadata": metadata,
703
- }
704
- )
705
- ),
706
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
640
+ data={
641
+ "add_to_index_names": add_to_index_names,
642
+ "external_id": external_id,
643
+ "label": label,
644
+ "keywords": keywords,
645
+ "metadata": metadata,
707
646
  },
708
- files=core.convert_file_dict_to_httpx_tuples(remove_none_from_dict({"contents": contents})),
709
- headers=jsonable_encoder(
710
- remove_none_from_dict(
711
- {
712
- **self._client_wrapper.get_headers(),
713
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
714
- }
715
- )
716
- ),
717
- timeout=request_options.get("timeout_in_seconds")
718
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
719
- else self._client_wrapper.get_timeout(),
720
- retries=0,
721
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
647
+ files={"contents": contents},
648
+ request_options=request_options,
649
+ omit=OMIT,
722
650
  )
723
- if 200 <= _response.status_code < 300:
724
- return pydantic_v1.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
725
- if _response.status_code == 400:
726
- raise BadRequestError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
727
- if _response.status_code == 404:
728
- raise NotFoundError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
729
- if _response.status_code == 500:
730
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
731
651
  try:
652
+ if 200 <= _response.status_code < 300:
653
+ return pydantic_v1.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
654
+ if _response.status_code == 400:
655
+ raise BadRequestError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
656
+ if _response.status_code == 404:
657
+ raise NotFoundError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
658
+ if _response.status_code == 500:
659
+ raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
732
660
  _response_json = _response.json()
733
661
  except JSONDecodeError:
734
662
  raise ApiError(status_code=_response.status_code, body=_response.text)