vellum-ai 0.3.13__py3-none-any.whl → 0.3.15__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (318) hide show
  1. vellum/__init__.py +22 -0
  2. vellum/client.py +846 -100
  3. vellum/core/__init__.py +8 -0
  4. vellum/core/client_wrapper.py +27 -8
  5. vellum/core/file.py +38 -0
  6. vellum/core/http_client.py +130 -0
  7. vellum/core/jsonable_encoder.py +2 -2
  8. vellum/core/request_options.py +32 -0
  9. vellum/resources/deployments/client.py +161 -24
  10. vellum/resources/document_indexes/client.py +337 -80
  11. vellum/resources/documents/client.py +278 -58
  12. vellum/resources/folder_entities/client.py +60 -10
  13. vellum/resources/model_versions/client.py +48 -8
  14. vellum/resources/registered_prompts/client.py +52 -6
  15. vellum/resources/sandboxes/client.py +108 -26
  16. vellum/resources/test_suite_runs/client.py +221 -38
  17. vellum/resources/test_suites/client.py +110 -24
  18. vellum/resources/workflow_deployments/client.py +110 -14
  19. vellum/types/__init__.py +20 -0
  20. vellum/types/api_node_result.py +1 -0
  21. vellum/types/api_node_result_data.py +4 -2
  22. vellum/types/array_chat_message_content.py +1 -0
  23. vellum/types/array_chat_message_content_item.py +6 -5
  24. vellum/types/array_chat_message_content_item_request.py +6 -5
  25. vellum/types/array_chat_message_content_request.py +1 -0
  26. vellum/types/array_enum.py +2 -2
  27. vellum/types/array_variable_value_item.py +16 -10
  28. vellum/types/chat_history_enum.py +2 -2
  29. vellum/types/chat_history_input_request.py +6 -1
  30. vellum/types/chat_history_variable_value.py +2 -1
  31. vellum/types/chat_message.py +7 -5
  32. vellum/types/chat_message_content.py +8 -6
  33. vellum/types/chat_message_content_request.py +8 -6
  34. vellum/types/chat_message_request.py +7 -5
  35. vellum/types/code_execution_node_array_result.py +31 -0
  36. vellum/types/code_execution_node_chat_history_result.py +2 -1
  37. vellum/types/code_execution_node_error_result.py +2 -1
  38. vellum/types/code_execution_node_function_call_result.py +31 -0
  39. vellum/types/code_execution_node_json_result.py +2 -1
  40. vellum/types/code_execution_node_number_result.py +2 -1
  41. vellum/types/code_execution_node_result.py +1 -0
  42. vellum/types/code_execution_node_result_data.py +2 -1
  43. vellum/types/code_execution_node_result_output.py +36 -8
  44. vellum/types/code_execution_node_search_results_result.py +2 -1
  45. vellum/types/code_execution_node_string_result.py +2 -1
  46. vellum/types/conditional_node_result.py +1 -0
  47. vellum/types/conditional_node_result_data.py +2 -1
  48. vellum/types/deployment_provider_payload_response.py +1 -0
  49. vellum/types/deployment_read.py +32 -17
  50. vellum/types/document_document_to_document_index.py +21 -15
  51. vellum/types/document_index_read.py +32 -19
  52. vellum/types/document_read.py +34 -24
  53. vellum/types/document_status.py +2 -2
  54. vellum/types/enriched_normalized_completion.py +36 -19
  55. vellum/types/error_enum.py +2 -2
  56. vellum/types/error_variable_value.py +2 -1
  57. vellum/types/execute_prompt_api_error_response.py +5 -1
  58. vellum/types/execute_prompt_event.py +8 -6
  59. vellum/types/execute_prompt_response.py +4 -4
  60. vellum/types/execute_workflow_error_response.py +5 -1
  61. vellum/types/execute_workflow_response.py +3 -2
  62. vellum/types/execute_workflow_stream_error_response.py +5 -1
  63. vellum/types/execute_workflow_workflow_result_event.py +4 -4
  64. vellum/types/execution_array_vellum_value.py +7 -2
  65. vellum/types/execution_chat_history_vellum_value.py +7 -2
  66. vellum/types/execution_error_vellum_value.py +7 -2
  67. vellum/types/execution_function_call_vellum_value.py +7 -2
  68. vellum/types/execution_json_vellum_value.py +7 -2
  69. vellum/types/execution_number_vellum_value.py +7 -2
  70. vellum/types/execution_search_results_vellum_value.py +7 -2
  71. vellum/types/execution_string_vellum_value.py +7 -2
  72. vellum/types/execution_vellum_value.py +16 -10
  73. vellum/types/fulfilled_enum.py +2 -2
  74. vellum/types/fulfilled_execute_prompt_event.py +2 -1
  75. vellum/types/fulfilled_execute_prompt_response.py +12 -5
  76. vellum/types/fulfilled_execute_workflow_workflow_result_event.py +1 -0
  77. vellum/types/fulfilled_function_call.py +2 -1
  78. vellum/types/fulfilled_prompt_execution_meta.py +3 -2
  79. vellum/types/fulfilled_workflow_node_result_event.py +6 -5
  80. vellum/types/function_call.py +4 -4
  81. vellum/types/function_call_chat_message_content.py +1 -0
  82. vellum/types/function_call_chat_message_content_request.py +1 -0
  83. vellum/types/function_call_chat_message_content_value.py +2 -1
  84. vellum/types/function_call_chat_message_content_value_request.py +2 -1
  85. vellum/types/function_call_enum.py +2 -2
  86. vellum/types/function_call_variable_value.py +1 -0
  87. vellum/types/generate_error_response.py +5 -1
  88. vellum/types/generate_options_request.py +8 -5
  89. vellum/types/generate_request.py +15 -9
  90. vellum/types/generate_result.py +10 -6
  91. vellum/types/generate_result_data.py +5 -3
  92. vellum/types/generate_result_error.py +5 -1
  93. vellum/types/generate_stream_response.py +1 -0
  94. vellum/types/generate_stream_result.py +3 -2
  95. vellum/types/generate_stream_result_data.py +1 -0
  96. vellum/types/image_chat_message_content.py +1 -0
  97. vellum/types/image_chat_message_content_request.py +1 -0
  98. vellum/types/image_enum.py +2 -2
  99. vellum/types/image_variable_value.py +2 -1
  100. vellum/types/initiated_enum.py +2 -2
  101. vellum/types/initiated_execute_prompt_event.py +2 -1
  102. vellum/types/initiated_prompt_execution_meta.py +5 -4
  103. vellum/types/initiated_workflow_node_result_event.py +5 -4
  104. vellum/types/json_enum.py +2 -2
  105. vellum/types/json_input_request.py +6 -1
  106. vellum/types/json_variable_value.py +2 -1
  107. vellum/types/logprobs_enum.py +2 -2
  108. vellum/types/metadata_filter_config_request.py +7 -6
  109. vellum/types/metadata_filter_rule_request.py +7 -6
  110. vellum/types/model_version_build_config.py +12 -7
  111. vellum/types/model_version_exec_config.py +18 -11
  112. vellum/types/model_version_exec_config_parameters.py +7 -6
  113. vellum/types/model_version_read.py +51 -32
  114. vellum/types/model_version_sandbox_snapshot.py +17 -4
  115. vellum/types/named_test_case_chat_history_variable_value_request.py +2 -1
  116. vellum/types/named_test_case_error_variable_value_request.py +2 -1
  117. vellum/types/named_test_case_json_variable_value_request.py +2 -1
  118. vellum/types/named_test_case_number_variable_value_request.py +2 -1
  119. vellum/types/named_test_case_search_results_variable_value_request.py +2 -1
  120. vellum/types/named_test_case_string_variable_value_request.py +2 -1
  121. vellum/types/named_test_case_variable_value_request.py +12 -8
  122. vellum/types/node_input_compiled_array_value.py +2 -1
  123. vellum/types/node_input_compiled_chat_history_value.py +2 -1
  124. vellum/types/node_input_compiled_error_value.py +2 -1
  125. vellum/types/node_input_compiled_function_call.py +32 -0
  126. vellum/types/node_input_compiled_json_value.py +2 -1
  127. vellum/types/node_input_compiled_number_value.py +2 -1
  128. vellum/types/node_input_compiled_search_results_value.py +2 -1
  129. vellum/types/node_input_compiled_string_value.py +2 -1
  130. vellum/types/node_input_variable_compiled_value.py +26 -9
  131. vellum/types/node_output_compiled_array_value.py +2 -1
  132. vellum/types/node_output_compiled_chat_history_value.py +2 -1
  133. vellum/types/node_output_compiled_error_value.py +2 -1
  134. vellum/types/node_output_compiled_function_value.py +2 -1
  135. vellum/types/node_output_compiled_json_value.py +2 -1
  136. vellum/types/node_output_compiled_number_value.py +2 -1
  137. vellum/types/node_output_compiled_search_results_value.py +2 -1
  138. vellum/types/node_output_compiled_string_value.py +2 -1
  139. vellum/types/node_output_compiled_value.py +16 -10
  140. vellum/types/normalized_log_probs.py +2 -1
  141. vellum/types/normalized_token_log_probs.py +3 -2
  142. vellum/types/number_enum.py +2 -2
  143. vellum/types/number_variable_value.py +2 -1
  144. vellum/types/paginated_document_index_read_list.py +5 -4
  145. vellum/types/paginated_slim_deployment_read_list.py +5 -4
  146. vellum/types/paginated_slim_document_list.py +5 -4
  147. vellum/types/paginated_slim_workflow_deployment_list.py +5 -4
  148. vellum/types/paginated_test_suite_run_execution_list.py +5 -4
  149. vellum/types/prompt_deployment_expand_meta_request_request.py +25 -15
  150. vellum/types/prompt_deployment_input_request.py +6 -5
  151. vellum/types/prompt_execution_meta.py +6 -5
  152. vellum/types/prompt_node_result.py +1 -0
  153. vellum/types/prompt_node_result_data.py +4 -3
  154. vellum/types/prompt_output.py +8 -6
  155. vellum/types/prompt_template_block.py +1 -0
  156. vellum/types/prompt_template_block_data.py +1 -0
  157. vellum/types/prompt_template_block_data_request.py +1 -0
  158. vellum/types/prompt_template_block_properties.py +11 -10
  159. vellum/types/prompt_template_block_properties_request.py +11 -10
  160. vellum/types/prompt_template_block_request.py +1 -0
  161. vellum/types/raw_prompt_execution_overrides_request.py +11 -5
  162. vellum/types/register_prompt_error_response.py +5 -1
  163. vellum/types/register_prompt_model_parameters_request.py +5 -4
  164. vellum/types/register_prompt_prompt.py +10 -2
  165. vellum/types/register_prompt_prompt_info_request.py +5 -3
  166. vellum/types/register_prompt_response.py +30 -10
  167. vellum/types/registered_prompt_deployment.py +15 -3
  168. vellum/types/registered_prompt_input_variable_request.py +3 -2
  169. vellum/types/registered_prompt_model_version.py +10 -2
  170. vellum/types/registered_prompt_sandbox.py +10 -2
  171. vellum/types/registered_prompt_sandbox_snapshot.py +5 -1
  172. vellum/types/rejected_enum.py +2 -2
  173. vellum/types/rejected_execute_prompt_event.py +2 -1
  174. vellum/types/rejected_execute_prompt_response.py +12 -5
  175. vellum/types/rejected_execute_workflow_workflow_result_event.py +1 -0
  176. vellum/types/rejected_function_call.py +2 -1
  177. vellum/types/rejected_prompt_execution_meta.py +3 -2
  178. vellum/types/rejected_workflow_node_result_event.py +4 -3
  179. vellum/types/sandbox_scenario.py +11 -3
  180. vellum/types/scenario_input.py +4 -3
  181. vellum/types/scenario_input_request.py +4 -3
  182. vellum/types/search_error_response.py +5 -1
  183. vellum/types/search_filters_request.py +10 -6
  184. vellum/types/search_node_result.py +1 -0
  185. vellum/types/search_node_result_data.py +7 -4
  186. vellum/types/search_request_options_request.py +20 -8
  187. vellum/types/search_response.py +5 -3
  188. vellum/types/search_result.py +15 -5
  189. vellum/types/search_result_document.py +20 -8
  190. vellum/types/search_result_document_request.py +15 -7
  191. vellum/types/search_result_merging_request.py +5 -1
  192. vellum/types/search_result_request.py +15 -5
  193. vellum/types/search_results_enum.py +2 -2
  194. vellum/types/search_results_variable_value.py +2 -1
  195. vellum/types/search_weights_request.py +10 -4
  196. vellum/types/slim_deployment_read.py +28 -14
  197. vellum/types/slim_document.py +56 -35
  198. vellum/types/slim_workflow_deployment.py +37 -24
  199. vellum/types/streaming_enum.py +2 -2
  200. vellum/types/streaming_execute_prompt_event.py +6 -4
  201. vellum/types/streaming_prompt_execution_meta.py +2 -1
  202. vellum/types/streaming_workflow_node_result_event.py +6 -5
  203. vellum/types/string_chat_message_content.py +1 -0
  204. vellum/types/string_chat_message_content_request.py +1 -0
  205. vellum/types/string_enum.py +2 -2
  206. vellum/types/string_input_request.py +6 -1
  207. vellum/types/string_variable_value.py +2 -1
  208. vellum/types/submit_completion_actual_request.py +25 -13
  209. vellum/types/submit_completion_actuals_error_response.py +1 -0
  210. vellum/types/submit_workflow_execution_actual_request.py +6 -5
  211. vellum/types/subworkflow_enum.py +2 -2
  212. vellum/types/subworkflow_node_result.py +1 -0
  213. vellum/types/templating_node_array_result.py +31 -0
  214. vellum/types/templating_node_chat_history_result.py +2 -1
  215. vellum/types/templating_node_error_result.py +2 -1
  216. vellum/types/templating_node_function_call_result.py +31 -0
  217. vellum/types/templating_node_json_result.py +2 -1
  218. vellum/types/templating_node_number_result.py +2 -1
  219. vellum/types/templating_node_result.py +1 -0
  220. vellum/types/templating_node_result_data.py +1 -0
  221. vellum/types/templating_node_result_output.py +36 -8
  222. vellum/types/templating_node_search_results_result.py +2 -1
  223. vellum/types/templating_node_string_result.py +2 -1
  224. vellum/types/terminal_node_array_result.py +8 -3
  225. vellum/types/terminal_node_chat_history_result.py +8 -3
  226. vellum/types/terminal_node_error_result.py +8 -3
  227. vellum/types/terminal_node_function_call_result.py +8 -3
  228. vellum/types/terminal_node_json_result.py +8 -3
  229. vellum/types/terminal_node_number_result.py +8 -3
  230. vellum/types/terminal_node_result.py +1 -0
  231. vellum/types/terminal_node_result_data.py +1 -0
  232. vellum/types/terminal_node_result_output.py +16 -10
  233. vellum/types/terminal_node_search_results_result.py +8 -3
  234. vellum/types/terminal_node_string_result.py +8 -3
  235. vellum/types/test_case_chat_history_variable_value.py +2 -1
  236. vellum/types/test_case_error_variable_value.py +2 -1
  237. vellum/types/test_case_json_variable_value.py +2 -1
  238. vellum/types/test_case_number_variable_value.py +2 -1
  239. vellum/types/test_case_search_results_variable_value.py +2 -1
  240. vellum/types/test_case_string_variable_value.py +2 -1
  241. vellum/types/test_case_variable_value.py +12 -8
  242. vellum/types/test_suite_run_deployment_release_tag_exec_config.py +5 -3
  243. vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +10 -4
  244. vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +10 -4
  245. vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +5 -3
  246. vellum/types/test_suite_run_deployment_release_tag_exec_config_type_enum.py +2 -2
  247. vellum/types/test_suite_run_exec_config.py +4 -4
  248. vellum/types/test_suite_run_exec_config_request.py +4 -4
  249. vellum/types/test_suite_run_execution.py +1 -0
  250. vellum/types/test_suite_run_execution_chat_history_output.py +2 -1
  251. vellum/types/test_suite_run_execution_error_output.py +2 -1
  252. vellum/types/test_suite_run_execution_json_output.py +2 -1
  253. vellum/types/test_suite_run_execution_metric_result.py +1 -0
  254. vellum/types/test_suite_run_execution_number_output.py +2 -1
  255. vellum/types/test_suite_run_execution_output.py +12 -8
  256. vellum/types/test_suite_run_execution_search_results_output.py +2 -1
  257. vellum/types/test_suite_run_execution_string_output.py +2 -1
  258. vellum/types/test_suite_run_metric_error_output.py +1 -0
  259. vellum/types/test_suite_run_metric_error_output_type_enum.py +2 -2
  260. vellum/types/test_suite_run_metric_number_output.py +1 -0
  261. vellum/types/test_suite_run_metric_number_output_type_enum.py +2 -2
  262. vellum/types/test_suite_run_metric_output.py +4 -4
  263. vellum/types/test_suite_run_read.py +16 -14
  264. vellum/types/test_suite_run_test_suite.py +1 -0
  265. vellum/types/test_suite_run_workflow_release_tag_exec_config.py +5 -3
  266. vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +10 -6
  267. vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +10 -6
  268. vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +5 -3
  269. vellum/types/test_suite_run_workflow_release_tag_exec_config_type_enum.py +2 -2
  270. vellum/types/test_suite_test_case.py +3 -2
  271. vellum/types/upload_document_error_response.py +1 -0
  272. vellum/types/upload_document_response.py +5 -1
  273. vellum/types/vellum_error.py +1 -0
  274. vellum/types/vellum_error_request.py +1 -0
  275. vellum/types/vellum_image.py +2 -1
  276. vellum/types/vellum_image_request.py +2 -1
  277. vellum/types/vellum_variable.py +1 -0
  278. vellum/types/workflow_deployment_read.py +37 -24
  279. vellum/types/workflow_event_error.py +1 -0
  280. vellum/types/workflow_execution_actual_chat_history_request.py +25 -15
  281. vellum/types/workflow_execution_actual_json_request.py +25 -15
  282. vellum/types/workflow_execution_actual_string_request.py +25 -15
  283. vellum/types/workflow_execution_node_result_event.py +3 -2
  284. vellum/types/workflow_execution_workflow_result_event.py +3 -2
  285. vellum/types/workflow_node_result_data.py +16 -10
  286. vellum/types/workflow_node_result_event.py +8 -6
  287. vellum/types/workflow_output.py +18 -11
  288. vellum/types/workflow_output_array.py +7 -2
  289. vellum/types/workflow_output_chat_history.py +7 -2
  290. vellum/types/workflow_output_error.py +7 -2
  291. vellum/types/workflow_output_function_call.py +7 -2
  292. vellum/types/workflow_output_image.py +7 -2
  293. vellum/types/workflow_output_json.py +7 -2
  294. vellum/types/workflow_output_number.py +7 -2
  295. vellum/types/workflow_output_search_results.py +7 -2
  296. vellum/types/workflow_output_string.py +7 -2
  297. vellum/types/workflow_request_chat_history_input_request.py +6 -1
  298. vellum/types/workflow_request_input_request.py +8 -6
  299. vellum/types/workflow_request_json_input_request.py +6 -1
  300. vellum/types/workflow_request_number_input_request.py +6 -1
  301. vellum/types/workflow_request_string_input_request.py +6 -1
  302. vellum/types/workflow_result_event.py +5 -4
  303. vellum/types/workflow_result_event_output_data.py +16 -10
  304. vellum/types/workflow_result_event_output_data_array.py +8 -5
  305. vellum/types/workflow_result_event_output_data_chat_history.py +8 -5
  306. vellum/types/workflow_result_event_output_data_error.py +8 -5
  307. vellum/types/workflow_result_event_output_data_function_call.py +8 -5
  308. vellum/types/workflow_result_event_output_data_json.py +8 -5
  309. vellum/types/workflow_result_event_output_data_number.py +8 -5
  310. vellum/types/workflow_result_event_output_data_search_results.py +8 -5
  311. vellum/types/workflow_result_event_output_data_string.py +11 -7
  312. vellum/types/workflow_stream_event.py +4 -4
  313. vellum/version.py +4 -0
  314. {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/METADATA +4 -4
  315. vellum_ai-0.3.15.dist-info/RECORD +365 -0
  316. vellum_ai-0.3.13.dist-info/RECORD +0 -356
  317. {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/LICENSE +0 -0
  318. {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/WHEEL +0 -0
@@ -4,10 +4,12 @@ import typing
4
4
  import urllib.parse
5
5
  from json.decoder import JSONDecodeError
6
6
 
7
+ from ... import core
7
8
  from ...core.api_error import ApiError
8
9
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
10
  from ...core.jsonable_encoder import jsonable_encoder
10
11
  from ...core.remove_none_from_dict import remove_none_from_dict
12
+ from ...core.request_options import RequestOptions
11
13
  from ...errors.bad_request_error import BadRequestError
12
14
  from ...errors.internal_server_error import InternalServerError
13
15
  from ...errors.not_found_error import NotFoundError
@@ -36,6 +38,7 @@ class DocumentsClient:
36
38
  limit: typing.Optional[int] = None,
37
39
  offset: typing.Optional[int] = None,
38
40
  ordering: typing.Optional[str] = None,
41
+ request_options: typing.Optional[RequestOptions] = None,
39
42
  ) -> PaginatedSlimDocumentList:
40
43
  """
41
44
  Used to list documents. Optionally filter on supported fields.
@@ -48,6 +51,8 @@ class DocumentsClient:
48
51
  - offset: typing.Optional[int]. The initial index from which to return the results.
49
52
 
50
53
  - ordering: typing.Optional[str]. Which field to use when ordering the results.
54
+
55
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
51
56
  ---
52
57
  from vellum.client import Vellum
53
58
 
@@ -59,11 +64,34 @@ class DocumentsClient:
59
64
  _response = self._client_wrapper.httpx_client.request(
60
65
  "GET",
61
66
  urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/documents"),
62
- params=remove_none_from_dict(
63
- {"document_index_id": document_index_id, "limit": limit, "offset": offset, "ordering": ordering}
67
+ params=jsonable_encoder(
68
+ remove_none_from_dict(
69
+ {
70
+ "document_index_id": document_index_id,
71
+ "limit": limit,
72
+ "offset": offset,
73
+ "ordering": ordering,
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
+ )
64
89
  ),
65
- headers=self._client_wrapper.get_headers(),
66
- timeout=None,
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
67
95
  )
68
96
  if 200 <= _response.status_code < 300:
69
97
  return pydantic.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
@@ -73,10 +101,12 @@ class DocumentsClient:
73
101
  raise ApiError(status_code=_response.status_code, body=_response.text)
74
102
  raise ApiError(status_code=_response.status_code, body=_response_json)
75
103
 
76
- def destroy(self, id: str) -> None:
104
+ def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
77
105
  """
78
106
  Parameters:
79
107
  - id: str. A UUID string identifying this document.
108
+
109
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
80
110
  ---
81
111
  from vellum.client import Vellum
82
112
 
@@ -89,9 +119,25 @@ class DocumentsClient:
89
119
  """
90
120
  _response = self._client_wrapper.httpx_client.request(
91
121
  "DELETE",
92
- urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{id}"),
93
- headers=self._client_wrapper.get_headers(),
94
- timeout=None,
122
+ urllib.parse.urljoin(
123
+ f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
124
+ ),
125
+ params=jsonable_encoder(
126
+ request_options.get("additional_query_parameters") if request_options is not None else None
127
+ ),
128
+ headers=jsonable_encoder(
129
+ remove_none_from_dict(
130
+ {
131
+ **self._client_wrapper.get_headers(),
132
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
133
+ }
134
+ )
135
+ ),
136
+ timeout=request_options.get("timeout_in_seconds")
137
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
138
+ else self._client_wrapper.get_timeout(),
139
+ retries=0,
140
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
95
141
  )
96
142
  if 200 <= _response.status_code < 300:
97
143
  return
@@ -108,6 +154,7 @@ class DocumentsClient:
108
154
  label: typing.Optional[str] = OMIT,
109
155
  status: typing.Optional[DocumentStatus] = OMIT,
110
156
  metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
157
+ request_options: typing.Optional[RequestOptions] = None,
111
158
  ) -> DocumentRead:
112
159
  """
113
160
  Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
@@ -121,6 +168,8 @@ class DocumentsClient:
121
168
 
122
169
  * `ACTIVE` - Active
123
170
  - 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.
171
+
172
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
124
173
  ---
125
174
  from vellum.client import Vellum
126
175
 
@@ -140,10 +189,31 @@ class DocumentsClient:
140
189
  _request["metadata"] = metadata
141
190
  _response = self._client_wrapper.httpx_client.request(
142
191
  "PATCH",
143
- urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{id}"),
144
- json=jsonable_encoder(_request),
145
- headers=self._client_wrapper.get_headers(),
146
- timeout=None,
192
+ urllib.parse.urljoin(
193
+ f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
194
+ ),
195
+ params=jsonable_encoder(
196
+ request_options.get("additional_query_parameters") if request_options is not None else None
197
+ ),
198
+ json=jsonable_encoder(_request)
199
+ if request_options is None or request_options.get("additional_body_parameters") is None
200
+ else {
201
+ **jsonable_encoder(_request),
202
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
203
+ },
204
+ headers=jsonable_encoder(
205
+ remove_none_from_dict(
206
+ {
207
+ **self._client_wrapper.get_headers(),
208
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
209
+ }
210
+ )
211
+ ),
212
+ timeout=request_options.get("timeout_in_seconds")
213
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
214
+ else self._client_wrapper.get_timeout(),
215
+ retries=0,
216
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
147
217
  )
148
218
  if 200 <= _response.status_code < 300:
149
219
  return pydantic.parse_obj_as(DocumentRead, _response.json()) # type: ignore
@@ -159,9 +229,10 @@ class DocumentsClient:
159
229
  add_to_index_names: typing.Optional[typing.List[str]] = None,
160
230
  external_id: typing.Optional[str] = None,
161
231
  label: str,
162
- contents: typing.IO,
232
+ contents: core.File,
163
233
  keywords: typing.Optional[typing.List[str]] = None,
164
234
  metadata: typing.Optional[str] = None,
235
+ request_options: typing.Optional[RequestOptions] = None,
165
236
  ) -> UploadDocumentResponse:
166
237
  """
167
238
  Upload a document to be indexed and used for search.
@@ -177,33 +248,73 @@ class DocumentsClient:
177
248
  - `metadata: dict[str, Any]` - A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
178
249
 
179
250
  Parameters:
180
- - add_to_index_names: typing.Optional[typing.List[str]].
251
+ - 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
252
+
253
+ - 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.
254
+
255
+ - label: str. A human-friendly name for this document. Typically the filename.
181
256
 
182
- - external_id: typing.Optional[str].
257
+ - contents: core.File. See core.File for more documentation
183
258
 
184
- - label: str.
259
+ - keywords: typing.Optional[typing.List[str]]. Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
185
260
 
186
- - contents: typing.IO.
261
+ - metadata: typing.Optional[str]. A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
187
262
 
188
- - keywords: typing.Optional[typing.List[str]].
263
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
264
+ ---
265
+ from vellum.client import Vellum
189
266
 
190
- - metadata: typing.Optional[str].
267
+ client = Vellum(
268
+ api_key="YOUR_API_KEY",
269
+ )
270
+ client.documents.upload()
191
271
  """
192
272
  _response = self._client_wrapper.httpx_client.request(
193
273
  "POST",
194
274
  urllib.parse.urljoin(f"{self._client_wrapper.get_environment().documents}/", "v1/upload-document"),
275
+ params=jsonable_encoder(
276
+ request_options.get("additional_query_parameters") if request_options is not None else None
277
+ ),
195
278
  data=jsonable_encoder(
196
- {
197
- "add_to_index_names": add_to_index_names,
198
- "external_id": external_id,
199
- "label": label,
200
- "keywords": keywords,
201
- "metadata": metadata,
202
- }
279
+ remove_none_from_dict(
280
+ {
281
+ "add_to_index_names": add_to_index_names,
282
+ "external_id": external_id,
283
+ "label": label,
284
+ "keywords": keywords,
285
+ "metadata": metadata,
286
+ }
287
+ )
288
+ )
289
+ if request_options is None or request_options.get("additional_body_parameters") is None
290
+ else {
291
+ **jsonable_encoder(
292
+ remove_none_from_dict(
293
+ {
294
+ "add_to_index_names": add_to_index_names,
295
+ "external_id": external_id,
296
+ "label": label,
297
+ "keywords": keywords,
298
+ "metadata": metadata,
299
+ }
300
+ )
301
+ ),
302
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
303
+ },
304
+ files=core.convert_file_dict_to_httpx_tuples(remove_none_from_dict({"contents": contents})),
305
+ headers=jsonable_encoder(
306
+ remove_none_from_dict(
307
+ {
308
+ **self._client_wrapper.get_headers(),
309
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
310
+ }
311
+ )
203
312
  ),
204
- files={"contents": contents},
205
- headers=self._client_wrapper.get_headers(),
206
- timeout=None,
313
+ timeout=request_options.get("timeout_in_seconds")
314
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
315
+ else self._client_wrapper.get_timeout(),
316
+ retries=0,
317
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
207
318
  )
208
319
  if 200 <= _response.status_code < 300:
209
320
  return pydantic.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
@@ -231,6 +342,7 @@ class AsyncDocumentsClient:
231
342
  limit: typing.Optional[int] = None,
232
343
  offset: typing.Optional[int] = None,
233
344
  ordering: typing.Optional[str] = None,
345
+ request_options: typing.Optional[RequestOptions] = None,
234
346
  ) -> PaginatedSlimDocumentList:
235
347
  """
236
348
  Used to list documents. Optionally filter on supported fields.
@@ -243,6 +355,8 @@ class AsyncDocumentsClient:
243
355
  - offset: typing.Optional[int]. The initial index from which to return the results.
244
356
 
245
357
  - ordering: typing.Optional[str]. Which field to use when ordering the results.
358
+
359
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
246
360
  ---
247
361
  from vellum.client import AsyncVellum
248
362
 
@@ -254,11 +368,34 @@ class AsyncDocumentsClient:
254
368
  _response = await self._client_wrapper.httpx_client.request(
255
369
  "GET",
256
370
  urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/documents"),
257
- params=remove_none_from_dict(
258
- {"document_index_id": document_index_id, "limit": limit, "offset": offset, "ordering": ordering}
371
+ params=jsonable_encoder(
372
+ remove_none_from_dict(
373
+ {
374
+ "document_index_id": document_index_id,
375
+ "limit": limit,
376
+ "offset": offset,
377
+ "ordering": ordering,
378
+ **(
379
+ request_options.get("additional_query_parameters", {})
380
+ if request_options is not None
381
+ else {}
382
+ ),
383
+ }
384
+ )
385
+ ),
386
+ headers=jsonable_encoder(
387
+ remove_none_from_dict(
388
+ {
389
+ **self._client_wrapper.get_headers(),
390
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
391
+ }
392
+ )
259
393
  ),
260
- headers=self._client_wrapper.get_headers(),
261
- timeout=None,
394
+ timeout=request_options.get("timeout_in_seconds")
395
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
396
+ else self._client_wrapper.get_timeout(),
397
+ retries=0,
398
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
262
399
  )
263
400
  if 200 <= _response.status_code < 300:
264
401
  return pydantic.parse_obj_as(PaginatedSlimDocumentList, _response.json()) # type: ignore
@@ -268,10 +405,12 @@ class AsyncDocumentsClient:
268
405
  raise ApiError(status_code=_response.status_code, body=_response.text)
269
406
  raise ApiError(status_code=_response.status_code, body=_response_json)
270
407
 
271
- async def destroy(self, id: str) -> None:
408
+ async def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
272
409
  """
