vellum-ai 0.3.22__py3-none-any.whl → 0.5.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. vellum/__init__.py +81 -60
  2. vellum/client.py +139 -137
  3. vellum/core/__init__.py +2 -0
  4. vellum/core/client_wrapper.py +1 -1
  5. vellum/core/jsonable_encoder.py +5 -9
  6. vellum/core/pydantic_utilities.py +12 -0
  7. vellum/errors/__init__.py +1 -2
  8. vellum/lib/__init__.py +5 -0
  9. vellum/lib/test_suites/__init__.py +5 -0
  10. vellum/lib/test_suites/constants.py +2 -0
  11. vellum/lib/test_suites/exceptions.py +2 -0
  12. vellum/lib/test_suites/resources.py +253 -0
  13. vellum/lib/utils/__init__.py +0 -0
  14. vellum/lib/utils/env.py +11 -0
  15. vellum/lib/utils/exceptions.py +2 -0
  16. vellum/lib/utils/paginator.py +28 -0
  17. vellum/resources/__init__.py +0 -4
  18. vellum/resources/deployments/client.py +27 -31
  19. vellum/resources/deployments/types/deployments_list_request_status.py +1 -13
  20. vellum/resources/document_indexes/client.py +35 -39
  21. vellum/resources/document_indexes/types/document_indexes_list_request_status.py +1 -13
  22. vellum/resources/documents/client.py +131 -35
  23. vellum/resources/folder_entities/client.py +4 -4
  24. vellum/resources/sandboxes/client.py +18 -46
  25. vellum/resources/test_suite_runs/client.py +19 -23
  26. vellum/resources/test_suites/client.py +17 -21
  27. vellum/resources/workflow_deployments/client.py +13 -17
  28. vellum/resources/workflow_deployments/types/workflow_deployments_list_request_status.py +1 -13
  29. vellum/types/__init__.py +83 -55
  30. vellum/types/api_node_result.py +3 -7
  31. vellum/types/api_node_result_data.py +4 -8
  32. vellum/types/array_chat_message_content.py +3 -7
  33. vellum/types/array_chat_message_content_request.py +3 -7
  34. vellum/types/chat_history_input_request.py +4 -8
  35. vellum/types/chat_history_variable_value.py +3 -7
  36. vellum/types/chat_message.py +4 -8
  37. vellum/types/chat_message_request.py +4 -8
  38. vellum/types/chat_message_role.py +1 -32
  39. vellum/types/code_execution_node_array_result.py +3 -7
  40. vellum/types/code_execution_node_chat_history_result.py +3 -7
  41. vellum/types/code_execution_node_error_result.py +3 -7
  42. vellum/types/code_execution_node_function_call_result.py +3 -7
  43. vellum/types/code_execution_node_json_result.py +3 -7
  44. vellum/types/code_execution_node_number_result.py +3 -7
  45. vellum/types/code_execution_node_result.py +3 -7
  46. vellum/types/code_execution_node_result_data.py +3 -7
  47. vellum/types/code_execution_node_search_results_result.py +3 -7
  48. vellum/types/code_execution_node_string_result.py +3 -7
  49. vellum/types/conditional_node_result.py +3 -7
  50. vellum/types/conditional_node_result_data.py +3 -7
  51. vellum/types/deployment_provider_payload_response.py +3 -7
  52. vellum/types/deployment_read.py +8 -12
  53. vellum/types/document_document_to_document_index.py +6 -10
  54. vellum/types/document_index_read.py +8 -12
  55. vellum/types/document_read.py +8 -12
  56. vellum/types/enriched_normalized_completion.py +9 -13
  57. vellum/types/entity_status.py +1 -18
  58. vellum/types/environment_enum.py +1 -27
  59. vellum/types/error_variable_value.py +3 -7
  60. vellum/types/execute_prompt_api_error_response.py +4 -8
  61. vellum/types/execute_workflow_error_response.py +4 -8
  62. vellum/types/execute_workflow_response.py +3 -7
  63. vellum/types/execute_workflow_stream_error_response.py +4 -8
  64. vellum/types/execution_array_vellum_value.py +4 -8
  65. vellum/types/execution_chat_history_vellum_value.py +4 -8
  66. vellum/types/execution_error_vellum_value.py +4 -8
  67. vellum/types/execution_function_call_vellum_value.py +4 -8
  68. vellum/types/execution_json_vellum_value.py +4 -8
  69. vellum/types/execution_number_vellum_value.py +4 -8
  70. vellum/types/execution_search_results_vellum_value.py +4 -8
  71. vellum/types/execution_string_vellum_value.py +4 -8
  72. vellum/types/external_test_case_execution.py +31 -0
  73. vellum/types/external_test_case_execution_request.py +31 -0
  74. vellum/types/finish_reason_enum.py +1 -27
  75. vellum/types/fulfilled_execute_prompt_event.py +3 -7
  76. vellum/types/fulfilled_execute_prompt_response.py +5 -9
  77. vellum/types/fulfilled_execute_workflow_workflow_result_event.py +3 -7
  78. vellum/types/fulfilled_function_call.py +3 -7
  79. vellum/types/{registered_prompt_input_variable_request.py → fulfilled_function_call_request.py} +10 -9
  80. vellum/types/fulfilled_prompt_execution_meta.py +3 -7
  81. vellum/types/fulfilled_workflow_node_result_event.py +3 -7
  82. vellum/types/function_call_chat_message_content.py +3 -7
  83. vellum/types/function_call_chat_message_content_request.py +3 -7
  84. vellum/types/function_call_chat_message_content_value.py +3 -7
  85. vellum/types/function_call_chat_message_content_value_request.py +3 -7
  86. vellum/types/function_call_variable_value.py +3 -7
  87. vellum/types/generate_error_response.py +4 -8
  88. vellum/types/generate_options_request.py +4 -8
  89. vellum/types/generate_request.py +6 -10
  90. vellum/types/generate_result.py +5 -9
  91. vellum/types/generate_result_data.py +4 -8
  92. vellum/types/generate_result_error.py +4 -8
  93. vellum/types/generate_stream_response.py +3 -7
  94. vellum/types/generate_stream_result.py +3 -7
  95. vellum/types/generate_stream_result_data.py +3 -7
  96. vellum/types/image_chat_message_content.py +3 -7
  97. vellum/types/image_chat_message_content_request.py +3 -7
  98. vellum/types/image_variable_value.py +3 -7
  99. vellum/types/indexing_state_enum.py +3 -37
  100. vellum/types/initiated_execute_prompt_event.py +3 -7
  101. vellum/types/initiated_prompt_execution_meta.py +3 -7
  102. vellum/types/initiated_workflow_node_result_event.py +3 -7
  103. vellum/types/json_input_request.py +4 -8
  104. vellum/types/json_variable_value.py +3 -7
  105. vellum/types/logical_operator.py +23 -173
  106. vellum/types/logprobs_enum.py +1 -18
  107. vellum/types/metadata_filter_config_request.py +3 -7
  108. vellum/types/metadata_filter_rule_combinator.py +1 -18
  109. vellum/types/metadata_filter_rule_request.py +3 -7
  110. vellum/types/ml_model_usage.py +3 -7
  111. vellum/types/named_scenario_input_chat_history_variable_value_request.py +31 -0
  112. vellum/types/named_scenario_input_request.py +31 -0
  113. vellum/types/{prompt_template_block_data.py → named_scenario_input_string_variable_value_request.py} +8 -9
  114. vellum/types/{prompt_template_block_data_request.py → named_test_case_chat_history_variable_value.py} +9 -9
  115. vellum/types/named_test_case_chat_history_variable_value_request.py +3 -7
  116. vellum/types/named_test_case_error_variable_value.py +31 -0
  117. vellum/types/named_test_case_error_variable_value_request.py +3 -7
  118. vellum/types/{register_prompt_prompt.py → named_test_case_function_call_variable_value.py} +7 -13
  119. vellum/types/named_test_case_function_call_variable_value_request.py +31 -0
  120. vellum/types/{register_prompt_error_response.py → named_test_case_json_variable_value.py} +7 -9
  121. vellum/types/named_test_case_json_variable_value_request.py +3 -7
  122. vellum/types/{registered_prompt_sandbox_snapshot.py → named_test_case_number_variable_value.py} +7 -9
  123. vellum/types/named_test_case_number_variable_value_request.py +3 -7
  124. vellum/types/named_test_case_search_results_variable_value.py +31 -0
  125. vellum/types/named_test_case_search_results_variable_value_request.py +3 -7
  126. vellum/types/named_test_case_string_variable_value.py +30 -0
  127. vellum/types/named_test_case_string_variable_value_request.py +3 -7
  128. vellum/types/named_test_case_variable_value.py +94 -0
  129. vellum/types/named_test_case_variable_value_request.py +12 -0
  130. vellum/types/node_input_compiled_array_value.py +3 -7
  131. vellum/types/node_input_compiled_chat_history_value.py +3 -7
  132. vellum/types/node_input_compiled_error_value.py +3 -7
  133. vellum/types/node_input_compiled_function_call.py +3 -7
  134. vellum/types/node_input_compiled_json_value.py +3 -7
  135. vellum/types/node_input_compiled_number_value.py +3 -7
  136. vellum/types/node_input_compiled_search_results_value.py +3 -7
  137. vellum/types/node_input_compiled_string_value.py +3 -7
  138. vellum/types/node_output_compiled_array_value.py +3 -7
  139. vellum/types/node_output_compiled_chat_history_value.py +3 -7
  140. vellum/types/node_output_compiled_error_value.py +3 -7
  141. vellum/types/node_output_compiled_function_value.py +3 -7
  142. vellum/types/node_output_compiled_json_value.py +3 -7
  143. vellum/types/node_output_compiled_number_value.py +3 -7
  144. vellum/types/node_output_compiled_search_results_value.py +3 -7
  145. vellum/types/node_output_compiled_string_value.py +3 -7
  146. vellum/types/normalized_log_probs.py +3 -7
  147. vellum/types/normalized_token_log_probs.py +3 -7
  148. vellum/types/number_variable_value.py +3 -7
  149. vellum/types/paginated_document_index_read_list.py +3 -7
  150. vellum/types/paginated_slim_deployment_read_list.py +3 -7
  151. vellum/types/paginated_slim_document_list.py +3 -7
  152. vellum/types/paginated_slim_workflow_deployment_list.py +3 -7
  153. vellum/types/paginated_test_suite_run_execution_list.py +3 -7
  154. vellum/types/paginated_test_suite_test_case_list.py +3 -7
  155. vellum/types/processing_failure_reason_enum.py +1 -20
  156. vellum/types/processing_state_enum.py +1 -32
  157. vellum/types/prompt_deployment_expand_meta_request_request.py +9 -13
  158. vellum/types/prompt_execution_meta.py +3 -7
  159. vellum/types/prompt_node_result.py +3 -7
  160. vellum/types/prompt_node_result_data.py +3 -7
  161. vellum/types/raw_prompt_execution_overrides_request.py +5 -9
  162. vellum/types/rejected_execute_prompt_event.py +3 -7
  163. vellum/types/rejected_execute_prompt_response.py +5 -9
  164. vellum/types/rejected_execute_workflow_workflow_result_event.py +3 -7
  165. vellum/types/rejected_function_call.py +3 -7
  166. vellum/types/rejected_prompt_execution_meta.py +3 -7
  167. vellum/types/rejected_workflow_node_result_event.py +3 -7
  168. vellum/types/sandbox_scenario.py +8 -8
  169. vellum/types/scenario_input.py +18 -21
  170. vellum/types/{registered_prompt_sandbox.py → scenario_input_chat_history_variable_value.py} +7 -13
  171. vellum/types/scenario_input_string_variable_value.py +30 -0
  172. vellum/types/search_error_response.py +4 -8
  173. vellum/types/search_filters_request.py +5 -9
  174. vellum/types/search_node_result.py +3 -7
  175. vellum/types/search_node_result_data.py +4 -8
  176. vellum/types/search_request_options_request.py +7 -11
  177. vellum/types/search_response.py +4 -8
  178. vellum/types/search_result.py +6 -10
  179. vellum/types/search_result_document.py +7 -11
  180. vellum/types/search_result_document_request.py +6 -10
  181. vellum/types/search_result_merging_request.py +4 -8
  182. vellum/types/search_result_request.py +6 -10
  183. vellum/types/search_results_variable_value.py +3 -7
  184. vellum/types/search_weights_request.py +5 -9
  185. vellum/types/slim_deployment_read.py +7 -11
  186. vellum/types/slim_document.py +12 -16
  187. vellum/types/slim_workflow_deployment.py +9 -13
  188. vellum/types/streaming_execute_prompt_event.py +4 -8
  189. vellum/types/streaming_prompt_execution_meta.py +3 -7
  190. vellum/types/streaming_workflow_node_result_event.py +3 -7
  191. vellum/types/string_chat_message_content.py +3 -7
  192. vellum/types/string_chat_message_content_request.py +3 -7
  193. vellum/types/string_input_request.py +4 -8
  194. vellum/types/string_variable_value.py +3 -7
  195. vellum/types/submit_completion_actual_request.py +8 -12
  196. vellum/types/submit_completion_actuals_error_response.py +3 -7
  197. vellum/types/subworkflow_node_result.py +3 -7
  198. vellum/types/templating_node_array_result.py +3 -7
  199. vellum/types/templating_node_chat_history_result.py +3 -7
  200. vellum/types/templating_node_error_result.py +3 -7
  201. vellum/types/templating_node_function_call_result.py +3 -7
  202. vellum/types/templating_node_json_result.py +3 -7
  203. vellum/types/templating_node_number_result.py +3 -7
  204. vellum/types/templating_node_result.py +3 -7
  205. vellum/types/templating_node_result_data.py +3 -7
  206. vellum/types/templating_node_search_results_result.py +3 -7
  207. vellum/types/templating_node_string_result.py +3 -7
  208. vellum/types/terminal_node_array_result.py +4 -8
  209. vellum/types/terminal_node_chat_history_result.py +4 -8
  210. vellum/types/terminal_node_error_result.py +4 -8
  211. vellum/types/terminal_node_function_call_result.py +4 -8
  212. vellum/types/terminal_node_json_result.py +4 -8
  213. vellum/types/terminal_node_number_result.py +4 -8
  214. vellum/types/terminal_node_result.py +3 -7
  215. vellum/types/terminal_node_result_data.py +3 -7
  216. vellum/types/terminal_node_search_results_result.py +4 -8
  217. vellum/types/terminal_node_string_result.py +4 -8
  218. vellum/types/test_case_chat_history_variable_value.py +7 -6
  219. vellum/types/test_case_error_variable_value.py +7 -6
  220. vellum/types/test_case_function_call_variable_value.py +32 -0
  221. vellum/types/test_case_json_variable_value.py +7 -6
  222. vellum/types/test_case_number_variable_value.py +7 -6
  223. vellum/types/test_case_search_results_variable_value.py +7 -6
  224. vellum/types/test_case_string_variable_value.py +7 -6
  225. vellum/types/test_case_variable_value.py +12 -0
  226. vellum/types/test_suite_run_deployment_release_tag_exec_config.py +4 -8
  227. vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +5 -9
  228. vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +5 -9
  229. vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +4 -8
  230. vellum/types/test_suite_run_exec_config.py +14 -1
  231. vellum/types/test_suite_run_exec_config_request.py +14 -1
  232. vellum/types/test_suite_run_execution.py +3 -7
  233. vellum/types/test_suite_run_execution_chat_history_output.py +3 -7
  234. vellum/types/test_suite_run_execution_error_output.py +3 -7
  235. vellum/types/test_suite_run_execution_function_call_output.py +32 -0
  236. vellum/types/test_suite_run_execution_json_output.py +3 -7
  237. vellum/types/test_suite_run_execution_metric_definition.py +3 -7
  238. vellum/types/test_suite_run_execution_metric_result.py +3 -7
  239. vellum/types/test_suite_run_execution_number_output.py +3 -7
  240. vellum/types/test_suite_run_execution_output.py +12 -0
  241. vellum/types/test_suite_run_execution_search_results_output.py +3 -7
  242. vellum/types/test_suite_run_execution_string_output.py +3 -7
  243. vellum/types/{model_version_sandbox_snapshot.py → test_suite_run_external_exec_config.py} +8 -18
  244. vellum/types/{registered_prompt_model_version.py → test_suite_run_external_exec_config_data.py} +6 -14
  245. vellum/types/test_suite_run_external_exec_config_data_request.py +29 -0
  246. vellum/types/{registered_prompt_deployment.py → test_suite_run_external_exec_config_request.py} +8 -16
  247. vellum/types/test_suite_run_external_exec_config_type_enum.py +5 -0
  248. vellum/types/test_suite_run_metric_error_output.py +3 -7
  249. vellum/types/test_suite_run_metric_number_output.py +3 -7
  250. vellum/types/test_suite_run_metric_string_output.py +3 -7
  251. vellum/types/test_suite_run_read.py +5 -9
  252. vellum/types/test_suite_run_state.py +1 -37
  253. vellum/types/test_suite_run_test_suite.py +3 -7
  254. vellum/types/test_suite_run_workflow_release_tag_exec_config.py +4 -8
  255. vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +5 -9
  256. vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +5 -9
  257. vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +4 -8
  258. vellum/types/test_suite_test_case.py +3 -7
  259. vellum/types/upload_document_error_response.py +3 -7
  260. vellum/types/upload_document_response.py +4 -8
  261. vellum/types/vellum_error.py +3 -7
  262. vellum/types/vellum_error_code_enum.py +3 -32
  263. vellum/types/vellum_error_request.py +3 -7
  264. vellum/types/vellum_image.py +3 -7
  265. vellum/types/vellum_image_request.py +3 -7
  266. vellum/types/vellum_variable.py +3 -7
  267. vellum/types/vellum_variable_type.py +6 -57
  268. vellum/types/workflow_deployment_read.py +9 -13
  269. vellum/types/workflow_event_error.py +3 -7
  270. vellum/types/workflow_execution_actual_chat_history_request.py +8 -12
  271. vellum/types/workflow_execution_actual_json_request.py +8 -12
  272. vellum/types/workflow_execution_actual_string_request.py +8 -12
  273. vellum/types/workflow_execution_event_error_code.py +13 -52
  274. vellum/types/workflow_execution_event_type.py +1 -18
  275. vellum/types/workflow_execution_node_result_event.py +3 -7
  276. vellum/types/workflow_execution_workflow_result_event.py +3 -7
  277. vellum/types/workflow_node_result_event_state.py +3 -32
  278. vellum/types/workflow_output_array.py +4 -8
  279. vellum/types/workflow_output_chat_history.py +4 -8
  280. vellum/types/workflow_output_error.py +4 -8
  281. vellum/types/workflow_output_function_call.py +4 -8
  282. vellum/types/workflow_output_image.py +4 -8
  283. vellum/types/workflow_output_json.py +4 -8
  284. vellum/types/workflow_output_number.py +4 -8
  285. vellum/types/workflow_output_search_results.py +4 -8
  286. vellum/types/workflow_output_string.py +4 -8
  287. vellum/types/workflow_request_chat_history_input_request.py +4 -8
  288. vellum/types/workflow_request_json_input_request.py +4 -8
  289. vellum/types/workflow_request_number_input_request.py +4 -8
  290. vellum/types/workflow_request_string_input_request.py +4 -8
  291. vellum/types/workflow_result_event.py +3 -7
  292. vellum/types/workflow_result_event_output_data_array.py +4 -8
  293. vellum/types/workflow_result_event_output_data_chat_history.py +4 -8
  294. vellum/types/workflow_result_event_output_data_error.py +4 -8
  295. vellum/types/workflow_result_event_output_data_function_call.py +4 -8
  296. vellum/types/workflow_result_event_output_data_json.py +4 -8
  297. vellum/types/workflow_result_event_output_data_number.py +4 -8
  298. vellum/types/workflow_result_event_output_data_search_results.py +4 -8
  299. vellum/types/workflow_result_event_output_data_string.py +5 -9
  300. {vellum_ai-0.3.22.dist-info → vellum_ai-0.5.0.dist-info}/METADATA +1 -1
  301. vellum_ai-0.5.0.dist-info/RECORD +382 -0
  302. vellum/errors/conflict_error.py +0 -9
  303. vellum/resources/model_versions/__init__.py +0 -2
  304. vellum/resources/model_versions/client.py +0 -123
  305. vellum/resources/registered_prompts/__init__.py +0 -2
  306. vellum/resources/registered_prompts/client.py +0 -327
  307. vellum/types/block_type_enum.py +0 -36
  308. vellum/types/model_version_build_config.py +0 -40
  309. vellum/types/model_version_exec_config.py +0 -48
  310. vellum/types/model_version_exec_config_parameters.py +0 -37
  311. vellum/types/model_version_read.py +0 -82
  312. vellum/types/model_version_read_status_enum.py +0 -36
  313. vellum/types/prompt_template_block.py +0 -41
  314. vellum/types/prompt_template_block_properties.py +0 -47
  315. vellum/types/prompt_template_block_properties_request.py +0 -47
  316. vellum/types/prompt_template_block_request.py +0 -41
  317. vellum/types/prompt_template_block_state.py +0 -22
  318. vellum/types/provider_enum.py +0 -81
  319. vellum/types/register_prompt_model_parameters_request.py +0 -37
  320. vellum/types/register_prompt_prompt_info_request.py +0 -35
  321. vellum/types/register_prompt_response.py +0 -62
  322. vellum/types/scenario_input_request.py +0 -34
  323. vellum/types/scenario_input_type_enum.py +0 -22
  324. vellum_ai-0.3.22.dist-info/RECORD +0 -380
  325. {vellum_ai-0.3.22.dist-info → vellum_ai-0.5.0.dist-info}/LICENSE +0 -0
  326. {vellum_ai-0.3.22.dist-info → vellum_ai-0.5.0.dist-info}/WHEEL +0 -0
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .function_call import FunctionCall
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class FunctionCallVariableValue(pydantic.BaseModel):
11
+ class FunctionCallVariableValue(pydantic_v1.BaseModel):
16
12
  value: FunctionCall
17
13
 
18
14
  def json(self, **kwargs: typing.Any) -> str:
@@ -26,5 +22,5 @@ class FunctionCallVariableValue(pydantic.BaseModel):
26
22
  class Config:
27
23
  frozen = True
28
24
  smart_union = True
29
- extra = pydantic.Extra.allow
25
+ extra = pydantic_v1.Extra.allow
30
26
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
 
8
- try:
9
- import pydantic.v1 as pydantic # type: ignore
10
- except ImportError:
11
- import pydantic # type: ignore
12
9
 
13
-
14
- class GenerateErrorResponse(pydantic.BaseModel):
15
- detail: str = pydantic.Field()
10
+ class GenerateErrorResponse(pydantic_v1.BaseModel):
11
+ detail: str = pydantic_v1.Field()
16
12
  """
17
13
  Details about why the request failed.
18
14
  """
@@ -28,5 +24,5 @@ class GenerateErrorResponse(pydantic.BaseModel):
28
24
  class Config:
29
25
  frozen = True
30
26
  smart_union = True
31
- extra = pydantic.Extra.allow
27
+ extra = pydantic_v1.Extra.allow
32
28
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,16 +4,12 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .logprobs_enum import LogprobsEnum
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class GenerateOptionsRequest(pydantic.BaseModel):
16
- logprobs: typing.Optional[LogprobsEnum] = pydantic.Field(default=None)
11
+ class GenerateOptionsRequest(pydantic_v1.BaseModel):
12
+ logprobs: typing.Optional[LogprobsEnum] = pydantic_v1.Field(default=None)
17
13
  """
18
14
  Which logprobs to include, if any. Defaults to NONE.
19
15
 
@@ -32,5 +28,5 @@ class GenerateOptionsRequest(pydantic.BaseModel):
32
28
  class Config:
33
29
  frozen = True
34
30
  smart_union = True
35
- extra = pydantic.Extra.allow
31
+ extra = pydantic_v1.Extra.allow
36
32
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,26 +4,22 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .chat_message_request import ChatMessageRequest
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class GenerateRequest(pydantic.BaseModel):
16
- input_values: typing.Dict[str, typing.Any] = pydantic.Field()
11
+ class GenerateRequest(pydantic_v1.BaseModel):
12
+ input_values: typing.Dict[str, typing.Any] = pydantic_v1.Field()
17
13
  """
18
14
  Key/value pairs for each template variable defined in the deployment's prompt.
19
15
  """
20
16
 
21
- chat_history: typing.Optional[typing.List[ChatMessageRequest]] = pydantic.Field(default=None)
17
+ chat_history: typing.Optional[typing.List[ChatMessageRequest]] = pydantic_v1.Field(default=None)
22
18
  """
23
19
  Optionally provide a list of chat messages that'll be used in place of the special chat_history variable, if included in the prompt.
24
20
  """
25
21
 
26
- external_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
22
+ external_ids: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None)
27
23
  """
28
24
  Optionally include a unique identifier for each generation, as represented outside of Vellum. Note that this should generally be a list of length one.
29
25
  """
@@ -39,5 +35,5 @@ class GenerateRequest(pydantic.BaseModel):
39
35
  class Config:
40
36
  frozen = True
41
37
  smart_union = True
42
- extra = pydantic.Extra.allow
38
+ extra = pydantic_v1.Extra.allow
43
39
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,22 +4,18 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .generate_result_data import GenerateResultData
8
9
  from .generate_result_error import GenerateResultError
9
10
 
10
- try:
11
- import pydantic.v1 as pydantic # type: ignore
12
- except ImportError:
13
- import pydantic # type: ignore
14
11
 
15
-
16
- class GenerateResult(pydantic.BaseModel):
17
- data: typing.Optional[GenerateResultData] = pydantic.Field(default=None)
12
+ class GenerateResult(pydantic_v1.BaseModel):
13
+ data: typing.Optional[GenerateResultData] = pydantic_v1.Field(default=None)
18
14
  """
19
15
  An object containing the resulting generation. This key will be absent if the LLM provider experienced an error.
20
16
  """
21
17
 
22
- error: typing.Optional[GenerateResultError] = pydantic.Field(default=None)
18
+ error: typing.Optional[GenerateResultError] = pydantic_v1.Field(default=None)
23
19
  """
24
20
  An object containing details about the error that occurred. This key will be absent if the LLM provider did not experience an error.
25
21
  """
@@ -35,5 +31,5 @@ class GenerateResult(pydantic.BaseModel):
35
31
  class Config:
36
32
  frozen = True
37
33
  smart_union = True
38
- extra = pydantic.Extra.allow
34
+ extra = pydantic_v1.Extra.allow
39
35
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,16 +4,12 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .enriched_normalized_completion import EnrichedNormalizedCompletion
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class GenerateResultData(pydantic.BaseModel):
16
- completions: typing.List[EnrichedNormalizedCompletion] = pydantic.Field()
11
+ class GenerateResultData(pydantic_v1.BaseModel):
12
+ completions: typing.List[EnrichedNormalizedCompletion] = pydantic_v1.Field()
17
13
  """
18
14
  The generated completions. This will generally be a list of length one.
19
15
  """
@@ -29,5 +25,5 @@ class GenerateResultData(pydantic.BaseModel):
29
25
  class Config:
30
26
  frozen = True
31
27
  smart_union = True
32
- extra = pydantic.Extra.allow
28
+ extra = pydantic_v1.Extra.allow
33
29
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
 
8
- try:
9
- import pydantic.v1 as pydantic # type: ignore
10
- except ImportError:
11
- import pydantic # type: ignore
12
9
 
13
-
14
- class GenerateResultError(pydantic.BaseModel):
15
- message: str = pydantic.Field()
10
+ class GenerateResultError(pydantic_v1.BaseModel):
11
+ message: str = pydantic_v1.Field()
16
12
  """
