arbi 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arbi might be problematic. Click here for more details.

Files changed (202) hide show
  1. arbi-0.2.0/.release-please-manifest.json +3 -0
  2. {arbi-0.1.0 → arbi-0.2.0}/CHANGELOG.md +38 -0
  3. {arbi-0.1.0 → arbi-0.2.0}/PKG-INFO +3 -3
  4. {arbi-0.1.0 → arbi-0.2.0}/README.md +2 -2
  5. {arbi-0.1.0 → arbi-0.2.0}/api.md +13 -1
  6. {arbi-0.1.0 → arbi-0.2.0}/pyproject.toml +58 -2
  7. {arbi-0.1.0 → arbi-0.2.0}/requirements-dev.lock +5 -3
  8. {arbi-0.1.0 → arbi-0.2.0}/requirements.lock +5 -2
  9. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/__init__.py +3 -1
  10. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_base_client.py +12 -12
  11. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_client.py +8 -8
  12. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_compat.py +48 -48
  13. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_models.py +51 -45
  14. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_qs.py +7 -7
  15. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_types.py +53 -12
  16. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/__init__.py +9 -2
  17. arbi-0.2.0/src/arbi/_utils/_compat.py +45 -0
  18. arbi-0.2.0/src/arbi/_utils/_datetime_parse.py +136 -0
  19. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_transform.py +13 -3
  20. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_typing.py +6 -1
  21. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_utils.py +4 -5
  22. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_version.py +1 -1
  23. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/api.py +3 -3
  24. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/assistant.py +17 -17
  25. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/configs.py +41 -33
  26. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/conversation/conversation.py +11 -11
  27. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/conversation/user.py +5 -5
  28. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/document/annotation.py +17 -17
  29. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/document/document.py +166 -33
  30. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/health.py +129 -11
  31. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/sso.py +9 -9
  32. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/tag.py +26 -26
  33. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/user/settings.py +28 -20
  34. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/user/user.py +107 -16
  35. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/workspace.py +69 -39
  36. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/__init__.py +5 -0
  37. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/assistant_query_params.py +16 -4
  38. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/assistant_retrieve_params.py +16 -4
  39. arbi-0.2.0/src/arbi/types/api/config_create_params.py +110 -0
  40. arbi-0.2.0/src/arbi/types/api/config_retrieve_response.py +142 -0
  41. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_retrieve_threads_response.py +13 -2
  42. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_date_extractor_llm_config.py +3 -3
  43. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_date_extractor_llm_config_param.py +3 -3
  44. arbi-0.2.0/src/arbi/types/api/document_upload_from_url_params.py +23 -0
  45. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_upload_params.py +3 -3
  46. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/embedder_config.py +12 -0
  47. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/embedder_config_param.py +12 -0
  48. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/health_check_app_response.py +6 -0
  49. arbi-0.2.0/src/arbi/types/api/health_retrieve_status_response.py +45 -0
  50. arbi-0.2.0/src/arbi/types/api/health_retrieve_version_response.py +8 -0
  51. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/query_llm_config.py +1 -1
  52. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/query_llm_config_param.py +1 -1
  53. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_apply_to_docs_params.py +3 -2
  54. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_remove_from_docs_params.py +3 -2
  55. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/title_llm_config.py +1 -1
  56. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/title_llm_config_param.py +1 -1
  57. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user/setting_retrieve_response.py +10 -1
  58. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user/setting_update_params.py +8 -2
  59. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user_register_params.py +2 -0
  60. arbi-0.2.0/src/arbi/types/api/user_verify_email_params.py +11 -0
  61. arbi-0.2.0/src/arbi/types/api/user_verify_email_response.py +9 -0
  62. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_create_protected_params.py +2 -0
  63. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_response.py +2 -0
  64. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_update_params.py +2 -0
  65. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_assistant.py +32 -4
  66. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_configs.py +56 -2
  67. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_document.py +96 -0
  68. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_health.py +114 -0
  69. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_user.py +75 -0
  70. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_workspace.py +4 -0
  71. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/user/test_settings.py +4 -0
  72. {arbi-0.1.0 → arbi-0.2.0}/tests/test_client.py +6 -47
  73. {arbi-0.1.0 → arbi-0.2.0}/tests/test_models.py +24 -24
  74. {arbi-0.1.0 → arbi-0.2.0}/tests/test_transform.py +17 -10
  75. arbi-0.2.0/tests/test_utils/test_datetime_parse.py +110 -0
  76. {arbi-0.1.0 → arbi-0.2.0}/tests/utils.py +13 -5
  77. arbi-0.1.0/.release-please-manifest.json +0 -3
  78. arbi-0.1.0/mypy.ini +0 -50
  79. arbi-0.1.0/src/arbi/types/api/config_create_params.py +0 -45
  80. arbi-0.1.0/src/arbi/types/api/config_retrieve_response.py +0 -46
  81. {arbi-0.1.0 → arbi-0.2.0}/.gitignore +0 -0
  82. {arbi-0.1.0 → arbi-0.2.0}/CONTRIBUTING.md +0 -0
  83. {arbi-0.1.0 → arbi-0.2.0}/LICENSE +0 -0
  84. {arbi-0.1.0 → arbi-0.2.0}/SECURITY.md +0 -0
  85. {arbi-0.1.0 → arbi-0.2.0}/bin/check-release-environment +0 -0
  86. {arbi-0.1.0 → arbi-0.2.0}/bin/publish-pypi +0 -0
  87. {arbi-0.1.0 → arbi-0.2.0}/examples/.keep +0 -0
  88. {arbi-0.1.0 → arbi-0.2.0}/noxfile.py +0 -0
  89. {arbi-0.1.0 → arbi-0.2.0}/release-please-config.json +0 -0
  90. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_constants.py +0 -0
  91. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_exceptions.py +0 -0
  92. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_files.py +0 -0
  93. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_resource.py +0 -0
  94. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_response.py +0 -0
  95. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_streaming.py +0 -0
  96. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_logs.py +0 -0
  97. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_proxy.py +0 -0
  98. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_reflection.py +0 -0
  99. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_resources_proxy.py +0 -0
  100. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_streams.py +0 -0
  101. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/_utils/_sync.py +0 -0
  102. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/lib/.keep +0 -0
  103. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/py.typed +0 -0
  104. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/__init__.py +0 -0
  105. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/__init__.py +0 -0
  106. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/conversation/__init__.py +0 -0
  107. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/document/__init__.py +0 -0
  108. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/resources/api/user/__init__.py +0 -0
  109. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/__init__.py +0 -0
  110. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/chunker_config_param.py +0 -0
  111. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/config_create_response.py +0 -0
  112. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/config_delete_response.py +0 -0
  113. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/config_get_versions_response.py +0 -0
  114. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation/__init__.py +0 -0
  115. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation/user_add_params.py +0 -0
  116. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation/user_add_response.py +0 -0
  117. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation/user_remove_params.py +0 -0
  118. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation/user_remove_response.py +0 -0
  119. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_delete_message_response.py +0 -0
  120. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_delete_response.py +0 -0
  121. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_share_response.py +0 -0
  122. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_update_title_params.py +0 -0
  123. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/conversation_update_title_response.py +0 -0
  124. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/doc_response.py +0 -0
  125. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document/__init__.py +0 -0
  126. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document/annotation_create_params.py +0 -0
  127. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document/annotation_delete_response.py +0 -0
  128. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document/annotation_update_params.py +0 -0
  129. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document/doc_tag_response.py +0 -0
  130. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_delete_response.py +0 -0
  131. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_get_parsed_response.py +0 -0
  132. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_get_tags_response.py +0 -0
  133. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_update_params.py +0 -0
  134. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_update_response.py +0 -0
  135. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/document_view_params.py +0 -0
  136. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/health_check_models_response.py +0 -0
  137. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/health_check_services_response.py +0 -0
  138. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/health_get_models_response.py +0 -0
  139. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/model_citation_config.py +0 -0
  140. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/model_citation_config_param.py +0 -0
  141. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/parser_config_param.py +0 -0
  142. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/reranker_config.py +0 -0
  143. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/reranker_config_param.py +0 -0
  144. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/retriever_config.py +0 -0
  145. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/retriever_config_param.py +0 -0
  146. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/sso_invite_params.py +0 -0
  147. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/sso_invite_response.py +0 -0
  148. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/sso_login_params.py +0 -0
  149. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/sso_login_response.py +0 -0
  150. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/sso_rotate_passcode_response.py +0 -0
  151. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_apply_to_docs_response.py +0 -0
  152. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_create_params.py +0 -0
  153. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_create_response.py +0 -0
  154. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_delete_response.py +0 -0
  155. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_get_docs_response.py +0 -0
  156. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_remove_from_docs_response.py +0 -0
  157. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_update_params.py +0 -0
  158. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/tag_update_response.py +0 -0
  159. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/token.py +0 -0
  160. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user/__init__.py +0 -0
  161. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user_list_workspaces_response.py +0 -0
  162. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user_login_params.py +0 -0
  163. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user_logout_response.py +0 -0
  164. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/user_response.py +0 -0
  165. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_delete_response.py +0 -0
  166. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_conversations_response.py +0 -0
  167. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_doctags_response.py +0 -0
  168. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_documents_response.py +0 -0
  169. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_stats_response.py +0 -0
  170. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_tags_response.py +0 -0
  171. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_get_users_response.py +0 -0
  172. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_remove_user_params.py +0 -0
  173. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_remove_user_response.py +0 -0
  174. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_share_params.py +0 -0
  175. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/api/workspace_share_response.py +0 -0
  176. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/chunk.py +0 -0
  177. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/chunk_metadata.py +0 -0
  178. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/chunk_metadata_param.py +0 -0
  179. {arbi-0.1.0 → arbi-0.2.0}/src/arbi/types/chunk_param.py +0 -0
  180. {arbi-0.1.0 → arbi-0.2.0}/tests/__init__.py +0 -0
  181. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/__init__.py +0 -0
  182. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/__init__.py +0 -0
  183. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/conversation/__init__.py +0 -0
  184. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/conversation/test_user.py +0 -0
  185. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/document/__init__.py +0 -0
  186. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/document/test_annotation.py +0 -0
  187. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_conversation.py +0 -0
  188. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_sso.py +0 -0
  189. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/test_tag.py +0 -0
  190. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/api/user/__init__.py +0 -0
  191. {arbi-0.1.0 → arbi-0.2.0}/tests/api_resources/test_api.py +0 -0
  192. {arbi-0.1.0 → arbi-0.2.0}/tests/conftest.py +0 -0
  193. {arbi-0.1.0 → arbi-0.2.0}/tests/sample_file.txt +0 -0
  194. {arbi-0.1.0 → arbi-0.2.0}/tests/test_deepcopy.py +0 -0
  195. {arbi-0.1.0 → arbi-0.2.0}/tests/test_extract_files.py +0 -0
  196. {arbi-0.1.0 → arbi-0.2.0}/tests/test_files.py +0 -0
  197. {arbi-0.1.0 → arbi-0.2.0}/tests/test_qs.py +0 -0
  198. {arbi-0.1.0 → arbi-0.2.0}/tests/test_required_args.py +0 -0
  199. {arbi-0.1.0 → arbi-0.2.0}/tests/test_response.py +0 -0
  200. {arbi-0.1.0 → arbi-0.2.0}/tests/test_streaming.py +0 -0
  201. {arbi-0.1.0 → arbi-0.2.0}/tests/test_utils/test_proxy.py +0 -0
  202. {arbi-0.1.0 → arbi-0.2.0}/tests/test_utils/test_typing.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.2.0"