273
410
  Parameters:
274
411
  - id: str. A UUID string identifying this document.
412
+
413
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
275
414
  ---
276
415
  from vellum.client import AsyncVellum
277
416
 
@@ -284,9 +423,25 @@ class AsyncDocumentsClient:
284
423
  """
285
424
  _response = await self._client_wrapper.httpx_client.request(
286
425
  "DELETE",
287
- urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{id}"),
288
- headers=self._client_wrapper.get_headers(),
289
- timeout=None,
426
+ urllib.parse.urljoin(
427
+ f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
428
+ ),
429
+ params=jsonable_encoder(
430
+ request_options.get("additional_query_parameters") if request_options is not None else None
431
+ ),
432
+ headers=jsonable_encoder(
433
+ remove_none_from_dict(
434
+ {
435
+ **self._client_wrapper.get_headers(),
436
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
437
+ }
438
+ )
439
+ ),
440
+ timeout=request_options.get("timeout_in_seconds")
441
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
442
+ else self._client_wrapper.get_timeout(),
443
+ retries=0,
444
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
290
445
  )
291
446
  if 200 <= _response.status_code < 300:
292
447
  return
@@ -303,6 +458,7 @@ class AsyncDocumentsClient:
303
458
  label: typing.Optional[str] = OMIT,
304
459
  status: typing.Optional[DocumentStatus] = OMIT,
305
460
  metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
461
+ request_options: typing.Optional[RequestOptions] = None,
306
462
  ) -> DocumentRead:
307
463
  """
308
464
  Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
@@ -316,6 +472,8 @@ class AsyncDocumentsClient:
316
472
 
317
473
  * `ACTIVE` - Active
318
474
  - 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.
475
+
476
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
319
477
  ---
320
478
  from vellum.client import AsyncVellum
321
479
 
@@ -335,10 +493,31 @@ class AsyncDocumentsClient:
335
493
  _request["metadata"] = metadata
336
494
  _response = await self._client_wrapper.httpx_client.request(
337
495
  "PATCH",
338
- urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{id}"),
339
- json=jsonable_encoder(_request),
340
- headers=self._client_wrapper.get_headers(),
341
- timeout=None,
496
+ urllib.parse.urljoin(
497
+ f"{self._client_wrapper.get_environment().default}/", f"v1/documents/{jsonable_encoder(id)}"
498
+ ),
499
+ params=jsonable_encoder(
500
+ request_options.get("additional_query_parameters") if request_options is not None else None
501
+ ),
502
+ json=jsonable_encoder(_request)
503
+ if request_options is None or request_options.get("additional_body_parameters") is None
504
+ else {
505
+ **jsonable_encoder(_request),
506
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
507
+ },
508
+ headers=jsonable_encoder(
509
+ remove_none_from_dict(
510
+ {
511
+ **self._client_wrapper.get_headers(),
512
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
513
+ }
514
+ )
515
+ ),
516
+ timeout=request_options.get("timeout_in_seconds")
517
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
518
+ else self._client_wrapper.get_timeout(),
519
+ retries=0,
520
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
342
521
  )
343
522
  if 200 <= _response.status_code < 300:
344
523
  return pydantic.parse_obj_as(DocumentRead, _response.json()) # type: ignore
@@ -354,9 +533,10 @@ class AsyncDocumentsClient:
354
533
  add_to_index_names: typing.Optional[typing.List[str]] = None,
355
534
  external_id: typing.Optional[str] = None,
356
535
  label: str,
357
- contents: typing.IO,
536
+ contents: core.File,
358
537
  keywords: typing.Optional[typing.List[str]] = None,
359
538
  metadata: typing.Optional[str] = None,
539
+ request_options: typing.Optional[RequestOptions] = None,
360
540
  ) -> UploadDocumentResponse:
361
541
  """
362
542
  Upload a document to be indexed and used for search.
@@ -372,33 +552,73 @@ class AsyncDocumentsClient:
372
552
  - `metadata: dict[str, Any]` - A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
373
553
 
374
554
  Parameters:
375
- - add_to_index_names: typing.Optional[typing.List[str]].
555
+ - 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
556
+
557
+ - 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.
558
+
559
+ - label: str. A human-friendly name for this document. Typically the filename.
376
560
 
377
- - external_id: typing.Optional[str].
561
+ - contents: core.File. See core.File for more documentation
378
562
 
379
- - label: str.
563
+ - keywords: typing.Optional[typing.List[str]]. Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
380
564
 
381
- - contents: typing.IO.
565
+ - metadata: typing.Optional[str]. A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
382
566
 
383
- - keywords: typing.Optional[typing.List[str]].
567
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
568
+ ---
569
+ from vellum.client import AsyncVellum
384
570
 
385
- - metadata: typing.Optional[str].
571
+ client = AsyncVellum(
572
+ api_key="YOUR_API_KEY",
573
+ )
574
+ await client.documents.upload()
386
575
  """
387
576
  _response = await self._client_wrapper.httpx_client.request(
388
577
  "POST",
389
578
  urllib.parse.urljoin(f"{self._client_wrapper.get_environment().documents}/", "v1/upload-document"),
579
+ params=jsonable_encoder(
580
+ request_options.get("additional_query_parameters") if request_options is not None else None
581
+ ),
390
582
  data=jsonable_encoder(
391
- {
392
- "add_to_index_names": add_to_index_names,
393
- "external_id": external_id,
394
- "label": label,
395
- "keywords": keywords,
396
- "metadata": metadata,
397
- }
583
+ remove_none_from_dict(
584
+ {
585
+ "add_to_index_names": add_to_index_names,
586
+ "external_id": external_id,
587
+ "label": label,
588
+ "keywords": keywords,
589
+ "metadata": metadata,
590
+ }
591
+ )
592
+ )
593
+ if request_options is None or request_options.get("additional_body_parameters") is None
594
+ else {
595
+ **jsonable_encoder(
596
+ remove_none_from_dict(
597
+ {
598
+ "add_to_index_names": add_to_index_names,
599
+ "external_id": external_id,
600
+ "label": label,
601
+ "keywords": keywords,
602
+ "metadata": metadata,
603
+ }
604
+ )
605
+ ),
606
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
607
+ },
608
+ files=core.convert_file_dict_to_httpx_tuples(remove_none_from_dict({"contents": contents})),
609
+ headers=jsonable_encoder(
610
+ remove_none_from_dict(
611
+ {
612
+ **self._client_wrapper.get_headers(),
613
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
614
+ }
615
+ )
398
616
  ),
399
- files={"contents": contents},
400
- headers=self._client_wrapper.get_headers(),
401
- timeout=None,
617
+ timeout=request_options.get("timeout_in_seconds")
618
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
619
+ else self._client_wrapper.get_timeout(),
620
+ retries=0,
621
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
402
622
  )
403
623
  if 200 <= _response.status_code < 300:
404
624
  return pydantic.parse_obj_as(UploadDocumentResponse, _response.json()) # type: ignore
@@ -7,6 +7,8 @@ from json.decoder import JSONDecodeError
7
7
  from ...core.api_error import ApiError
8
8
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
9
  from ...core.jsonable_encoder import jsonable_encoder
10
+ from ...core.remove_none_from_dict import remove_none_from_dict
11
+ from ...core.request_options import RequestOptions
10
12
 
11
13
  # this is used as the default value for optional parameters
12
14
  OMIT = typing.cast(typing.Any, ...)
@@ -16,7 +18,9 @@ class FolderEntitiesClient:
16
18
  def __init__(self, *, client_wrapper: SyncClientWrapper):
17
19
  self._client_wrapper = client_wrapper
18
20
 
19
- def add_entity_to_folder(self, folder_id: str, *, entity_id: str) -> None:
21
+ def add_entity_to_folder(
22
+ self, folder_id: str, *, entity_id: str, request_options: typing.Optional[RequestOptions] = None
23
+ ) -> None:
20
24
  """
21
25
  Add an entity to a specific folder or root directory.
22
26
 
@@ -26,6 +30,8 @@ class FolderEntitiesClient:
26
30
  - folder_id: str. The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
27
31
 
28
32
  - entity_id: str. The ID of the entity you would like to move.
33
+
34
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
29
35
  ---
30
36
  from vellum.client import Vellum
31
37
 
@@ -40,11 +46,31 @@ class FolderEntitiesClient:
40
46
  _response = self._client_wrapper.httpx_client.request(
41
47
  "POST",
42
48
  urllib.parse.urljoin(
43
- f"{self._client_wrapper.get_environment().default}/", f"v1/folders/{folder_id}/add-entity"
49
+ f"{self._client_wrapper.get_environment().default}/",
50
+ f"v1/folders/{jsonable_encoder(folder_id)}/add-entity",
51
+ ),
52
+ params=jsonable_encoder(
53
+ request_options.get("additional_query_parameters") if request_options is not None else None
54
+ ),
55
+ json=jsonable_encoder({"entity_id": entity_id})
56
+ if request_options is None or request_options.get("additional_body_parameters") is None
57
+ else {
58
+ **jsonable_encoder({"entity_id": entity_id}),
59
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
60
+ },
61
+ headers=jsonable_encoder(
62
+ remove_none_from_dict(
63
+ {
64
+ **self._client_wrapper.get_headers(),
65
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
66
+ }
67
+ )
44
68
  ),
45
- json=jsonable_encoder({"entity_id": entity_id}),
46
- headers=self._client_wrapper.get_headers(),
47
- timeout=None,
69
+ timeout=request_options.get("timeout_in_seconds")
70
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
71
+ else self._client_wrapper.get_timeout(),
72
+ retries=0,
73
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
48
74
  )
49
75
  if 200 <= _response.status_code < 300:
50
76
  return
@@ -59,7 +85,9 @@ class AsyncFolderEntitiesClient:
59
85
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
60
86
  self._client_wrapper = client_wrapper
61
87
 
62
- async def add_entity_to_folder(self, folder_id: str, *, entity_id: str) -> None:
88
+ async def add_entity_to_folder(
89
+ self, folder_id: str, *, entity_id: str, request_options: typing.Optional[RequestOptions] = None
90
+ ) -> None:
63
91
  """