17
13
  The error message returned by the LLM provider.
18
14
  """
@@ -28,5 +24,5 @@ class GenerateResultError(pydantic.BaseModel):
28
24
  class Config:
29
25
  frozen = True
30
26
  smart_union = True
31
- extra = pydantic.Extra.allow
27
+ extra = pydantic_v1.Extra.allow
32
28
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .generate_stream_result import GenerateStreamResult
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class GenerateStreamResponse(pydantic.BaseModel):
11
+ class GenerateStreamResponse(pydantic_v1.BaseModel):
16
12
  delta: GenerateStreamResult
17
13
 
18
14
  def json(self, **kwargs: typing.Any) -> str:
@@ -26,5 +22,5 @@ class GenerateStreamResponse(pydantic.BaseModel):
26
22
  class Config:
27
23
  frozen = True
28
24
  smart_union = True
29
- extra = pydantic.Extra.allow
25
+ extra = pydantic_v1.Extra.allow
30
26
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,16 +4,12 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .generate_result_error import GenerateResultError
8
9
  from .generate_stream_result_data import GenerateStreamResultData
9
10
 
10
- try:
11
- import pydantic.v1 as pydantic # type: ignore
12
- except ImportError:
13
- import pydantic # type: ignore
14
11
 
15
-
16
- class GenerateStreamResult(pydantic.BaseModel):
12
+ class GenerateStreamResult(pydantic_v1.BaseModel):
17
13
  request_index: int
18
14
  data: typing.Optional[GenerateStreamResultData] = None
19
15
  error: typing.Optional[GenerateResultError] = None
@@ -29,5 +25,5 @@ class GenerateStreamResult(pydantic.BaseModel):
29
25
  class Config:
30
26
  frozen = True
31
27
  smart_union = True
32
- extra = pydantic.Extra.allow
28
+ extra = pydantic_v1.Extra.allow
33
29
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .enriched_normalized_completion import EnrichedNormalizedCompletion
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class GenerateStreamResultData(pydantic.BaseModel):
11
+ class GenerateStreamResultData(pydantic_v1.BaseModel):
16
12
  completion_index: int
17
13
  completion: EnrichedNormalizedCompletion
18
14
 
@@ -27,5 +23,5 @@ class GenerateStreamResultData(pydantic.BaseModel):
27
23
  class Config:
28
24
  frozen = True
29
25
  smart_union = True
30
- extra = pydantic.Extra.allow
26
+ extra = pydantic_v1.Extra.allow
31
27
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .vellum_image import VellumImage
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class ImageChatMessageContent(pydantic.BaseModel):
11
+ class ImageChatMessageContent(pydantic_v1.BaseModel):
16
12
  """
17
13
  An image value that is used in a chat message.
18
14
  """
@@ -30,5 +26,5 @@ class ImageChatMessageContent(pydantic.BaseModel):
30
26
  class Config:
31
27
  frozen = True
32
28
  smart_union = True
33
- extra = pydantic.Extra.allow
29
+ extra = pydantic_v1.Extra.allow
34
30
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .vellum_image_request import VellumImageRequest
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class ImageChatMessageContentRequest(pydantic.BaseModel):
11
+ class ImageChatMessageContentRequest(pydantic_v1.BaseModel):
16
12
  """
17
13
  An image value that is used in a chat message.
18
14
  """
@@ -30,5 +26,5 @@ class ImageChatMessageContentRequest(pydantic.BaseModel):
30
26
  class Config:
31
27
  frozen = True
32
28
  smart_union = True
33
- extra = pydantic.Extra.allow
29
+ extra = pydantic_v1.Extra.allow
34
30
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .vellum_image import VellumImage
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class ImageVariableValue(pydantic.BaseModel):
11
+ class ImageVariableValue(pydantic_v1.BaseModel):
16
12
  """
17
13
  A base Vellum primitive value representing an image.
18
14
  """
@@ -30,5 +26,5 @@ class ImageVariableValue(pydantic.BaseModel):
30
26
  class Config:
31
27
  frozen = True
32
28
  smart_union = True
33
- extra = pydantic.Extra.allow
29
+ extra = pydantic_v1.Extra.allow
34
30
  json_encoders = {dt.datetime: serialize_datetime}
@@ -1,41 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import enum
4
3
  import typing
5
4
 
6
- T_Result = typing.TypeVar("T_Result")
7
-
8
-
9
- class IndexingStateEnum(str, enum.Enum):
10
- """
11
- - `AWAITING_PROCESSING` - Awaiting Processing
12
- - `QUEUED` - Queued
13
- - `INDEXING` - Indexing
14
- - `INDEXED` - Indexed
15
- - `FAILED` - Failed
16
- """
17
-
18
- AWAITING_PROCESSING = "AWAITING_PROCESSING"
19
- QUEUED = "QUEUED"
20
- INDEXING = "INDEXING"
21
- INDEXED = "INDEXED"
22
- FAILED = "FAILED"
23
-
24
- def visit(
25
- self,
26
- awaiting_processing: typing.Callable[[], T_Result],
27
- queued: typing.Callable[[], T_Result],
28
- indexing: typing.Callable[[], T_Result],
29
- indexed: typing.Callable[[], T_Result],
30
- failed: typing.Callable[[], T_Result],
31
- ) -> T_Result:
32
- if self is IndexingStateEnum.AWAITING_PROCESSING:
33
- return awaiting_processing()
34
- if self is IndexingStateEnum.QUEUED:
35
- return queued()
36
- if self is IndexingStateEnum.INDEXING:
37
- return indexing()
38
- if self is IndexingStateEnum.INDEXED:
39
- return indexed()
40
- if self is IndexingStateEnum.FAILED:
41
- return failed()
5
+ IndexingStateEnum = typing.Union[
6
+ typing.Literal["AWAITING_PROCESSING", "QUEUED", "INDEXING", "INDEXED", "FAILED"], typing.Any
7
+ ]
@@ -4,15 +4,11 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .initiated_prompt_execution_meta import InitiatedPromptExecutionMeta
8
9
 
9
- try:
10
- import pydantic.v1 as pydantic # type: ignore
11
- except ImportError:
12
- import pydantic # type: ignore
13
10
 
14
-
15
- class InitiatedExecutePromptEvent(pydantic.BaseModel):
11
+ class InitiatedExecutePromptEvent(pydantic_v1.BaseModel):
16
12
  """
17
13
  The initial data returned indicating that the response from the model has returned and begun streaming.
18
14
  """
@@ -31,5 +27,5 @@ class InitiatedExecutePromptEvent(pydantic.BaseModel):
31
27
  class Config:
32
28
  frozen = True
33
29
  smart_union = True
34
- extra = pydantic.Extra.allow
30
+ extra = pydantic_v1.Extra.allow
35
31
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,14 +4,10 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
 
8
- try:
9
- import pydantic.v1 as pydantic # type: ignore
10
- except ImportError:
11
- import pydantic # type: ignore
12
9
 
13
-
14
- class InitiatedPromptExecutionMeta(pydantic.BaseModel):
10
+ class InitiatedPromptExecutionMeta(pydantic_v1.BaseModel):
15
11
  """
16
12
  The subset of the metadata tracked by Vellum during prompt execution that the request opted into with `expand_meta`.
17
13
  """
@@ -32,5 +28,5 @@ class InitiatedPromptExecutionMeta(pydantic.BaseModel):
32
28
  class Config:
33
29
  frozen = True
34
30
  smart_union = True
35
- extra = pydantic.Extra.allow
31
+ extra = pydantic_v1.Extra.allow
36
32
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,16 +4,12 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
  from .node_input_variable_compiled_value import NodeInputVariableCompiledValue
8
9
  from .workflow_node_result_data import WorkflowNodeResultData
9
10
 
10
- try:
11
- import pydantic.v1 as pydantic # type: ignore
12
- except ImportError:
13
- import pydantic # type: ignore
14
11
 
15
-
16
- class InitiatedWorkflowNodeResultEvent(pydantic.BaseModel):
12
+ class InitiatedWorkflowNodeResultEvent(pydantic_v1.BaseModel):
17
13
  """
18
14
  An event that indicates that the node has initiated its execution.
19
15
  """
@@ -37,5 +33,5 @@ class InitiatedWorkflowNodeResultEvent(pydantic.BaseModel):
37
33
  class Config:
38
34
  frozen = True
39
35
  smart_union = True
40
- extra = pydantic.Extra.allow
36
+ extra = pydantic_v1.Extra.allow
41
37
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,19 +4,15 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
 
8
- try:
9
- import pydantic.v1 as pydantic # type: ignore
10
- except ImportError:
11
- import pydantic # type: ignore
12
9
 
13
-
14
- class JsonInputRequest(pydantic.BaseModel):
10
+ class JsonInputRequest(pydantic_v1.BaseModel):
15
11
  """
16
12
  A user input representing a JSON object
17
13
  """
18
14
 
19
- name: str = pydantic.Field()
15
+ name: str = pydantic_v1.Field()
20
16
  """
21
17
  The variable's name, as defined in the deployment.
22
18
  """
@@ -34,5 +30,5 @@ class JsonInputRequest(pydantic.BaseModel):
34
30
  class Config:
35
31
  frozen = True
36
32
  smart_union = True
37
- extra = pydantic.Extra.allow
33
+ extra = pydantic_v1.Extra.allow
38
34
  json_encoders = {dt.datetime: serialize_datetime}
@@ -4,14 +4,10 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import pydantic_v1
7
8
 
8
- try:
9
- import pydantic.v1 as pydantic # type: ignore
10
- except ImportError:
11
- import pydantic # type: ignore
12
9
 
13
-
14
- class JsonVariableValue(pydantic.BaseModel):
10
+ class JsonVariableValue(pydantic_v1.BaseModel):
15
11
  value: typing.Optional[typing.Dict[str, typing.Any]] = None
16
12
 
17
13
  def json(self, **kwargs: typing.Any) -> str:
@@ -25,5 +21,5 @@ class JsonVariableValue(pydantic.BaseModel):
25
21
  class Config:
26
22
  frozen = True
27
23
  smart_union = True
28
- extra = pydantic.Extra.allow
24
+ extra = pydantic_v1.Extra.allow
29
25
  json_encoders = {dt.datetime: serialize_datetime}