3
+ }
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 (2025-10-13)
4
+
5
+ Full Changelog: [v0.1.1...v0.2.0](https://github.com/arbitrationcity/arbi-python/compare/v0.1.1...v0.2.0)
6
+
7
+ ### Features
8
+
9
+ * DRAFT add email verification requirement for local user registration ([ba914da](https://github.com/arbitrationcity/arbi-python/commit/ba914dae291c8b58df7bfd3be5d01e27cdf456b7))
10
+ * implement public workspaces with deployment key encryption ([9b25ecd](https://github.com/arbitrationcity/arbi-python/commit/9b25ecdced445221b56e1bd45caa44af7039d76d))
11
+ * improve future compat with pydantic v3 ([be64906](https://github.com/arbitrationcity/arbi-python/commit/be64906d140b119239ab09b23564ada62ed4e7f4))
12
+ * Llamaindex agent featureflag ([0464f7a](https://github.com/arbitrationcity/arbi-python/commit/0464f7af287125546d87896d6316d3b34aa1c9a1))
13
+ * **types:** replace List[str] with SequenceNotStr in params ([bcc155b](https://github.com/arbitrationcity/arbi-python/commit/bcc155b44acb974cc0d72cf8ce20918f59f5c5e5))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * avoid newer type syntax ([2008b65](https://github.com/arbitrationcity/arbi-python/commit/2008b653d1baba6824f79da6183fdbdf2543f605))
19
+ * **compat:** compat with `pydantic<2.8.0` when using additional fields ([0bc83c2](https://github.com/arbitrationcity/arbi-python/commit/0bc83c26322edf26307d9d1bfd4f26d0e4d131b3))
20
+
21
+
22
+ ### Chores
23
+
24
+ * do not install brew dependencies in ./scripts/bootstrap by default ([6dfd710](https://github.com/arbitrationcity/arbi-python/commit/6dfd710821d6a0f81b42c65c40fdc91631769681))
25
+ * **internal:** add Sequence related utils ([07de38e](https://github.com/arbitrationcity/arbi-python/commit/07de38eb8a532b5e82dfbbcf840afbdd55c38ac6))
26
+ * **internal:** detect missing future annotations with ruff ([9740de5](https://github.com/arbitrationcity/arbi-python/commit/9740de55f5783fc2a8e9d0823ed09ec677b9a2c0))
27
+ * **internal:** move mypy configurations to `pyproject.toml` file ([3907f70](https://github.com/arbitrationcity/arbi-python/commit/3907f7002aef0fa434c3cf024a36d1ec58b3d79d))
28
+ * **internal:** update pydantic dependency ([89b016f](https://github.com/arbitrationcity/arbi-python/commit/89b016f708b3dd946973de2d9047688faf199f9d))
29
+ * **internal:** update pyright exclude list ([7c356cf](https://github.com/arbitrationcity/arbi-python/commit/7c356cf1faea5ec7c787b961a07a4630f60b2805))
30
+ * **tests:** simplify `get_platform` test ([b011a08](https://github.com/arbitrationcity/arbi-python/commit/b011a08fb145b126dbadb6847a1f43d8a8ee062b))
31
+ * **types:** change optional parameter type from NotGiven to Omit ([4d1fbc7](https://github.com/arbitrationcity/arbi-python/commit/4d1fbc7bfeb2ef9a88f3458ae9ec7f5a0f932a8f))
32
+
33
+ ## 0.1.1 (2025-08-26)
34
+
35
+ Full Changelog: [v0.1.0...v0.1.1](https://github.com/arbitrationcity/arbi-python/compare/v0.1.0...v0.1.1)
36
+
37
+ ### Chores
38
+
39
+ * **internal:** change ci workflow machines ([54e1ad5](https://github.com/arbitrationcity/arbi-python/commit/54e1ad548a490aced615402fef6069f8fb062346))
40
+
3
41
  ## 0.1.0 (2025-08-24)
4
42
 
5
43
  Full Changelog: [v0.1.0-alpha.1...v0.1.0](https://github.com/arbitrationcity/arbi-python/compare/v0.1.0-alpha.1...v0.1.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arbi
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: The official Python library for the arbi API
5
5
  Project-URL: Homepage, https://github.com/arbitrationcity/arbi-python
6
6
  Project-URL: Repository, https://github.com/arbitrationcity/arbi-python
@@ -147,9 +147,9 @@ from arbi import Arbi
147
147
  client = Arbi()
148
148
 
149
149
  config = client.api.configs.create(
150
- document_date_extractor_llm={},
150
+ agent_llm={},
151
151
  )
152
- print(config.document_date_extractor_llm)
152
+ print(config.agent_llm)
153
153
  ```
154
154
 
155
155
  ## Handling errors
@@ -112,9 +112,9 @@ from arbi import Arbi
112
112
  client = Arbi()
113
113
 
114
114
  config = client.api.configs.create(
115
- document_date_extractor_llm={},
115
+ agent_llm={},
116
116
  )
117
- print(config.document_date_extractor_llm)
117
+ print(config.agent_llm)
118
118
  ```
119
119
 
120
120
  ## Handling errors
@@ -15,7 +15,13 @@ Methods:
15
15
  Types:
16
16
 
17
17
  ```python
18
- from arbi.types.api import Token, UserResponse, UserListWorkspacesResponse, UserLogoutResponse
18
+ from arbi.types.api import (
19
+ Token,
20
+ UserResponse,
21
+ UserListWorkspacesResponse,
22
+ UserLogoutResponse,
23
+ UserVerifyEmailResponse,
24
+ )
19
25
  ```
20
26
 
21
27
  Methods:
@@ -26,6 +32,7 @@ Methods:
26
32
  - <code title="post /api/user/token_refresh">client.api.user.<a href="./src/arbi/resources/api/user/user.py">refresh_token</a>() -> <a href="./src/arbi/types/api/token.py">Token</a></code>
27
33
  - <code title="post /api/user/register">client.api.user.<a href="./src/arbi/resources/api/user/user.py">register</a>(\*\*<a href="src/arbi/types/api/user_register_params.py">params</a>) -> <a href="./src/arbi/types/api/user_response.py">UserResponse</a></code>
28
34
  - <code title="get /api/user/me">client.api.user.<a href="./src/arbi/resources/api/user/user.py">retrieve_me</a>() -> <a href="./src/arbi/types/api/user_response.py">UserResponse</a></code>
35
+ - <code title="post /api/user/verify-email">client.api.user.<a href="./src/arbi/resources/api/user/user.py">verify_email</a>(\*\*<a href="src/arbi/types/api/user_verify_email_params.py">params</a>) -> <a href="./src/arbi/types/api/user_verify_email_response.py">UserVerifyEmailResponse</a></code>
29
36
 
30
37
  ### Settings
31
38
 
@@ -110,6 +117,7 @@ Methods:
110
117
  - <code title="get /api/document/{document_ext_id}/parsed-{stage}">client.api.document.<a href="./src/arbi/resources/api/document/document.py">get_parsed</a>(stage, \*, document_ext_id) -> <a href="./src/arbi/types/api/document_get_parsed_response.py">DocumentGetParsedResponse</a></code>
111
118
  - <code title="get /api/document/{doc_ext_id}/tags">client.api.document.<a href="./src/arbi/resources/api/document/document.py">get_tags</a>(doc_ext_id) -> <a href="./src/arbi/types/api/document_get_tags_response.py">DocumentGetTagsResponse</a></code>
112
119
  - <code title="post /api/document/upload">client.api.document.<a href="./src/arbi/resources/api/document/document.py">upload</a>(\*\*<a href="src/arbi/types/api/document_upload_params.py">params</a>) -> object</code>
120
+ - <code title="post /api/document/upload-url">client.api.document.<a href="./src/arbi/resources/api/document/document.py">upload_from_url</a>(\*\*<a href="src/arbi/types/api/document_upload_from_url_params.py">params</a>) -> object</code>
113
121
  - <code title="get /api/document/{document_ext_id}/view">client.api.document.<a href="./src/arbi/resources/api/document/document.py">view</a>(document_ext_id, \*\*<a href="src/arbi/types/api/document_view_params.py">params</a>) -> object</code>
114
122
 
115
123
  ### Annotation
@@ -184,6 +192,8 @@ from arbi.types.api import (
184
192
  HealthCheckModelsResponse,
185
193
  HealthCheckServicesResponse,
186
194
  HealthGetModelsResponse,
195
+ HealthRetrieveStatusResponse,
196
+ HealthRetrieveVersionResponse,
187
197
  )
188
198
  ```
189
199
 
@@ -193,6 +203,8 @@ Methods:
193
203
  - <code title="get /api/health/remote-models">client.api.health.<a href="./src/arbi/resources/api/health.py">check_models</a>() -> <a href="./src/arbi/types/api/health_check_models_response.py">HealthCheckModelsResponse</a></code>
194
204
  - <code title="get /api/health/services">client.api.health.<a href="./src/arbi/resources/api/health.py">check_services</a>() -> <a href="./src/arbi/types/api/health_check_services_response.py">HealthCheckServicesResponse</a></code>
195
205
  - <code title="get /api/health/models">client.api.health.<a href="./src/arbi/resources/api/health.py">get_models</a>() -> <a href="./src/arbi/types/api/health_get_models_response.py">HealthGetModelsResponse</a></code>
206
+ - <code title="get /api/health/">client.api.health.<a href="./src/arbi/resources/api/health.py">retrieve_status</a>() -> <a href="./src/arbi/types/api/health_retrieve_status_response.py">HealthRetrieveStatusResponse</a></code>
207
+ - <code title="get /api/health/version">client.api.health.<a href="./src/arbi/resources/api/health.py">retrieve_version</a>() -> <a href="./src/arbi/types/api/health_retrieve_version_response.py">HealthRetrieveVersionResponse</a></code>
196
208
 
197
209
  ## Tag
198
210
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arbi"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  description = "The official Python library for the arbi API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -56,7 +56,6 @@ dev-dependencies = [
56
56
  "dirty-equals>=0.6.0",
57
57
  "importlib-metadata>=6.7.0",
58
58
  "rich>=13.7.1",
59
- "nest_asyncio==1.6.0",
60
59
  "pytest-xdist>=3.6.1",
61
60
  ]
62
61
 
@@ -148,6 +147,7 @@ exclude = [
148
147
  "_dev",
149
148
  ".venv",
150
149
  ".nox",
150
+ ".git",
151
151
  ]
152
152
 
153
153
  reportImplicitOverride = true
@@ -156,6 +156,58 @@ reportOverlappingOverload = false
156
156
  reportImportCycles = false
157
157
  reportPrivateUsage = false
158
158
 
159
+ [tool.mypy]
160
+ pretty = true
161
+ show_error_codes = true
162
+
163
+ # Exclude _files.py because mypy isn't smart enough to apply
164
+ # the correct type narrowing and as this is an internal module
165
+ # it's fine to just use Pyright.
166
+ #
167
+ # We also exclude our `tests` as mypy doesn't always infer
168
+ # types correctly and Pyright will still catch any type errors.
169
+ exclude = ['src/arbi/_files.py', '_dev/.*.py', 'tests/.*']
170
+
171
+ strict_equality = true
172
+ implicit_reexport = true
173
+ check_untyped_defs = true
174
+ no_implicit_optional = true
175
+
176
+ warn_return_any = true
177
+ warn_unreachable = true
178
+ warn_unused_configs = true
179
+
180
+ # Turn these options off as it could cause conflicts
181
+ # with the Pyright options.
182
+ warn_unused_ignores = false
183
+ warn_redundant_casts = false
184
+
185
+ disallow_any_generics = true
186
+ disallow_untyped_defs = true
187
+ disallow_untyped_calls = true
188
+ disallow_subclassing_any = true
189
+ disallow_incomplete_defs = true
190
+ disallow_untyped_decorators = true
191
+ cache_fine_grained = true
192
+
193
+ # By default, mypy reports an error if you assign a value to the result
194
+ # of a function call that doesn't return anything. We do this in our test
195
+ # cases:
196
+ # ```
197
+ # result = ...
198
+ # assert result is None
199
+ # ```
200
+ # Changing this codegen to make mypy happy would increase complexity
201
+ # and would not be worth it.
202
+ disable_error_code = "func-returns-value,overload-cannot-match"
203
+
204
+ # https://github.com/python/mypy/issues/12162
205
+ [[tool.mypy.overrides]]
206
+ module = "black.files.*"
207
+ ignore_errors = true
208
+ ignore_missing_imports = true
209
+
210
+
159
211
  [tool.ruff]
160
212
  line-length = 120
161
213
  output-format = "grouped"
@@ -172,6 +224,8 @@ select = [
172
224
  "B",
173
225
  # remove unused imports
174
226
  "F401",
227
+ # check for missing future annotations
228
+ "FA102",
175
229
  # bare except statements
176
230
  "E722",
177
231
  # unused arguments
@@ -194,6 +248,8 @@ unfixable = [
194
248
  "T203",
195
249
  ]
196
250
 
251
+ extend-safe-fixes = ["FA102"]
252
+
197
253
  [tool.ruff.lint.flake8-tidy-imports.banned-api]
198
254
  "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
199
255
 
@@ -75,7 +75,6 @@ multidict==6.4.4
75
75
  mypy==1.14.1
76
76
  mypy-extensions==1.0.0
77
77
  # via mypy
78
- nest-asyncio==1.6.0
79
78
  nodeenv==1.8.0
80
79
  # via pyright
81
80
  nox==2023.4.22
@@ -89,9 +88,9 @@ pluggy==1.5.0
89
88
  propcache==0.3.1
90
89
  # via aiohttp
91
90
  # via yarl
92
- pydantic==2.10.3
91
+ pydantic==2.11.9
93
92
  # via arbi
94
- pydantic-core==2.27.1
93
+ pydantic-core==2.33.2
95
94
  # via pydantic
96
95
  pygments==2.18.0
97
96
  # via rich
@@ -127,6 +126,9 @@ typing-extensions==4.12.2
127
126
  # via pydantic
128
127
  # via pydantic-core
129
128
  # via pyright
129
+ # via typing-inspection
130
+ typing-inspection==0.4.1
131
+ # via pydantic
130
132
  virtualenv==20.24.5
131
133
  # via nox
132
134
  yarl==1.20.0
@@ -55,9 +55,9 @@ multidict==6.4.4
55
55
  propcache==0.3.1
56
56
  # via aiohttp
57
57
  # via yarl
58
- pydantic==2.10.3
58
+ pydantic==2.11.9
59
59
  # via arbi
60
- pydantic-core==2.27.1
60
+ pydantic-core==2.33.2
61
61
  # via pydantic
62
62
  sniffio==1.3.0
63
63
  # via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
68
68
  # via multidict
69
69
  # via pydantic
70
70
  # via pydantic-core
71
+ # via typing-inspection
72
+ typing-inspection==0.4.1
73
+ # via pydantic
71
74
  yarl==1.20.0
72
75
  # via aiohttp
@@ -3,7 +3,7 @@
3
3
  import typing as _t
4
4
 
5
5
  from . import types
6
- from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6
+ from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
7
7
  from ._utils import file_from_path
8
8
  from ._client import Arbi, Client, Stream, Timeout, AsyncArbi, Transport, AsyncClient, AsyncStream, RequestOptions
9
9
  from ._models import BaseModel
@@ -38,7 +38,9 @@ __all__ = [
38
38
  "ProxiesTypes",
39
39
  "NotGiven",
40
40
  "NOT_GIVEN",
41
+ "not_given",
41
42
  "Omit",
43
+ "omit",
42
44
  "ArbiError",
43
45
  "APIError",
44
46
  "APIStatusError",
@@ -42,7 +42,6 @@ from . import _exceptions
42
42
  from ._qs import Querystring
43
43
  from ._files import to_httpx_files, async_to_httpx_files
44
44
  from ._types import (
45
- NOT_GIVEN,
46
45
  Body,
47
46
  Omit,
48
47
  Query,
@@ -57,9 +56,10 @@ from ._types import (
57
56
  RequestOptions,
58
57
  HttpxRequestFiles,
59
58
  ModelBuilderProtocol,
59
+ not_given,
60
60
  )
61
61
  from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62
- from ._compat import PYDANTIC_V2, model_copy, model_dump
62
+ from ._compat import PYDANTIC_V1, model_copy, model_dump
63
63
  from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
64
64
  from ._response import (
65
65
  APIResponse,
@@ -145,9 +145,9 @@ class PageInfo:
145
145
  def __init__(
146
146
  self,
147
147
  *,
148
- url: URL | NotGiven = NOT_GIVEN,
149
- json: Body | NotGiven = NOT_GIVEN,
150
- params: Query | NotGiven = NOT_GIVEN,
148
+ url: URL | NotGiven = not_given,
149
+ json: Body | NotGiven = not_given,
150
+ params: Query | NotGiven = not_given,
151
151
  ) -> None:
152
152
  self.url = url
153
153
  self.json = json
@@ -232,7 +232,7 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
232
232
  model: Type[_T],
233
233
  options: FinalRequestOptions,
234
234
  ) -> None:
235
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
235
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
236
236
  self.__pydantic_private__ = {}
237
237
 
238
238
  self._model = model
@@ -320,7 +320,7 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
320
320
  client: AsyncAPIClient,
321
321
  options: FinalRequestOptions,
322
322
  ) -> None:
323
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
323
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
324
324
  self.__pydantic_private__ = {}
325
325
 
326
326
  self._model = model
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
595
595
  # we internally support defining a temporary header to override the
596
596
  # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597
597
  # see _response.py for implementation details
598
- override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598
+ override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599
599
  if is_given(override_cast_to):
600
600
  options.headers = headers
601
601
  return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
825
825
  version: str,
826
826
  base_url: str | URL,
827
827
  max_retries: int = DEFAULT_MAX_RETRIES,
828
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828
+ timeout: float | Timeout | None | NotGiven = not_given,
829
829
  http_client: httpx.Client | None = None,
830
830
  custom_headers: Mapping[str, str] | None = None,
831
831
  custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1356
1356
  base_url: str | URL,
1357
1357
  _strict_response_validation: bool,
1358
1358
  max_retries: int = DEFAULT_MAX_RETRIES,
1359
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359
+ timeout: float | Timeout | None | NotGiven = not_given,
1360
1360
  http_client: httpx.AsyncClient | None = None,
1361
1361
  custom_headers: Mapping[str, str] | None = None,
1362
1362
  custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
1818
1818
  extra_query: Query | None = None,
1819
1819
  extra_body: Body | None = None,
1820
1820
  idempotency_key: str | None = None,
1821
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822
- post_parser: PostParser | NotGiven = NOT_GIVEN,
1821
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822
+ post_parser: PostParser | NotGiven = not_given,
1823
1823
  ) -> RequestOptions:
1824
1824
  """Create a dict of type RequestOptions without keys of NotGiven values."""
1825
1825
  options: RequestOptions = {}
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
- from typing import Any, Union, Mapping
6
+ from typing import Any, Mapping
7
7
  from typing_extensions import Self, override
8
8
 
9
9
  import httpx
@@ -11,13 +11,13 @@ import httpx
11
11
  from . import _exceptions
12
12
  from ._qs import Querystring
13
13
  from ._types import (
14
- NOT_GIVEN,
15
14
  Omit,
16
15
  Timeout,
17
16
  NotGiven,
18
17
  Transport,
19
18
  ProxiesTypes,
20
19
  RequestOptions,
20
+ not_given,
21
21
  )
22
22
  from ._utils import is_given, get_async_library
23
23
  from ._version import __version__
@@ -46,7 +46,7 @@ class Arbi(SyncAPIClient):
46
46
  *,
47
47
  api_key: str | None = None,
48
48
  base_url: str | httpx.URL | None = None,
49
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
49
+ timeout: float | Timeout | None | NotGiven = not_given,
50
50
  max_retries: int = DEFAULT_MAX_RETRIES,
51
51
  default_headers: Mapping[str, str] | None = None,
52
52
  default_query: Mapping[str, object] | None = None,
@@ -121,9 +121,9 @@ class Arbi(SyncAPIClient):
121
121
  *,
122
122
  api_key: str | None = None,
123
123
  base_url: str | httpx.URL | None = None,
124
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
124
+ timeout: float | Timeout | None | NotGiven = not_given,
125
125
  http_client: httpx.Client | None = None,
126
- max_retries: int | NotGiven = NOT_GIVEN,
126
+ max_retries: int | NotGiven = not_given,
127
127
  default_headers: Mapping[str, str] | None = None,
128
128
  set_default_headers: Mapping[str, str] | None = None,
129
129
  default_query: Mapping[str, object] | None = None,
@@ -214,7 +214,7 @@ class AsyncArbi(AsyncAPIClient):
214
214
  *,
215
215
  api_key: str | None = None,
216
216
  base_url: str | httpx.URL | None = None,
217
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
217
+ timeout: float | Timeout | None | NotGiven = not_given,
218
218
  max_retries: int = DEFAULT_MAX_RETRIES,
219
219
  default_headers: Mapping[str, str] | None = None,
220
220
  default_query: Mapping[str, object] | None = None,
@@ -289,9 +289,9 @@ class AsyncArbi(AsyncAPIClient):
289
289
  *,
290
290
  api_key: str | None = None,
291
291
  base_url: str | httpx.URL | None = None,
292
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
292
+ timeout: float | Timeout | None | NotGiven = not_given,
293
293
  http_client: httpx.AsyncClient | None = None,
294
- max_retries: int | NotGiven = NOT_GIVEN,
294
+ max_retries: int | NotGiven = not_given,
295
295
  default_headers: Mapping[str, str] | None = None,
296
296
  set_default_headers: Mapping[str, str] | None = None,
297
297
  default_query: Mapping[str, object] | None = None,
@@ -12,14 +12,13 @@ from ._types import IncEx, StrBytesIntFloat
12
12
  _T = TypeVar("_T")
13
13
  _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
14
14
 
15
- # --------------- Pydantic v2 compatibility ---------------
15
+ # --------------- Pydantic v2, v3 compatibility ---------------
16
16
 
17
17
  # Pyright incorrectly reports some of our functions as overriding a method when they don't
18
18
  # pyright: reportIncompatibleMethodOverride=false
19
19
 
20
- PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
20
+ PYDANTIC_V1 = pydantic.VERSION.startswith("1.")
21
21
 
22
- # v1 re-exports
23
22
  if TYPE_CHECKING:
24
23
 
25
24
  def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001
@@ -44,90 +43,92 @@ if TYPE_CHECKING:
44
43
  ...
45
44
 
46
45
  else:
47
- if PYDANTIC_V2:
48
- from pydantic.v1.typing import (
46
+ # v1 re-exports
47
+ if PYDANTIC_V1:
48
+ from pydantic.typing import (
49
49
  get_args as get_args,
50
50
  is_union as is_union,
51
51
  get_origin as get_origin,
52
52
  is_typeddict as is_typeddict,
53
53
  is_literal_type as is_literal_type,
54
54
  )
55
- from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
55
+ from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
56
56
  else:
57
- from pydantic.typing import (
57
+ from ._utils import (
58
58
  get_args as get_args,
59
59
  is_union as is_union,
60
60
  get_origin as get_origin,
61
+ parse_date as parse_date,
61
62
  is_typeddict as is_typeddict,
63
+ parse_datetime as parse_datetime,
62
64
  is_literal_type as is_literal_type,
63
65
  )
64
- from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
65
66
 
66
67
 
67
68
  # refactored config
68
69
  if TYPE_CHECKING:
69
70
  from pydantic import ConfigDict as ConfigDict
70
71
  else:
71
- if PYDANTIC_V2:
72
- from pydantic import ConfigDict
73
- else:
72
+ if PYDANTIC_V1:
74
73
  # TODO: provide an error message here?
75
74
  ConfigDict = None
75
+ else:
76
+ from pydantic import ConfigDict as ConfigDict
76
77
 
77
78
 
78
79
  # renamed methods / properties
79
80
  def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
80
- if PYDANTIC_V2:
81
- return model.model_validate(value)
82
- else:
81
+ if PYDANTIC_V1:
83
82
  return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
83
+ else:
84
+ return model.model_validate(value)
84
85
 
85
86
 
86
87
  def field_is_required(field: FieldInfo) -> bool:
87
- if PYDANTIC_V2:
88
- return field.is_required()
89
- return field.required # type: ignore
88
+ if PYDANTIC_V1:
89
+ return field.required # type: ignore
90
+ return field.is_required()
90
91
 
91
92
 
92
93
  def field_get_default(field: FieldInfo) -> Any:
93
94
  value = field.get_default()
94
- if PYDANTIC_V2:
95
- from pydantic_core import PydanticUndefined
96
-
97
- if value == PydanticUndefined:
98
- return None
95
+ if PYDANTIC_V1:
99
96
  return value
97
+ from pydantic_core import PydanticUndefined
98
+
99
+ if value == PydanticUndefined:
100
+ return None
100
101
  return value
101
102
 
102
103
 
103
104
  def field_outer_type(field: FieldInfo) -> Any:
104
- if PYDANTIC_V2:
105
- return field.annotation
106
- return field.outer_type_ # type: ignore
105
+ if PYDANTIC_V1:
106
+ return field.outer_type_ # type: ignore
107
+ return field.annotation
107
108
 
108
109
 
109
110
  def get_model_config(model: type[pydantic.BaseModel]) -> Any:
110
- if PYDANTIC_V2:
111
- return model.model_config
112
- return model.__config__ # type: ignore
111
+ if PYDANTIC_V1:
112
+ return model.__config__ # type: ignore
113
+ return model.model_config
113
114
 
114
115
 
115
116
  def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
116
- if PYDANTIC_V2:
117
- return model.model_fields
118
- return model.__fields__ # type: ignore
117
+ if PYDANTIC_V1:
118
+ return model.__fields__ # type: ignore
119
+ return model.model_fields
119
120
 
120
121
 
121
122
  def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
122
- if PYDANTIC_V2:
123
- return model.model_copy(deep=deep)
124
- return model.copy(deep=deep) # type: ignore
123
+ if PYDANTIC_V1:
124
+ return model.copy(deep=deep) # type: ignore
125
+ return model.model_copy(deep=deep)
125
126
 
126
127
 
127
128
  def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
128
- if PYDANTIC_V2:
129
- return model.model_dump_json(indent=indent)
130
- return model.json(indent=indent) # type: ignore
129
+ if PYDANTIC_V1:
130
+ return model.json(indent=indent) # type: ignore
131
+ return model.model_dump_json(indent=indent)
131
132
 
132
133
 
133
134
  def model_dump(
@@ -139,14 +140,14 @@ def model_dump(
139
140
  warnings: bool = True,
140
141
  mode: Literal["json", "python"] = "python",
141
142
  ) -> dict[str, Any]:
142
- if PYDANTIC_V2 or hasattr(model, "model_dump"):
143
+ if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
143
144
  return model.model_dump(
144
145
  mode=mode,
145
146
  exclude=exclude,
146
147
  exclude_unset=exclude_unset,
147
148
  exclude_defaults=exclude_defaults,
148
149
  # warnings are not supported in Pydantic v1
149
- warnings=warnings if PYDANTIC_V2 else True,
150
+ warnings=True if PYDANTIC_V1 else warnings,
150
151
  )
151
152
  return cast(
152
153
  "dict[str, Any]",
@@ -159,9 +160,9 @@ def model_dump(
159
160
 
160
161
 
161
162
  def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
162
- if PYDANTIC_V2:
163
- return model.model_validate(data)
164
- return model.parse_obj(data) # pyright: ignore[reportDeprecated]
163
+ if PYDANTIC_V1:
164
+ return model.parse_obj(data) # pyright: ignore[reportDeprecated]
165
+ return model.model_validate(data)
165
166
 
166
167
 
167
168
  # generic models
@@ -170,17 +171,16 @@ if TYPE_CHECKING:
170
171
  class GenericModel(pydantic.BaseModel): ...
171
172
 
172
173
  else:
173
- if PYDANTIC_V2:
174
+ if PYDANTIC_V1:
175
+ import pydantic.generics
176
+
177
+ class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
178
+ else:
174
179
  # there no longer needs to be a distinction in v2 but
175
180
  # we still have to create our own subclass to avoid
176
181
  # inconsistent MRO ordering errors
177
182
  class GenericModel(pydantic.BaseModel): ...
178
183
 
179
- else:
180
- import pydantic.generics
181
-
182
- class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
183
-
184
184
 
185
185
  # cached properties
186
186
  if TYPE_CHECKING: