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,14 +1,12 @@
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 ...core.api_error import ApiError
8
7
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
8
  from ...core.jsonable_encoder import jsonable_encoder
10
9
  from ...core.pydantic_utilities import pydantic_v1
11
- from ...core.remove_none_from_dict import remove_none_from_dict
12
10
  from ...core.request_options import RequestOptions
13
11
  from ...types.document_index_indexing_config_request import DocumentIndexIndexingConfigRequest
14
12
  from ...types.document_index_read import DocumentIndexRead
@@ -38,21 +36,36 @@ class DocumentIndexesClient:
38
36
  """
39
37
  Used to retrieve a list of Document Indexes.
40
38
 
41
- Parameters:
42
- - limit: typing.Optional[int]. Number of results to return per page.
39
+ Parameters
40
+ ----------
41
+ limit : typing.Optional[int]
42
+ Number of results to return per page.
43
43
 
44
- - offset: typing.Optional[int]. The initial index from which to return the results.
44
+ offset : typing.Optional[int]
45
+ The initial index from which to return the results.
45
46
 
46
- - ordering: typing.Optional[str]. Which field to use when ordering the results.
47
+ ordering : typing.Optional[str]
48
+ Which field to use when ordering the results.
47
49
 
48
- - search: typing.Optional[str]. Search for document indices by name or label
50
+ search : typing.Optional[str]
51
+ Search for document indices by name or label
49
52
 
50
- - status: typing.Optional[DocumentIndexesListRequestStatus]. Filter down to only document indices that have a status matching the status specified
53
+ status : typing.Optional[DocumentIndexesListRequestStatus]
54
+ Filter down to only document indices that have a status matching the status specified
51
55
 
52
- - `ACTIVE` - Active
53
- - `ARCHIVED` - Archived
54
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
55
- ---
56
+ - `ACTIVE` - Active
57
+ - `ARCHIVED` - Archived
58
+
59
+ request_options : typing.Optional[RequestOptions]
60
+ Request-specific configuration.
61
+
62
+ Returns
63
+ -------
64
+ PaginatedDocumentIndexReadList
65
+
66
+
67
+ Examples
68
+ --------
56
69
  from vellum.client import Vellum
57
70
 
58
71
  client = Vellum(
@@ -61,41 +74,15 @@ class DocumentIndexesClient:
61
74
  client.document_indexes.list()
62
75
  """
63
76
  _response = self._client_wrapper.httpx_client.request(
77
+ "v1/document-indexes",
78
+ base_url=self._client_wrapper.get_environment().default,
64
79
  method="GET",
65
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
66
- params=jsonable_encoder(
67
- remove_none_from_dict(
68
- {
69
- "limit": limit,
70
- "offset": offset,
71
- "ordering": ordering,
72
- "search": search,
73
- "status": status,
74
- **(
75
- request_options.get("additional_query_parameters", {})
76
- if request_options is not None
77
- else {}
78
- ),
79
- }
80
- )
81
- ),
82
- headers=jsonable_encoder(
83
- remove_none_from_dict(
84
- {
85
- **self._client_wrapper.get_headers(),
86
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
87
- }
88
- )
89
- ),
90
- timeout=request_options.get("timeout_in_seconds")
91
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
92
- else self._client_wrapper.get_timeout(),
93
- retries=0,
94
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
80
+ params={"limit": limit, "offset": offset, "ordering": ordering, "search": search, "status": status},
81
+ request_options=request_options,
95
82
  )
96
- if 200 <= _response.status_code < 300:
97
- return pydantic_v1.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
98
83
  try:
84
+ if 200 <= _response.status_code < 300:
85
+ return pydantic_v1.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
99
86
  _response_json = _response.json()
100
87
  except JSONDecodeError:
101
88
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -106,35 +93,51 @@ class DocumentIndexesClient:
106
93
  *,
107
94
  label: str,
108
95
  name: str,
96
+ indexing_config: DocumentIndexIndexingConfigRequest,
109
97
  status: typing.Optional[EntityStatus] = OMIT,
110
98
  environment: typing.Optional[EnvironmentEnum] = OMIT,
111
- indexing_config: DocumentIndexIndexingConfigRequest,
112
99
  copy_documents_from_index_id: typing.Optional[str] = OMIT,
113
100
  request_options: typing.Optional[RequestOptions] = None,
114
101
  ) -> DocumentIndexRead:
115
102
  """
116
103
  Creates a new document index.
117
104
 
118
- Parameters:
119
- - label: str. A human-readable label for the document index
105
+ Parameters
106
+ ----------
107
+ label : str
108
+ A human-readable label for the document index
109
+
110
+ name : str
111
+ A name that uniquely identifies this index within its workspace
112
+
113
+ indexing_config : DocumentIndexIndexingConfigRequest
114
+
115
+ status : typing.Optional[EntityStatus]
116
+ The current status of the document index
117
+
118
+ * `ACTIVE` - Active
119
+ * `ARCHIVED` - Archived
120
120
 
121
- - name: str. A name that uniquely identifies this index within its workspace
121
+ environment : typing.Optional[EnvironmentEnum]
122
+ The environment this document index is used in
122
123
 
123
- - status: typing.Optional[EntityStatus]. The current status of the document index
124
+ * `DEVELOPMENT` - Development
125
+ * `STAGING` - Staging
126
+ * `PRODUCTION` - Production
124
127
 
125
- * `ACTIVE` - Active
126
- * `ARCHIVED` - Archived
127
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
128
+ copy_documents_from_index_id : typing.Optional[str]
129
+ Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
128
130
 
129
- * `DEVELOPMENT` - Development
130
- * `STAGING` - Staging
131
- * `PRODUCTION` - Production
132
- - indexing_config: DocumentIndexIndexingConfigRequest.
131
+ request_options : typing.Optional[RequestOptions]
132
+ Request-specific configuration.
133
133
 
134
- - copy_documents_from_index_id: typing.Optional[str]. Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
134
+ Returns
135
+ -------
136
+ DocumentIndexRead
135
137
 
136
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
137
- ---
138
+
139
+ Examples
140
+ --------
138
141
  from vellum import (
139
142
  DocumentIndexChunkingRequest_ReductoChunker,
140
143
  DocumentIndexIndexingConfigRequest,
@@ -157,42 +160,24 @@ class DocumentIndexesClient:
157
160
  copy_documents_from_index_id="string",
158
161
  )
159
162
  """
160
- _request: typing.Dict[str, typing.Any] = {"label": label, "name": name, "indexing_config": indexing_config}
161
- if status is not OMIT:
162
- _request["status"] = status
163
- if environment is not OMIT:
164
- _request["environment"] = environment
165
- if copy_documents_from_index_id is not OMIT:
166
- _request["copy_documents_from_index_id"] = copy_documents_from_index_id
167
163
  _response = self._client_wrapper.httpx_client.request(
164
+ "v1/document-indexes",
165
+ base_url=self._client_wrapper.get_environment().default,
168
166
  method="POST",
169
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
170
- params=jsonable_encoder(
171
- request_options.get("additional_query_parameters") if request_options is not None else None
172
- ),
173
- json=jsonable_encoder(_request)
174
- if request_options is None or request_options.get("additional_body_parameters") is None
175
- else {
176
- **jsonable_encoder(_request),
177
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
167
+ json={
168
+ "label": label,
169
+ "name": name,
170
+ "status": status,
171
+ "environment": environment,
172
+ "indexing_config": indexing_config,
173
+ "copy_documents_from_index_id": copy_documents_from_index_id,
178
174
  },
179
- headers=jsonable_encoder(
180
- remove_none_from_dict(
181
- {
182
- **self._client_wrapper.get_headers(),
183
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
184
- }
185
- )
186
- ),
187
- timeout=request_options.get("timeout_in_seconds")
188
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
189
- else self._client_wrapper.get_timeout(),
190
- retries=0,
191
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
175
+ request_options=request_options,
176
+ omit=OMIT,
192
177
  )
193
- if 200 <= _response.status_code < 300:
194
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
195
178
  try:
179
+ if 200 <= _response.status_code < 300:
180
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
196
181
  _response_json = _response.json()
197
182
  except JSONDecodeError:
198
183
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -202,11 +187,21 @@ class DocumentIndexesClient:
202
187
  """
203
188
  Used to retrieve a Document Index given its ID or name.
204
189
 
205
- Parameters:
206
- - id: str. Either the Document Index's ID or its unique name
190
+ Parameters
191
+ ----------
192
+ id : str
193
+ Either the Document Index's ID or its unique name
194
+
195
+ request_options : typing.Optional[RequestOptions]
196
+ Request-specific configuration.
197
+
198
+ Returns
199
+ -------
200
+ DocumentIndexRead
201
+
207
202
 
208
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
209
- ---
203
+ Examples
204
+ --------
210
205
  from vellum.client import Vellum
211
206
 
212
207
  client = Vellum(
@@ -217,30 +212,14 @@ class DocumentIndexesClient:
217
212
  )
218
213
  """
219
214
  _response = self._client_wrapper.httpx_client.request(
215
+ f"v1/document-indexes/{jsonable_encoder(id)}",
216
+ base_url=self._client_wrapper.get_environment().default,
220
217
  method="GET",
221
- url=urllib.parse.urljoin(
222
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
223
- ),
224
- params=jsonable_encoder(
225
- request_options.get("additional_query_parameters") if request_options is not None else None
226
- ),
227
- headers=jsonable_encoder(
228
- remove_none_from_dict(
229
- {
230
- **self._client_wrapper.get_headers(),
231
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
232
- }
233
- )
234
- ),
235
- timeout=request_options.get("timeout_in_seconds")
236
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
237
- else self._client_wrapper.get_timeout(),
238
- retries=0,
239
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
218
+ request_options=request_options,
240
219
  )
241
- if 200 <= _response.status_code < 300:
242
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
243
220
  try:
221
+ if 200 <= _response.status_code < 300:
222
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
244
223
  _response_json = _response.json()
245
224
  except JSONDecodeError:
246
225
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -258,22 +237,37 @@ class DocumentIndexesClient:
258
237
  """
259
238
  Used to fully update a Document Index given its ID or name.
260
239
 
261
- Parameters:
262
- - id: str. Either the Document Index's ID or its unique name
240
+ Parameters
241
+ ----------
242
+ id : str
243
+ Either the Document Index's ID or its unique name
244
+
245
+ label : str
246
+ A human-readable label for the document index
247
+
248
+ status : typing.Optional[EntityStatus]
249
+ The current status of the document index
263
250
 
264
- - label: str. A human-readable label for the document index
251
+ * `ACTIVE` - Active
252
+ * `ARCHIVED` - Archived
265
253
 
266
- - status: typing.Optional[EntityStatus]. The current status of the document index
254
+ environment : typing.Optional[EnvironmentEnum]
255
+ The environment this document index is used in
267
256
 
268
- * `ACTIVE` - Active
269
- * `ARCHIVED` - Archived
270
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
257
+ * `DEVELOPMENT` - Development
258
+ * `STAGING` - Staging
259
+ * `PRODUCTION` - Production
271
260
 
272
- * `DEVELOPMENT` - Development
273
- * `STAGING` - Staging
274
- * `PRODUCTION` - Production
275
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
276
- ---
261
+ request_options : typing.Optional[RequestOptions]
262
+ Request-specific configuration.
263
+
264
+ Returns
265
+ -------
266
+ DocumentIndexRead
267
+
268
+
269
+ Examples
270
+ --------
277
271
  from vellum.client import Vellum
278
272
 
279
273
  client = Vellum(
@@ -286,42 +280,17 @@ class DocumentIndexesClient:
286
280
  environment="DEVELOPMENT",
287
281
  )
288
282
  """
289
- _request: typing.Dict[str, typing.Any] = {"label": label}
290
- if status is not OMIT:
291
- _request["status"] = status
292
- if environment is not OMIT:
293
- _request["environment"] = environment
294
283
  _response = self._client_wrapper.httpx_client.request(
284
+ f"v1/document-indexes/{jsonable_encoder(id)}",
285
+ base_url=self._client_wrapper.get_environment().default,
295
286
  method="PUT",
296
- url=urllib.parse.urljoin(
297
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
298
- ),
299
- params=jsonable_encoder(
300
- request_options.get("additional_query_parameters") if request_options is not None else None
301
- ),
302
- json=jsonable_encoder(_request)
303
- if request_options is None or request_options.get("additional_body_parameters") is None
304
- else {
305
- **jsonable_encoder(_request),
306
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
307
- },
308
- headers=jsonable_encoder(
309
- remove_none_from_dict(
310
- {
311
- **self._client_wrapper.get_headers(),
312
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
313
- }
314
- )
315
- ),
316
- timeout=request_options.get("timeout_in_seconds")
317
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
318
- else self._client_wrapper.get_timeout(),
319
- retries=0,
320
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
287
+ json={"label": label, "status": status, "environment": environment},
288
+ request_options=request_options,
289
+ omit=OMIT,
321
290
  )
322
- if 200 <= _response.status_code < 300:
323
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
324
291
  try:
292
+ if 200 <= _response.status_code < 300:
293
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
325
294
  _response_json = _response.json()
326
295
  except JSONDecodeError:
327
296
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -331,11 +300,20 @@ class DocumentIndexesClient:
331
300
  """
332
301
  Used to delete a Document Index given its ID or name.
333
302
 
334
- Parameters:
335
- - id: str. Either the Document Index's ID or its unique name
303
+ Parameters
304
+ ----------
305
+ id : str
306
+ Either the Document Index's ID or its unique name
307
+
308
+ request_options : typing.Optional[RequestOptions]
309
+ Request-specific configuration.
310
+
311
+ Returns
312
+ -------
313
+ None
336
314
 
337
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
338
- ---
315
+ Examples
316
+ --------
339
317
  from vellum.client import Vellum
340
318
 
341
319
  client = Vellum(
@@ -346,30 +324,14 @@ class DocumentIndexesClient:
346
324
  )
347
325
  """
348
326
  _response = self._client_wrapper.httpx_client.request(
327
+ f"v1/document-indexes/{jsonable_encoder(id)}",
328
+ base_url=self._client_wrapper.get_environment().default,
349
329
  method="DELETE",
350
- url=urllib.parse.urljoin(
351
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
352
- ),
353
- params=jsonable_encoder(
354
- request_options.get("additional_query_parameters") if request_options is not None else None
355
- ),
356
- headers=jsonable_encoder(
357
- remove_none_from_dict(
358
- {
359
- **self._client_wrapper.get_headers(),
360
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
361
- }
362
- )
363
- ),
364
- timeout=request_options.get("timeout_in_seconds")
365
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
366
- else self._client_wrapper.get_timeout(),
367
- retries=0,
368
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
330
+ request_options=request_options,
369
331
  )
370
- if 200 <= _response.status_code < 300:
371
- return
372
332
  try:
333
+ if 200 <= _response.status_code < 300:
334
+ return
373
335
  _response_json = _response.json()
374
336
  except JSONDecodeError:
375
337
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -387,22 +349,37 @@ class DocumentIndexesClient:
387
349
  """
388
350
  Used to partial update a Document Index given its ID or name.
389
351
 
390
- Parameters:
391
- - id: str. Either the Document Index's ID or its unique name
352
+ Parameters
353
+ ----------
354
+ id : str
355
+ Either the Document Index's ID or its unique name
356
+
357
+ label : typing.Optional[str]
358
+ A human-readable label for the document index
359
+
360
+ status : typing.Optional[EntityStatus]
361
+ The current status of the document index
362
+
363
+ * `ACTIVE` - Active
364
+ * `ARCHIVED` - Archived
365
+
366
+ environment : typing.Optional[EnvironmentEnum]
367
+ The environment this document index is used in
368
+
369
+ * `DEVELOPMENT` - Development
370
+ * `STAGING` - Staging
371
+ * `PRODUCTION` - Production
392
372
 
393
- - label: typing.Optional[str]. A human-readable label for the document index
373
+ request_options : typing.Optional[RequestOptions]
374
+ Request-specific configuration.
394
375
 
395
- - status: typing.Optional[EntityStatus]. The current status of the document index
376
+ Returns
377
+ -------
378
+ DocumentIndexRead
396
379
 
397
- * `ACTIVE` - Active
398
- * `ARCHIVED` - Archived
399
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
400
380
 
401
- * `DEVELOPMENT` - Development
402
- * `STAGING` - Staging
403
- * `PRODUCTION` - Production
404
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
405
- ---
381
+ Examples
382
+ --------
406
383
  from vellum.client import Vellum
407
384
 
408
385
  client = Vellum(
@@ -415,44 +392,17 @@ class DocumentIndexesClient:
415
392
  environment="DEVELOPMENT",
416
393
  )
417
394
  """
418
- _request: typing.Dict[str, typing.Any] = {}
419
- if label is not OMIT:
420
- _request["label"] = label
421
- if status is not OMIT:
422
- _request["status"] = status
423
- if environment is not OMIT:
424
- _request["environment"] = environment
425
395
  _response = self._client_wrapper.httpx_client.request(
396
+ f"v1/document-indexes/{jsonable_encoder(id)}",
397
+ base_url=self._client_wrapper.get_environment().default,
426
398
  method="PATCH",
427
- url=urllib.parse.urljoin(
428
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
429
- ),
430
- params=jsonable_encoder(
431
- request_options.get("additional_query_parameters") if request_options is not None else None
432
- ),
433
- json=jsonable_encoder(_request)
434
- if request_options is None or request_options.get("additional_body_parameters") is None
435
- else {
436
- **jsonable_encoder(_request),
437
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
438
- },
439
- headers=jsonable_encoder(
440
- remove_none_from_dict(
441
- {
442
- **self._client_wrapper.get_headers(),
443
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
444
- }
445
- )
446
- ),
447
- timeout=request_options.get("timeout_in_seconds")
448
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
449
- else self._client_wrapper.get_timeout(),
450
- retries=0,
451
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
399
+ json={"label": label, "status": status, "environment": environment},
400
+ request_options=request_options,
401
+ omit=OMIT,
452
402
  )
453
- if 200 <= _response.status_code < 300:
454
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
455
403
  try:
404
+ if 200 <= _response.status_code < 300:
405
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
456
406
  _response_json = _response.json()
457
407
  except JSONDecodeError:
458
408
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -464,13 +414,23 @@ class DocumentIndexesClient:
464
414
  """
465
415
  Adds a previously uploaded Document to the specified Document Index.
466
416
 
467
- Parameters:
468
- - document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
417
+ Parameters
418
+ ----------
419
+ document_id : str
420
+ Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
421
+
422
+ id : str
423
+ Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
469
424
 
470
- - id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
425
+ request_options : typing.Optional[RequestOptions]
426
+ Request-specific configuration.
471
427
 
472
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
473
- ---
428
+ Returns
429
+ -------
430
+ None
431
+
432
+ Examples
433
+ --------
474
434
  from vellum.client import Vellum
475
435
 
476
436
  client = Vellum(
@@ -482,34 +442,14 @@ class DocumentIndexesClient:
482
442
  )
483
443
  """
484
444
  _response = self._client_wrapper.httpx_client.request(
445
+ f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
446
+ base_url=self._client_wrapper.get_environment().default,
485
447
  method="POST",
486
- url=urllib.parse.urljoin(
487
- f"{self._client_wrapper.get_environment().default}/",
488
- f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
489
- ),
490
- params=jsonable_encoder(
491
- request_options.get("additional_query_parameters") if request_options is not None else None
492
- ),
493
- json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))
494
- if request_options is not None
495
- else None,
496
- headers=jsonable_encoder(
497
- remove_none_from_dict(
498
- {
499
- **self._client_wrapper.get_headers(),
500
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
501
- }
502
- )
503
- ),
504
- timeout=request_options.get("timeout_in_seconds")
505
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
506
- else self._client_wrapper.get_timeout(),
507
- retries=0,
508
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
448
+ request_options=request_options,
509
449
  )
510
- if 200 <= _response.status_code < 300:
511
- return
512
450
  try:
451
+ if 200 <= _response.status_code < 300:
452
+ return
513
453
  _response_json = _response.json()
514
454
  except JSONDecodeError:
515
455
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -521,13 +461,23 @@ class DocumentIndexesClient:
521
461
  """
522
462
  Removes a Document from a Document Index without deleting the Document itself.
523
463
 
524
- Parameters:
525
- - document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
464
+ Parameters
465
+ ----------
466
+ document_id : str
467
+ Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
468
+
469
+ id : str
470
+ Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
471
+
472
+ request_options : typing.Optional[RequestOptions]
473
+ Request-specific configuration.
526
474
 
527
- - id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
475
+ Returns
476
+ -------
477
+ None
528
478
 
529
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
530
- ---
479
+ Examples
480
+ --------
531
481
  from vellum.client import Vellum
532
482
 
533
483
  client = Vellum(
@@ -539,31 +489,14 @@ class DocumentIndexesClient:
539
489
  )
540
490
  """
541
491
  _response = self._client_wrapper.httpx_client.request(
492
+ f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
493
+ base_url=self._client_wrapper.get_environment().default,
542
494
  method="DELETE",
543
- url=urllib.parse.urljoin(
544
- f"{self._client_wrapper.get_environment().default}/",
545
- f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
546
- ),
547
- params=jsonable_encoder(
548
- request_options.get("additional_query_parameters") if request_options is not None else None
549
- ),
550
- headers=jsonable_encoder(
551
- remove_none_from_dict(
552
- {
553
- **self._client_wrapper.get_headers(),
554
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
555
- }
556
- )
557
- ),
558
- timeout=request_options.get("timeout_in_seconds")
559
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
560
- else self._client_wrapper.get_timeout(),
561
- retries=0,
562
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
495
+ request_options=request_options,
563
496
  )
564
- if 200 <= _response.status_code < 300:
565
- return
566
497
  try:
498
+ if 200 <= _response.status_code < 300:
499
+ return
567
500
  _response_json = _response.json()
568
501
  except JSONDecodeError:
569
502
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -587,64 +520,61 @@ class AsyncDocumentIndexesClient:
587
520
  """
588
521
  Used to retrieve a list of Document Indexes.
589
522
 
590
- Parameters:
591
- - limit: typing.Optional[int]. Number of results to return per page.
523
+ Parameters
524
+ ----------
525
+ limit : typing.Optional[int]
526
+ Number of results to return per page.
527
+
528
+ offset : typing.Optional[int]
529
+ The initial index from which to return the results.
530
+
531
+ ordering : typing.Optional[str]
532
+ Which field to use when ordering the results.
592
533
 
593
- - offset: typing.Optional[int]. The initial index from which to return the results.
534
+ search : typing.Optional[str]
535
+ Search for document indices by name or label
594
536
 
595
- - ordering: typing.Optional[str]. Which field to use when ordering the results.
537
+ status : typing.Optional[DocumentIndexesListRequestStatus]
538
+ Filter down to only document indices that have a status matching the status specified
596
539
 
597
- - search: typing.Optional[str]. Search for document indices by name or label
540
+ - `ACTIVE` - Active
541
+ - `ARCHIVED` - Archived
598
542
 
599
- - status: typing.Optional[DocumentIndexesListRequestStatus]. Filter down to only document indices that have a status matching the status specified
543
+ request_options : typing.Optional[RequestOptions]
544
+ Request-specific configuration.
545
+
546
+ Returns
547
+ -------
548
+ PaginatedDocumentIndexReadList
549
+
550
+
551
+ Examples
552
+ --------
553
+ import asyncio
600
554
 
601
- - `ACTIVE` - Active
602
- - `ARCHIVED` - Archived
603
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
604
- ---
605
555
  from vellum.client import AsyncVellum
606
556
 
607
557
  client = AsyncVellum(
608
558
  api_key="YOUR_API_KEY",
609
559
  )
610
- await client.document_indexes.list()
560
+
561
+
562
+ async def main() -> None:
563
+ await client.document_indexes.list()
564
+
565
+
566
+ asyncio.run(main())
611
567
  """
612
568
  _response = await self._client_wrapper.httpx_client.request(
569
+ "v1/document-indexes",
570
+ base_url=self._client_wrapper.get_environment().default,
613
571
  method="GET",
614
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
615
- params=jsonable_encoder(
616
- remove_none_from_dict(
617
- {
618
- "limit": limit,
619
- "offset": offset,
620
- "ordering": ordering,
621
- "search": search,
622
- "status": status,
623
- **(
624
- request_options.get("additional_query_parameters", {})
625
- if request_options is not None
626
- else {}
627
- ),
628
- }
629
- )
630
- ),
631
- headers=jsonable_encoder(
632
- remove_none_from_dict(
633
- {
634
- **self._client_wrapper.get_headers(),
635
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
636
- }
637
- )
638
- ),
639
- timeout=request_options.get("timeout_in_seconds")
640
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
641
- else self._client_wrapper.get_timeout(),
642
- retries=0,
643
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
572
+ params={"limit": limit, "offset": offset, "ordering": ordering, "search": search, "status": status},
573
+ request_options=request_options,
644
574
  )
645
- if 200 <= _response.status_code < 300:
646
- return pydantic_v1.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
647
575
  try:
576
+ if 200 <= _response.status_code < 300:
577
+ return pydantic_v1.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
648
578
  _response_json = _response.json()
649
579
  except JSONDecodeError:
650
580
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -655,35 +585,53 @@ class AsyncDocumentIndexesClient:
655
585
  *,
656
586
  label: str,
657
587
  name: str,
588
+ indexing_config: DocumentIndexIndexingConfigRequest,
658
589
  status: typing.Optional[EntityStatus] = OMIT,
659
590
  environment: typing.Optional[EnvironmentEnum] = OMIT,
660
- indexing_config: DocumentIndexIndexingConfigRequest,
661
591
  copy_documents_from_index_id: typing.Optional[str] = OMIT,
662
592
  request_options: typing.Optional[RequestOptions] = None,
663
593
  ) -> DocumentIndexRead:
664
594
  """
665
595
  Creates a new document index.
666
596
 
667
- Parameters:
668
- - label: str. A human-readable label for the document index
597
+ Parameters
598
+ ----------
599
+ label : str
600
+ A human-readable label for the document index
669
601
 
670
- - name: str. A name that uniquely identifies this index within its workspace
602
+ name : str
603
+ A name that uniquely identifies this index within its workspace
671
604
 
672
- - status: typing.Optional[EntityStatus]. The current status of the document index
605
+ indexing_config : DocumentIndexIndexingConfigRequest
673
606
 
674
- * `ACTIVE` - Active
675
- * `ARCHIVED` - Archived
676
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
607
+ status : typing.Optional[EntityStatus]
608
+ The current status of the document index
677
609
 
678
- * `DEVELOPMENT` - Development
679
- * `STAGING` - Staging
680
- * `PRODUCTION` - Production
681
- - indexing_config: DocumentIndexIndexingConfigRequest.
610
+ * `ACTIVE` - Active
611
+ * `ARCHIVED` - Archived
682
612
 
683
- - copy_documents_from_index_id: typing.Optional[str]. Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
613
+ environment : typing.Optional[EnvironmentEnum]
614
+ The environment this document index is used in
615
+
616
+ * `DEVELOPMENT` - Development
617
+ * `STAGING` - Staging
618
+ * `PRODUCTION` - Production
619
+
620
+ copy_documents_from_index_id : typing.Optional[str]
621
+ Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
622
+
623
+ request_options : typing.Optional[RequestOptions]
624
+ Request-specific configuration.
625
+
626
+ Returns
627
+ -------
628
+ DocumentIndexRead
629
+
630
+
631
+ Examples
632
+ --------
633
+ import asyncio
684
634
 
685
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
686
- ---
687
635
  from vellum import (
688
636
  DocumentIndexChunkingRequest_ReductoChunker,
689
637
  DocumentIndexIndexingConfigRequest,
@@ -694,54 +642,42 @@ class AsyncDocumentIndexesClient:
694
642
  client = AsyncVellum(
695
643
  api_key="YOUR_API_KEY",
696
644
  )
697
- await client.document_indexes.create(
698
- label="string",
699
- name="string",
700
- status="ACTIVE",
701
- environment="DEVELOPMENT",
702
- indexing_config=DocumentIndexIndexingConfigRequest(
703
- vectorizer=IndexingConfigVectorizerRequest_TextEmbedding3Small(),
704
- chunking=DocumentIndexChunkingRequest_ReductoChunker(),
705
- ),
706
- copy_documents_from_index_id="string",
707
- )
645
+
646
+
647
+ async def main() -> None:
648
+ await client.document_indexes.create(
649
+ label="string",
650
+ name="string",
651
+ status="ACTIVE",
652
+ environment="DEVELOPMENT",
653
+ indexing_config=DocumentIndexIndexingConfigRequest(
654
+ vectorizer=IndexingConfigVectorizerRequest_TextEmbedding3Small(),
655
+ chunking=DocumentIndexChunkingRequest_ReductoChunker(),
656
+ ),
657
+ copy_documents_from_index_id="string",
658
+ )
659
+
660
+
661
+ asyncio.run(main())
708
662
  """
709
- _request: typing.Dict[str, typing.Any] = {"label": label, "name": name, "indexing_config": indexing_config}
710
- if status is not OMIT:
711
- _request["status"] = status
712
- if environment is not OMIT:
713
- _request["environment"] = environment
714
- if copy_documents_from_index_id is not OMIT:
715
- _request["copy_documents_from_index_id"] = copy_documents_from_index_id
716
663
  _response = await self._client_wrapper.httpx_client.request(
664
+ "v1/document-indexes",
665
+ base_url=self._client_wrapper.get_environment().default,
717
666
  method="POST",
718
- url=urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
719
- params=jsonable_encoder(
720
- request_options.get("additional_query_parameters") if request_options is not None else None
721
- ),
722
- json=jsonable_encoder(_request)
723
- if request_options is None or request_options.get("additional_body_parameters") is None
724
- else {
725
- **jsonable_encoder(_request),
726
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
667
+ json={
668
+ "label": label,
669
+ "name": name,
670
+ "status": status,
671
+ "environment": environment,
672
+ "indexing_config": indexing_config,
673
+ "copy_documents_from_index_id": copy_documents_from_index_id,
727
674
  },
728
- headers=jsonable_encoder(
729
- remove_none_from_dict(
730
- {
731
- **self._client_wrapper.get_headers(),
732
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
733
- }
734
- )
735
- ),
736
- timeout=request_options.get("timeout_in_seconds")
737
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
738
- else self._client_wrapper.get_timeout(),
739
- retries=0,
740
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
675
+ request_options=request_options,
676
+ omit=OMIT,
741
677
  )
742
- if 200 <= _response.status_code < 300:
743
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
744
678
  try:
679
+ if 200 <= _response.status_code < 300:
680
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
745
681
  _response_json = _response.json()
746
682
  except JSONDecodeError:
747
683
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -751,45 +687,47 @@ class AsyncDocumentIndexesClient:
751
687
  """
752
688
  Used to retrieve a Document Index given its ID or name.
753
689
 
754
- Parameters:
755
- - id: str. Either the Document Index's ID or its unique name
690
+ Parameters
691
+ ----------
692
+ id : str
693
+ Either the Document Index's ID or its unique name
694
+
695
+ request_options : typing.Optional[RequestOptions]
696
+ Request-specific configuration.
697
+
698
+ Returns
699
+ -------
700
+ DocumentIndexRead
701
+
702
+
703
+ Examples
704
+ --------
705
+ import asyncio
756
706
 
757
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
758
- ---
759
707
  from vellum.client import AsyncVellum
760
708
 
761
709
  client = AsyncVellum(
762
710
  api_key="YOUR_API_KEY",
763
711
  )
764
- await client.document_indexes.retrieve(
765
- id="string",
766
- )
712
+
713
+
714
+ async def main() -> None:
715
+ await client.document_indexes.retrieve(
716
+ id="string",
717
+ )
718
+
719
+
720
+ asyncio.run(main())
767
721
  """
768
722
  _response = await self._client_wrapper.httpx_client.request(
723
+ f"v1/document-indexes/{jsonable_encoder(id)}",
724
+ base_url=self._client_wrapper.get_environment().default,
769
725
  method="GET",
770
- url=urllib.parse.urljoin(
771
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
772
- ),
773
- params=jsonable_encoder(
774
- request_options.get("additional_query_parameters") if request_options is not None else None
775
- ),
776
- headers=jsonable_encoder(
777
- remove_none_from_dict(
778
- {
779
- **self._client_wrapper.get_headers(),
780
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
781
- }
782
- )
783
- ),
784
- timeout=request_options.get("timeout_in_seconds")
785
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
786
- else self._client_wrapper.get_timeout(),
787
- retries=0,
788
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
726
+ request_options=request_options,
789
727
  )
790
- if 200 <= _response.status_code < 300:
791
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
792
728
  try:
729
+ if 200 <= _response.status_code < 300:
730
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
793
731
  _response_json = _response.json()
794
732
  except JSONDecodeError:
795
733
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -807,70 +745,68 @@ class AsyncDocumentIndexesClient:
807
745
  """
808
746
  Used to fully update a Document Index given its ID or name.
809
747
 
810
- Parameters:
811
- - id: str. Either the Document Index's ID or its unique name
748
+ Parameters
749
+ ----------
750
+ id : str
751
+ Either the Document Index's ID or its unique name
752
+
753
+ label : str
754
+ A human-readable label for the document index
755
+
756
+ status : typing.Optional[EntityStatus]
757
+ The current status of the document index
758
+
759
+ * `ACTIVE` - Active
760
+ * `ARCHIVED` - Archived
761
+
762
+ environment : typing.Optional[EnvironmentEnum]
763
+ The environment this document index is used in
764
+
765
+ * `DEVELOPMENT` - Development
766
+ * `STAGING` - Staging
767
+ * `PRODUCTION` - Production
812
768
 
813
- - label: str. A human-readable label for the document index
769
+ request_options : typing.Optional[RequestOptions]
770
+ Request-specific configuration.
814
771
 
815
- - status: typing.Optional[EntityStatus]. The current status of the document index
772
+ Returns
773
+ -------
774
+ DocumentIndexRead
816
775
 
817
- * `ACTIVE` - Active
818
- * `ARCHIVED` - Archived
819
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
820
776
 
821
- * `DEVELOPMENT` - Development
822
- * `STAGING` - Staging
823
- * `PRODUCTION` - Production
824
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
825
- ---
777
+ Examples
778
+ --------
779
+ import asyncio
780
+
826
781
  from vellum.client import AsyncVellum
827
782
 
828
783
  client = AsyncVellum(
829
784
  api_key="YOUR_API_KEY",
830
785
  )
831
- await client.document_indexes.update(
832
- id="string",
833
- label="string",
834
- status="ACTIVE",
835
- environment="DEVELOPMENT",
836
- )
786
+
787
+
788
+ async def main() -> None:
789
+ await client.document_indexes.update(
790
+ id="string",
791
+ label="string",
792
+ status="ACTIVE",
793
+ environment="DEVELOPMENT",
794
+ )
795
+
796
+
797
+ asyncio.run(main())
837
798
  """
838
- _request: typing.Dict[str, typing.Any] = {"label": label}
839
- if status is not OMIT:
840
- _request["status"] = status
841
- if environment is not OMIT:
842
- _request["environment"] = environment
843
799
  _response = await self._client_wrapper.httpx_client.request(
800
+ f"v1/document-indexes/{jsonable_encoder(id)}",
801
+ base_url=self._client_wrapper.get_environment().default,
844
802
  method="PUT",
845
- url=urllib.parse.urljoin(
846
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
847
- ),
848
- params=jsonable_encoder(
849
- request_options.get("additional_query_parameters") if request_options is not None else None
850
- ),
851
- json=jsonable_encoder(_request)
852
- if request_options is None or request_options.get("additional_body_parameters") is None
853
- else {
854
- **jsonable_encoder(_request),
855
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
856
- },
857
- headers=jsonable_encoder(
858
- remove_none_from_dict(
859
- {
860
- **self._client_wrapper.get_headers(),
861
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
862
- }
863
- )
864
- ),
865
- timeout=request_options.get("timeout_in_seconds")
866
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
867
- else self._client_wrapper.get_timeout(),
868
- retries=0,
869
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
803
+ json={"label": label, "status": status, "environment": environment},
804
+ request_options=request_options,
805
+ omit=OMIT,
870
806
  )
871
- if 200 <= _response.status_code < 300:
872
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
873
807
  try:
808
+ if 200 <= _response.status_code < 300:
809
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
874
810
  _response_json = _response.json()
875
811
  except JSONDecodeError:
876
812
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -880,45 +816,46 @@ class AsyncDocumentIndexesClient:
880
816
  """
881
817
  Used to delete a Document Index given its ID or name.
882
818
 
883
- Parameters:
884
- - id: str. Either the Document Index's ID or its unique name
819
+ Parameters
820
+ ----------
821
+ id : str
822
+ Either the Document Index's ID or its unique name
823
+
824
+ request_options : typing.Optional[RequestOptions]
825
+ Request-specific configuration.
826
+
827
+ Returns
828
+ -------
829
+ None
830
+
831
+ Examples
832
+ --------
833
+ import asyncio
885
834
 
886
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
887
- ---
888
835
  from vellum.client import AsyncVellum
889
836
 
890
837
  client = AsyncVellum(
891
838
  api_key="YOUR_API_KEY",
892
839
  )
893
- await client.document_indexes.destroy(
894
- id="id",
895
- )
840
+
841
+
842
+ async def main() -> None:
843
+ await client.document_indexes.destroy(
844
+ id="id",
845
+ )
846
+
847
+
848
+ asyncio.run(main())
896
849
  """
897
850
  _response = await self._client_wrapper.httpx_client.request(
851
+ f"v1/document-indexes/{jsonable_encoder(id)}",
852
+ base_url=self._client_wrapper.get_environment().default,
898
853
  method="DELETE",
899
- url=urllib.parse.urljoin(
900
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
901
- ),
902
- params=jsonable_encoder(
903
- request_options.get("additional_query_parameters") if request_options is not None else None
904
- ),
905
- headers=jsonable_encoder(
906
- remove_none_from_dict(
907
- {
908
- **self._client_wrapper.get_headers(),
909
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
910
- }
911
- )
912
- ),
913
- timeout=request_options.get("timeout_in_seconds")
914
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
915
- else self._client_wrapper.get_timeout(),
916
- retries=0,
917
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
854
+ request_options=request_options,
918
855
  )
919
- if 200 <= _response.status_code < 300:
920
- return
921
856
  try:
857
+ if 200 <= _response.status_code < 300:
858
+ return
922
859
  _response_json = _response.json()
923
860
  except JSONDecodeError:
924
861
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -936,72 +873,68 @@ class AsyncDocumentIndexesClient:
936
873
  """
937
874
  Used to partial update a Document Index given its ID or name.
938
875
 
939
- Parameters:
940
- - id: str. Either the Document Index's ID or its unique name
876
+ Parameters
877
+ ----------
878
+ id : str
879
+ Either the Document Index's ID or its unique name
880
+
881
+ label : typing.Optional[str]
882
+ A human-readable label for the document index
941
883
 
942
- - label: typing.Optional[str]. A human-readable label for the document index
884
+ status : typing.Optional[EntityStatus]
885
+ The current status of the document index
943
886
 
944
- - status: typing.Optional[EntityStatus]. The current status of the document index
887
+ * `ACTIVE` - Active
888
+ * `ARCHIVED` - Archived
945
889
 
946
- * `ACTIVE` - Active
947
- * `ARCHIVED` - Archived
948
- - environment: typing.Optional[EnvironmentEnum]. The environment this document index is used in
890
+ environment : typing.Optional[EnvironmentEnum]
891
+ The environment this document index is used in
892
+
893
+ * `DEVELOPMENT` - Development
894
+ * `STAGING` - Staging
895
+ * `PRODUCTION` - Production
896
+
897
+ request_options : typing.Optional[RequestOptions]
898
+ Request-specific configuration.
899
+
900
+ Returns
901
+ -------
902
+ DocumentIndexRead
903
+
904
+
905
+ Examples
906
+ --------
907
+ import asyncio
949
908
 
950
- * `DEVELOPMENT` - Development
951
- * `STAGING` - Staging
952
- * `PRODUCTION` - Production
953
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
954
- ---
955
909
  from vellum.client import AsyncVellum
956
910
 
957
911
  client = AsyncVellum(
958
912
  api_key="YOUR_API_KEY",
959
913
  )
960
- await client.document_indexes.partial_update(
961
- id="string",
962
- label="string",
963
- status="ACTIVE",
964
- environment="DEVELOPMENT",
965
- )
914
+
915
+
916
+ async def main() -> None:
917
+ await client.document_indexes.partial_update(
918
+ id="string",
919
+ label="string",
920
+ status="ACTIVE",
921
+ environment="DEVELOPMENT",
922
+ )
923
+
924
+
925
+ asyncio.run(main())
966
926
  """
967
- _request: typing.Dict[str, typing.Any] = {}
968
- if label is not OMIT:
969
- _request["label"] = label
970
- if status is not OMIT:
971
- _request["status"] = status
972
- if environment is not OMIT:
973
- _request["environment"] = environment
974
927
  _response = await self._client_wrapper.httpx_client.request(
928
+ f"v1/document-indexes/{jsonable_encoder(id)}",
929
+ base_url=self._client_wrapper.get_environment().default,
975
930
  method="PATCH",
976
- url=urllib.parse.urljoin(
977
- f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
978
- ),
979
- params=jsonable_encoder(
980
- request_options.get("additional_query_parameters") if request_options is not None else None
981
- ),
982
- json=jsonable_encoder(_request)
983
- if request_options is None or request_options.get("additional_body_parameters") is None
984
- else {
985
- **jsonable_encoder(_request),
986
- **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
987
- },
988
- headers=jsonable_encoder(
989
- remove_none_from_dict(
990
- {
991
- **self._client_wrapper.get_headers(),
992
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
993
- }
994
- )
995
- ),
996
- timeout=request_options.get("timeout_in_seconds")
997
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
998
- else self._client_wrapper.get_timeout(),
999
- retries=0,
1000
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
931
+ json={"label": label, "status": status, "environment": environment},
932
+ request_options=request_options,
933
+ omit=OMIT,
1001
934
  )
1002
- if 200 <= _response.status_code < 300:
1003
- return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
1004
935
  try:
936
+ if 200 <= _response.status_code < 300:
937
+ return pydantic_v1.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
1005
938
  _response_json = _response.json()
1006
939
  except JSONDecodeError:
1007
940
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -1013,52 +946,50 @@ class AsyncDocumentIndexesClient:
1013
946
  """
1014
947
  Adds a previously uploaded Document to the specified Document Index.
1015
948
 
1016
- Parameters:
1017
- - document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
949
+ Parameters
950
+ ----------
951
+ document_id : str
952
+ Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
953
+
954
+ id : str
955
+ Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
956
+
957
+ request_options : typing.Optional[RequestOptions]
958
+ Request-specific configuration.
1018
959
 
1019
- - id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
960
+ Returns
961
+ -------
962
+ None
963
+
964
+ Examples
965
+ --------
966
+ import asyncio
1020
967
 
1021
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
1022
- ---
1023
968
  from vellum.client import AsyncVellum
1024
969
 
1025
970
  client = AsyncVellum(
1026
971
  api_key="YOUR_API_KEY",
1027
972
  )
1028
- await client.document_indexes.add_document(
1029
- document_id="document_id",
1030
- id="id",
1031
- )
973
+
974
+
975
+ async def main() -> None:
976
+ await client.document_indexes.add_document(
977
+ document_id="document_id",
978
+ id="id",
979
+ )
980
+
981
+
982
+ asyncio.run(main())
1032
983
  """
1033
984
  _response = await self._client_wrapper.httpx_client.request(
985
+ f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
986
+ base_url=self._client_wrapper.get_environment().default,
1034
987
  method="POST",
1035
- url=urllib.parse.urljoin(
1036
- f"{self._client_wrapper.get_environment().default}/",
1037
- f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
1038
- ),
1039
- params=jsonable_encoder(
1040
- request_options.get("additional_query_parameters") if request_options is not None else None
1041
- ),
1042
- json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))
1043
- if request_options is not None
1044
- else None,
1045
- headers=jsonable_encoder(
1046
- remove_none_from_dict(
1047
- {
1048
- **self._client_wrapper.get_headers(),
1049
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
1050
- }
1051
- )
1052
- ),
1053
- timeout=request_options.get("timeout_in_seconds")
1054
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
1055
- else self._client_wrapper.get_timeout(),
1056
- retries=0,
1057
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
988
+ request_options=request_options,
1058
989
  )
1059
- if 200 <= _response.status_code < 300:
1060
- return
1061
990
  try:
991
+ if 200 <= _response.status_code < 300:
992
+ return
1062
993
  _response_json = _response.json()
1063
994
  except JSONDecodeError:
1064
995
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -1070,49 +1001,50 @@ class AsyncDocumentIndexesClient:
1070
1001
  """
1071
1002
  Removes a Document from a Document Index without deleting the Document itself.
1072
1003
 
1073
- Parameters:
1074
- - document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
1004
+ Parameters
1005
+ ----------
1006
+ document_id : str
1007
+ Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
1008
+
1009
+ id : str
1010
+ Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
1011
+
1012
+ request_options : typing.Optional[RequestOptions]
1013
+ Request-specific configuration.
1075
1014
 
1076
- - id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
1015
+ Returns
1016
+ -------
1017
+ None
1018
+
1019
+ Examples
1020
+ --------
1021
+ import asyncio
1077
1022
 
1078
- - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
1079
- ---
1080
1023
  from vellum.client import AsyncVellum
1081
1024
 
1082
1025
  client = AsyncVellum(
1083
1026
  api_key="YOUR_API_KEY",
1084
1027
  )
1085
- await client.document_indexes.remove_document(
1086
- document_id="document_id",
1087
- id="id",
1088
- )
1028
+
1029
+
1030
+ async def main() -> None:
1031
+ await client.document_indexes.remove_document(
1032
+ document_id="document_id",
1033
+ id="id",
1034
+ )
1035
+
1036
+
1037
+ asyncio.run(main())
1089
1038
  """
1090
1039
  _response = await self._client_wrapper.httpx_client.request(
1040
+ f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
1041
+ base_url=self._client_wrapper.get_environment().default,
1091
1042
  method="DELETE",
1092
- url=urllib.parse.urljoin(
1093
- f"{self._client_wrapper.get_environment().default}/",
1094
- f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
1095
- ),
1096
- params=jsonable_encoder(
1097
- request_options.get("additional_query_parameters") if request_options is not None else None
1098
- ),
1099
- headers=jsonable_encoder(
1100
- remove_none_from_dict(
1101
- {
1102
- **self._client_wrapper.get_headers(),
1103
- **(request_options.get("additional_headers", {}) if request_options is not None else {}),
1104
- }
1105
- )
1106
- ),
1107
- timeout=request_options.get("timeout_in_seconds")
1108
- if request_options is not None and request_options.get("timeout_in_seconds") is not None
1109
- else self._client_wrapper.get_timeout(),
1110
- retries=0,
1111
- max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
1043
+ request_options=request_options,
1112
1044
  )
1113
- if 200 <= _response.status_code < 300:
1114
- return
1115
1045
  try:
1046
+ if 200 <= _response.status_code < 300:
1047
+ return
1116
1048
  _response_json = _response.json()
1117
1049
  except JSONDecodeError:
1118
1050
  raise ApiError(status_code=_response.status_code, body=_response.text)