64
92
  Add an entity to a specific folder or root directory.
65
93
 
@@ -69,6 +97,8 @@ class AsyncFolderEntitiesClient:
69
97
  - folder_id: str. The ID of the folder to which the entity should be added. This can be a UUID of a folder, or the name of a root directory (e.g. "PROMPT_SANDBOX").
70
98
 
71
99
  - entity_id: str. The ID of the entity you would like to move.
100
+
101
+ - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
72
102
  ---
73
103
  from vellum.client import AsyncVellum
74
104
 
@@ -83,11 +113,31 @@ class AsyncFolderEntitiesClient:
83
113
  _response = await self._client_wrapper.httpx_client.request(
84
114
  "POST",
85
115
  urllib.parse.urljoin(
86
- f"{self._client_wrapper.get_environment().default}/", f"v1/folders/{folder_id}/add-entity"
116
+ f"{self._client_wrapper.get_environment().default}/",
117
+ f"v1/folders/{jsonable_encoder(folder_id)}/add-entity",
118
+ ),
119
+ params=jsonable_encoder(
120
+ request_options.get("additional_query_parameters") if request_options is not None else None
121
+ ),
122
+ json=jsonable_encoder({"entity_id": entity_id})
123
+ if request_options is None or request_options.get("additional_body_parameters") is None
124
+ else {
125
+ **jsonable_encoder({"entity_id": entity_id}),
126
+ **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
127
+ },
128
+ headers=jsonable_encoder(
129
+ remove_none_from_dict(
130
+ {
131
+ **self._client_wrapper.get_headers(),
132
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
133
+ }
134
+ )
87
135
  ),
88
- json=jsonable_encoder({"entity_id": entity_id}),
89
- headers=self._client_wrapper.get_headers(),
90
- timeout=None,
136
+ timeout=request_options.get("timeout_in_seconds")
137
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
138
+ else self._client_wrapper.get_timeout(),
139
+ retries=0,
140
+ max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
91
141
  )
92
142
  if 200 <= _response.status_code < 300:
93
143
  return