anthropic 0.65.0__tar.gz → 0.67.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.
Files changed (441) hide show
  1. anthropic-0.67.0/.release-please-manifest.json +3 -0
  2. {anthropic-0.65.0 → anthropic-0.67.0}/CHANGELOG.md +29 -0
  3. {anthropic-0.65.0 → anthropic-0.67.0}/PKG-INFO +1 -1
  4. {anthropic-0.65.0 → anthropic-0.67.0}/api.md +10 -0
  5. {anthropic-0.65.0 → anthropic-0.67.0}/pyproject.toml +56 -1
  6. {anthropic-0.65.0 → anthropic-0.67.0}/requirements-dev.lock +1 -1
  7. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_base_client.py +3 -3
  8. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_compat.py +48 -48
  9. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_models.py +41 -41
  10. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/__init__.py +8 -2
  11. anthropic-0.67.0/src/anthropic/_utils/_compat.py +45 -0
  12. anthropic-0.67.0/src/anthropic/_utils/_datetime_parse.py +136 -0
  13. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_transform.py +5 -1
  14. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_typing.py +1 -1
  15. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_utils.py +0 -1
  16. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_version.py +1 -1
  17. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/__init__.py +14 -0
  18. anthropic-0.67.0/src/anthropic/types/beta/beta_base64_pdf_source.py +15 -0
  19. anthropic-0.67.0/src/anthropic/types/beta/beta_citation_config.py +9 -0
  20. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_content_block.py +2 -0
  21. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_content_block_param.py +4 -0
  22. anthropic-0.67.0/src/anthropic/types/beta/beta_document_block.py +26 -0
  23. anthropic-0.67.0/src/anthropic/types/beta/beta_plain_text_source.py +15 -0
  24. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_content_block_start_event.py +2 -0
  25. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_request_document_block_param.py +1 -1
  26. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_server_tool_usage.py +3 -0
  27. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_server_tool_use_block.py +1 -1
  28. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_server_tool_use_block_param.py +3 -1
  29. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_result_block_param.py +4 -1
  30. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_union_param.py +2 -0
  31. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_block.py +21 -0
  32. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_block_param.py +22 -0
  33. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py +46 -0
  34. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_result_block.py +20 -0
  35. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py +25 -0
  36. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py +14 -0
  37. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py +15 -0
  38. anthropic-0.67.0/src/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py +16 -0
  39. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/message_count_tokens_params.py +2 -0
  40. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/document_block_param.py +1 -1
  41. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_result_block_param.py +2 -1
  42. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/test_beta_messages.py +2 -2
  43. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/test_messages.py +2 -2
  44. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_models.py +24 -24
  45. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_transform.py +8 -8
  46. anthropic-0.67.0/tests/test_utils/test_datetime_parse.py +110 -0
  47. {anthropic-0.65.0 → anthropic-0.67.0}/tests/utils.py +4 -4
  48. {anthropic-0.65.0 → anthropic-0.67.0}/uv.lock +4 -4
  49. anthropic-0.65.0/.release-please-manifest.json +0 -3
  50. anthropic-0.65.0/mypy.ini +0 -53
  51. {anthropic-0.65.0 → anthropic-0.67.0}/.gitignore +0 -0
  52. {anthropic-0.65.0 → anthropic-0.67.0}/CONTRIBUTING.md +0 -0
  53. {anthropic-0.65.0 → anthropic-0.67.0}/LICENSE +0 -0
  54. {anthropic-0.65.0 → anthropic-0.67.0}/README.md +0 -0
  55. {anthropic-0.65.0 → anthropic-0.67.0}/SECURITY.md +0 -0
  56. {anthropic-0.65.0 → anthropic-0.67.0}/bin/check-release-environment +0 -0
  57. {anthropic-0.65.0 → anthropic-0.67.0}/bin/publish-pypi +0 -0
  58. {anthropic-0.65.0 → anthropic-0.67.0}/examples/.keep +0 -0
  59. {anthropic-0.65.0 → anthropic-0.67.0}/examples/batch_results.py +0 -0
  60. {anthropic-0.65.0 → anthropic-0.67.0}/examples/bedrock.py +0 -0
  61. {anthropic-0.65.0 → anthropic-0.67.0}/examples/images.py +0 -0
  62. {anthropic-0.65.0 → anthropic-0.67.0}/examples/logo.png +0 -0
  63. {anthropic-0.65.0 → anthropic-0.67.0}/examples/mcp.py +0 -0
  64. {anthropic-0.65.0 → anthropic-0.67.0}/examples/messages.py +0 -0
  65. {anthropic-0.65.0 → anthropic-0.67.0}/examples/messages_stream.py +0 -0
  66. {anthropic-0.65.0 → anthropic-0.67.0}/examples/text_completions_demo_async.py +0 -0
  67. {anthropic-0.65.0 → anthropic-0.67.0}/examples/text_completions_demo_sync.py +0 -0
  68. {anthropic-0.65.0 → anthropic-0.67.0}/examples/text_completions_streaming.py +0 -0
  69. {anthropic-0.65.0 → anthropic-0.67.0}/examples/thinking.py +0 -0
  70. {anthropic-0.65.0 → anthropic-0.67.0}/examples/thinking_stream.py +0 -0
  71. {anthropic-0.65.0 → anthropic-0.67.0}/examples/tools.py +0 -0
  72. {anthropic-0.65.0 → anthropic-0.67.0}/examples/tools_stream.py +0 -0
  73. {anthropic-0.65.0 → anthropic-0.67.0}/examples/vertex.py +0 -0
  74. {anthropic-0.65.0 → anthropic-0.67.0}/examples/web_search.py +0 -0
  75. {anthropic-0.65.0 → anthropic-0.67.0}/examples/web_search_stream.py +0 -0
  76. {anthropic-0.65.0 → anthropic-0.67.0}/helpers.md +0 -0
  77. {anthropic-0.65.0 → anthropic-0.67.0}/release-please-config.json +0 -0
  78. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/__init__.py +0 -0
  79. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_client.py +0 -0
  80. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_constants.py +0 -0
  81. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_decoders/jsonl.py +0 -0
  82. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_exceptions.py +0 -0
  83. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_files.py +0 -0
  84. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_legacy_response.py +0 -0
  85. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_qs.py +0 -0
  86. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_resource.py +0 -0
  87. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_response.py +0 -0
  88. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_streaming.py +0 -0
  89. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_types.py +0 -0
  90. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_httpx.py +0 -0
  91. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_logs.py +0 -0
  92. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_proxy.py +0 -0
  93. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_reflection.py +0 -0
  94. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_resources_proxy.py +0 -0
  95. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_streams.py +0 -0
  96. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/_utils/_sync.py +0 -0
  97. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/.keep +0 -0
  98. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/__init__.py +0 -0
  99. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/_extras/__init__.py +0 -0
  100. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/_extras/_common.py +0 -0
  101. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/_extras/_google_auth.py +0 -0
  102. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/__init__.py +0 -0
  103. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_auth.py +0 -0
  104. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_beta.py +0 -0
  105. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_beta_messages.py +0 -0
  106. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_client.py +0 -0
  107. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_stream.py +0 -0
  108. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/bedrock/_stream_decoder.py +0 -0
  109. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/streaming/__init__.py +0 -0
  110. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/streaming/_beta_messages.py +0 -0
  111. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/streaming/_beta_types.py +0 -0
  112. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/streaming/_messages.py +0 -0
  113. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/streaming/_types.py +0 -0
  114. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/vertex/__init__.py +0 -0
  115. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/vertex/_auth.py +0 -0
  116. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/vertex/_beta.py +0 -0
  117. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/vertex/_beta_messages.py +0 -0
  118. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/lib/vertex/_client.py +0 -0
  119. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/pagination.py +0 -0
  120. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/py.typed +0 -0
  121. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/__init__.py +0 -0
  122. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/__init__.py +0 -0
  123. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/beta.py +0 -0
  124. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/files.py +0 -0
  125. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/messages/__init__.py +0 -0
  126. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/messages/batches.py +0 -0
  127. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/messages/messages.py +0 -0
  128. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/beta/models.py +0 -0
  129. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/completions.py +0 -0
  130. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/messages/__init__.py +0 -0
  131. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/messages/batches.py +0 -0
  132. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/messages/messages.py +0 -0
  133. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/resources/models.py +0 -0
  134. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/__init__.py +0 -0
  135. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/anthropic_beta_param.py +0 -0
  136. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/base64_image_source_param.py +0 -0
  137. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/base64_pdf_source_param.py +0 -0
  138. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_base64_image_source_param.py +0 -0
  139. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_base64_pdf_block_param.py +0 -0
  140. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_base64_pdf_source_param.py +0 -0
  141. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_output_block.py +0 -0
  142. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_output_block_param.py +0 -0
  143. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_result_block.py +0 -0
  144. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_result_block_param.py +0 -0
  145. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block.py +0 -0
  146. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block_param.py +0 -0
  147. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error.py +0 -0
  148. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error_param.py +0 -0
  149. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_cache_control_ephemeral_param.py +0 -0
  150. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_cache_creation.py +0 -0
  151. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_char_location.py +0 -0
  152. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_char_location_param.py +0 -0
  153. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_content_block_location.py +0 -0
  154. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_content_block_location_param.py +0 -0
  155. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_page_location.py +0 -0
  156. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_page_location_param.py +0 -0
  157. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_search_result_location.py +0 -0
  158. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_search_result_location_param.py +0 -0
  159. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citation_web_search_result_location_param.py +0 -0
  160. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citations_config_param.py +0 -0
  161. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citations_delta.py +0 -0
  162. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_citations_web_search_result_location.py +0 -0
  163. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_output_block.py +0 -0
  164. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_output_block_param.py +0 -0
  165. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_result_block.py +0 -0
  166. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_result_block_param.py +0 -0
  167. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_20250522_param.py +0 -0
  168. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_20250825_param.py +0 -0
  169. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block.py +0 -0
  170. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_content.py +0 -0
  171. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param.py +0 -0
  172. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param_content_param.py +0 -0
  173. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error.py +0 -0
  174. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error_code.py +0 -0
  175. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error_param.py +0 -0
  176. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_container.py +0 -0
  177. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_container_upload_block.py +0 -0
  178. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_container_upload_block_param.py +0 -0
  179. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_content_block_source_content_param.py +0 -0
  180. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_content_block_source_param.py +0 -0
  181. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_file_document_source_param.py +0 -0
  182. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_file_image_source_param.py +0 -0
  183. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_image_block_param.py +0 -0
  184. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_input_json_delta.py +0 -0
  185. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_mcp_tool_result_block.py +0 -0
  186. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_mcp_tool_use_block.py +0 -0
  187. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_mcp_tool_use_block_param.py +0 -0
  188. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_message.py +0 -0
  189. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_message_delta_usage.py +0 -0
  190. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_message_param.py +0 -0
  191. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_message_tokens_count.py +0 -0
  192. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_metadata_param.py +0 -0
  193. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_model_info.py +0 -0
  194. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_plain_text_source_param.py +0 -0
  195. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_content_block_delta.py +0 -0
  196. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_content_block_delta_event.py +0 -0
  197. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_content_block_stop_event.py +0 -0
  198. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_message_delta_event.py +0 -0
  199. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_message_start_event.py +0 -0
  200. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_message_stop_event.py +0 -0
  201. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_raw_message_stream_event.py +0 -0
  202. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_redacted_thinking_block.py +0 -0
  203. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_redacted_thinking_block_param.py +0 -0
  204. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_request_mcp_server_tool_configuration_param.py +0 -0
  205. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_request_mcp_server_url_definition_param.py +0 -0
  206. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_request_mcp_tool_result_block_param.py +0 -0
  207. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_search_result_block_param.py +0 -0
  208. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_signature_delta.py +0 -0
  209. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_stop_reason.py +0 -0
  210. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_block.py +0 -0
  211. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_block_param.py +0 -0
  212. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_citation.py +0 -0
  213. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_citation_param.py +0 -0
  214. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_delta.py +0 -0
  215. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block.py +0 -0
  216. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block_param.py +0 -0
  217. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block.py +0 -0
  218. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block_param.py +0 -0
  219. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block.py +0 -0
  220. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block_param.py +0 -0
  221. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error.py +0 -0
  222. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error_param.py +0 -0
  223. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block.py +0 -0
  224. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block_param.py +0 -0
  225. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_block.py +0 -0
  226. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_block_param.py +0 -0
  227. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_config_disabled_param.py +0 -0
  228. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_config_enabled_param.py +0 -0
  229. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_config_param.py +0 -0
  230. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_thinking_delta.py +0 -0
  231. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_bash_20241022_param.py +0 -0
  232. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_bash_20250124_param.py +0 -0
  233. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_choice_any_param.py +0 -0
  234. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_choice_auto_param.py +0 -0
  235. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_choice_none_param.py +0 -0
  236. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_choice_param.py +0 -0
  237. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_choice_tool_param.py +0 -0
  238. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_computer_use_20241022_param.py +0 -0
  239. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_computer_use_20250124_param.py +0 -0
  240. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_param.py +0 -0
  241. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_text_editor_20241022_param.py +0 -0
  242. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_text_editor_20250124_param.py +0 -0
  243. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_text_editor_20250429_param.py +0 -0
  244. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_text_editor_20250728_param.py +0 -0
  245. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_use_block.py +0 -0
  246. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_tool_use_block_param.py +0 -0
  247. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_url_image_source_param.py +0 -0
  248. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_url_pdf_source_param.py +0 -0
  249. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_usage.py +0 -0
  250. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_result_block.py +0 -0
  251. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_result_block_param.py +0 -0
  252. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_20250305_param.py +0 -0
  253. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_request_error_param.py +0 -0
  254. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_block.py +0 -0
  255. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_content.py +0 -0
  256. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_param.py +0 -0
  257. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py +0 -0
  258. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_error.py +0 -0
  259. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/beta_web_search_tool_result_error_code.py +0 -0
  260. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/deleted_file.py +0 -0
  261. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/file_list_params.py +0 -0
  262. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/file_metadata.py +0 -0
  263. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/file_upload_params.py +0 -0
  264. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/message_create_params.py +0 -0
  265. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/__init__.py +0 -0
  266. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/batch_create_params.py +0 -0
  267. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/batch_list_params.py +0 -0
  268. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_deleted_message_batch.py +0 -0
  269. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch.py +0 -0
  270. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_canceled_result.py +0 -0
  271. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_errored_result.py +0 -0
  272. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_expired_result.py +0 -0
  273. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_individual_response.py +0 -0
  274. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_request_counts.py +0 -0
  275. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_result.py +0 -0
  276. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py +0 -0
  277. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta/model_list_params.py +0 -0
  278. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_api_error.py +0 -0
  279. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_authentication_error.py +0 -0
  280. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_billing_error.py +0 -0
  281. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_error.py +0 -0
  282. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_error_response.py +0 -0
  283. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_gateway_timeout_error.py +0 -0
  284. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_invalid_request_error.py +0 -0
  285. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_not_found_error.py +0 -0
  286. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_overloaded_error.py +0 -0
  287. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_permission_error.py +0 -0
  288. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/beta_rate_limit_error.py +0 -0
  289. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/cache_control_ephemeral_param.py +0 -0
  290. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/cache_creation.py +0 -0
  291. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_char_location.py +0 -0
  292. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_char_location_param.py +0 -0
  293. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_content_block_location.py +0 -0
  294. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_content_block_location_param.py +0 -0
  295. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_page_location.py +0 -0
  296. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_page_location_param.py +0 -0
  297. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_search_result_location_param.py +0 -0
  298. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citation_web_search_result_location_param.py +0 -0
  299. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citations_config_param.py +0 -0
  300. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citations_delta.py +0 -0
  301. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citations_search_result_location.py +0 -0
  302. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/citations_web_search_result_location.py +0 -0
  303. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/completion.py +0 -0
  304. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/completion_create_params.py +0 -0
  305. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block.py +0 -0
  306. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_delta_event.py +0 -0
  307. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_param.py +0 -0
  308. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_source_content_param.py +0 -0
  309. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_source_param.py +0 -0
  310. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_start_event.py +0 -0
  311. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/content_block_stop_event.py +0 -0
  312. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/image_block_param.py +0 -0
  313. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/input_json_delta.py +0 -0
  314. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message.py +0 -0
  315. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_count_tokens_params.py +0 -0
  316. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_count_tokens_tool_param.py +0 -0
  317. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_create_params.py +0 -0
  318. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_delta_event.py +0 -0
  319. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_delta_usage.py +0 -0
  320. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_param.py +0 -0
  321. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_start_event.py +0 -0
  322. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_stop_event.py +0 -0
  323. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_stream_event.py +0 -0
  324. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/message_tokens_count.py +0 -0
  325. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/__init__.py +0 -0
  326. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/batch_create_params.py +0 -0
  327. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/batch_list_params.py +0 -0
  328. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/deleted_message_batch.py +0 -0
  329. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch.py +0 -0
  330. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_canceled_result.py +0 -0
  331. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_errored_result.py +0 -0
  332. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_expired_result.py +0 -0
  333. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_individual_response.py +0 -0
  334. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_request_counts.py +0 -0
  335. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_result.py +0 -0
  336. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/messages/message_batch_succeeded_result.py +0 -0
  337. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/metadata_param.py +0 -0
  338. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/model.py +0 -0
  339. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/model_info.py +0 -0
  340. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/model_list_params.py +0 -0
  341. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/model_param.py +0 -0
  342. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/plain_text_source_param.py +0 -0
  343. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_content_block_delta.py +0 -0
  344. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_content_block_delta_event.py +0 -0
  345. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_content_block_start_event.py +0 -0
  346. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_content_block_stop_event.py +0 -0
  347. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_message_delta_event.py +0 -0
  348. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_message_start_event.py +0 -0
  349. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_message_stop_event.py +0 -0
  350. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/raw_message_stream_event.py +0 -0
  351. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/redacted_thinking_block.py +0 -0
  352. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/redacted_thinking_block_param.py +0 -0
  353. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/search_result_block_param.py +0 -0
  354. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/server_tool_usage.py +0 -0
  355. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/server_tool_use_block.py +0 -0
  356. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/server_tool_use_block_param.py +0 -0
  357. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/__init__.py +0 -0
  358. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/api_error_object.py +0 -0
  359. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/authentication_error.py +0 -0
  360. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/billing_error.py +0 -0
  361. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/error_object.py +0 -0
  362. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/error_response.py +0 -0
  363. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/gateway_timeout_error.py +0 -0
  364. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/invalid_request_error.py +0 -0
  365. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/not_found_error.py +0 -0
  366. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/overloaded_error.py +0 -0
  367. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/permission_error.py +0 -0
  368. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/shared/rate_limit_error.py +0 -0
  369. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/signature_delta.py +0 -0
  370. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/stop_reason.py +0 -0
  371. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/text_block.py +0 -0
  372. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/text_block_param.py +0 -0
  373. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/text_citation.py +0 -0
  374. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/text_citation_param.py +0 -0
  375. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/text_delta.py +0 -0
  376. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_block.py +0 -0
  377. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_block_param.py +0 -0
  378. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_config_disabled_param.py +0 -0
  379. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_config_enabled_param.py +0 -0
  380. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_config_param.py +0 -0
  381. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/thinking_delta.py +0 -0
  382. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_bash_20250124_param.py +0 -0
  383. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_choice_any_param.py +0 -0
  384. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_choice_auto_param.py +0 -0
  385. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_choice_none_param.py +0 -0
  386. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_choice_param.py +0 -0
  387. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_choice_tool_param.py +0 -0
  388. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_param.py +0 -0
  389. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_text_editor_20250124_param.py +0 -0
  390. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_text_editor_20250429_param.py +0 -0
  391. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_text_editor_20250728_param.py +0 -0
  392. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_union_param.py +0 -0
  393. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_use_block.py +0 -0
  394. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/tool_use_block_param.py +0 -0
  395. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/url_image_source_param.py +0 -0
  396. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/url_pdf_source_param.py +0 -0
  397. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/usage.py +0 -0
  398. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_result_block.py +0 -0
  399. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_result_block_param.py +0 -0
  400. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_20250305_param.py +0 -0
  401. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_request_error_param.py +0 -0
  402. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_result_block.py +0 -0
  403. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_result_block_content.py +0 -0
  404. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_result_block_param.py +0 -0
  405. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_result_block_param_content_param.py +0 -0
  406. {anthropic-0.65.0 → anthropic-0.67.0}/src/anthropic/types/web_search_tool_result_error.py +0 -0
  407. {anthropic-0.65.0 → anthropic-0.67.0}/tests/__init__.py +0 -0
  408. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/__init__.py +0 -0
  409. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/__init__.py +0 -0
  410. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/messages/__init__.py +0 -0
  411. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/messages/test_batches.py +0 -0
  412. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/test_files.py +0 -0
  413. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/test_messages.py +0 -0
  414. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/beta/test_models.py +0 -0
  415. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/messages/__init__.py +0 -0
  416. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/messages/test_batches.py +0 -0
  417. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/test_completions.py +0 -0
  418. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/test_messages.py +0 -0
  419. {anthropic-0.65.0 → anthropic-0.67.0}/tests/api_resources/test_models.py +0 -0
  420. {anthropic-0.65.0 → anthropic-0.67.0}/tests/conftest.py +0 -0
  421. {anthropic-0.65.0 → anthropic-0.67.0}/tests/decoders/test_jsonl.py +0 -0
  422. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/__init__.py +0 -0
  423. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/fixtures/basic_response.txt +0 -0
  424. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/fixtures/incomplete_partial_json_response.txt +0 -0
  425. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/fixtures/tool_use_response.txt +0 -0
  426. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/helpers.py +0 -0
  427. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/streaming/test_partial_json.py +0 -0
  428. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/test_bedrock.py +0 -0
  429. {anthropic-0.65.0 → anthropic-0.67.0}/tests/lib/test_vertex.py +0 -0
  430. {anthropic-0.65.0 → anthropic-0.67.0}/tests/sample_file.txt +0 -0
  431. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_client.py +0 -0
  432. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_deepcopy.py +0 -0
  433. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_extract_files.py +0 -0
  434. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_files.py +0 -0
  435. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_legacy_response.py +0 -0
  436. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_qs.py +0 -0
  437. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_required_args.py +0 -0
  438. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_response.py +0 -0
  439. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_streaming.py +0 -0
  440. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_utils/test_proxy.py +0 -0
  441. {anthropic-0.65.0 → anthropic-0.67.0}/tests/test_utils/test_typing.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.67.0"
3
+ }
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.67.0 (2025-09-10)
4
+
5
+ Full Changelog: [v0.66.0...v0.67.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.66.0...v0.67.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** adds support for web_fetch_20250910 tool ([f85b6a1](https://github.com/anthropics/anthropic-sdk-python/commit/f85b6a172b4b6d3b42119d75f0fefbbf7dcd2351))
10
+ * improve future compat with pydantic v3 ([39f28c5](https://github.com/anthropics/anthropic-sdk-python/commit/39f28c51d328bc7bf5f86f252ea63e8325815c72))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * more updates for future pydantic v3 compat ([7967d15](https://github.com/anthropics/anthropic-sdk-python/commit/7967d1501297e188f451fa39a33b38317dfcb883))
16
+ * **types/beta:** add response content block type to params ([#1030](https://github.com/anthropics/anthropic-sdk-python/issues/1030)) ([9febe38](https://github.com/anthropics/anthropic-sdk-python/commit/9febe38a309d290f2c2a8d96eb458972652b98cd))
17
+
18
+
19
+ ### Chores
20
+
21
+ * **internal:** move mypy configurations to `pyproject.toml` file ([c5347b6](https://github.com/anthropics/anthropic-sdk-python/commit/c5347b6affba397276c13e763f5eb820d11f912f))
22
+ * update SDK settings ([36e6870](https://github.com/anthropics/anthropic-sdk-python/commit/36e687098acc8c66613712c89667edea73ce799f))
23
+
24
+ ## 0.66.0 (2025-09-03)
25
+
26
+ Full Changelog: [v0.65.0...v0.66.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.65.0...v0.66.0)
27
+
28
+ ### Features
29
+
30
+ * **api:** adds support for Documents in tool results ([5309dad](https://github.com/anthropics/anthropic-sdk-python/commit/5309dad584bb31284516e0d44681f1b46d1a663d))
31
+
3
32
  ## 0.65.0 (2025-09-02)
4
33
 
5
34
  Full Changelog: [v0.64.0...v0.65.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.64.0...v0.65.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: anthropic
3
- Version: 0.65.0
3
+ Version: 0.67.0
4
4
  Summary: The official Python library for the anthropic API
5
5
  Project-URL: Homepage, https://github.com/anthropics/anthropic-sdk-python
6
6
  Project-URL: Repository, https://github.com/anthropics/anthropic-sdk-python
@@ -216,6 +216,7 @@ from anthropic.types.beta import (
216
216
  BetaCacheCreation,
217
217
  BetaCitationCharLocation,
218
218
  BetaCitationCharLocationParam,
219
+ BetaCitationConfig,
219
220
  BetaCitationContentBlockLocation,
220
221
  BetaCitationContentBlockLocationParam,
221
222
  BetaCitationPageLocation,
@@ -246,6 +247,7 @@ from anthropic.types.beta import (
246
247
  BetaContentBlockParam,
247
248
  BetaContentBlockSource,
248
249
  BetaContentBlockSourceContent,
250
+ BetaDocumentBlock,
249
251
  BetaFileDocumentSource,
250
252
  BetaFileImageSource,
251
253
  BetaImageBlockParam,
@@ -321,6 +323,14 @@ from anthropic.types.beta import (
321
323
  BetaURLImageSource,
322
324
  BetaURLPDFSource,
323
325
  BetaUsage,
326
+ BetaWebFetchBlock,
327
+ BetaWebFetchBlockParam,
328
+ BetaWebFetchTool20250910,
329
+ BetaWebFetchToolResultBlock,
330
+ BetaWebFetchToolResultBlockParam,
331
+ BetaWebFetchToolResultErrorBlock,
332
+ BetaWebFetchToolResultErrorBlockParam,
333
+ BetaWebFetchToolResultErrorCode,
324
334
  BetaWebSearchResultBlock,
325
335
  BetaWebSearchResultBlockParam,
326
336
  BetaWebSearchTool20250305,
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anthropic"
3
- version = "0.65.0"
3
+ version = "0.67.0"
4
4
  description = "The official Python library for the anthropic API"
5
5
  dynamic = ["readme"]
6
6
  license = "MIT"
@@ -147,6 +147,61 @@ reportOverlappingOverload = false
147
147
  reportImportCycles = false
148
148
  reportPrivateUsage = false
149
149
 
150
+ [tool.mypy]
151
+ pretty = true
152
+ show_error_codes = true
153
+
154
+ # Exclude _files.py because mypy isn't smart enough to apply
155
+ # the correct type narrowing and as this is an internal module
156
+ # it's fine to just use Pyright.
157
+ #
158
+ # We also exclude our `tests` as mypy doesn't always infer
159
+ # types correctly and Pyright will still catch any type errors.
160
+ exclude = ['src/anthropic/_files.py', '_dev/.*.py', 'tests/.*']
161
+
162
+ strict_equality = true
163
+ implicit_reexport = true
164
+ check_untyped_defs = true
165
+ no_implicit_optional = true
166
+
167
+ warn_return_any = true
168
+ warn_unreachable = true
169
+ warn_unused_configs = true
170
+
171
+ # Turn these options off as it could cause conflicts
172
+ # with the Pyright options.
173
+ warn_unused_ignores = false
174
+ warn_redundant_casts = false
175
+
176
+ disallow_any_generics = true
177
+ disallow_untyped_defs = true
178
+ disallow_untyped_calls = true
179
+ disallow_subclassing_any = true
180
+ disallow_incomplete_defs = true
181
+ disallow_untyped_decorators = true
182
+ cache_fine_grained = true
183
+
184
+ # By default, mypy reports an error if you assign a value to the result
185
+ # of a function call that doesn't return anything. We do this in our test
186
+ # cases:
187
+ # ```
188
+ # result = ...
189
+ # assert result is None
190
+ # ```
191
+ # Changing this codegen to make mypy happy would increase complexity
192
+ # and would not be worth it.
193
+ disable_error_code = "func-returns-value,overload-cannot-match"
194
+
195
+ # https://github.com/python/mypy/issues/12162
196
+ [[tool.mypy.overrides]]
197
+ module = "black.files.*"
198
+ ignore_errors = true
199
+ ignore_missing_imports = true
200
+
201
+ [[tool.mypy.overrides]]
202
+ module = "anthropic.lib.vertex._auth"
203
+ disallow_untyped_calls = false
204
+
150
205
  [tool.ruff]
151
206
  line-length = 120
152
207
  output-format = "grouped"
@@ -36,7 +36,7 @@ exceptiongroup==1.2.2 ; python_full_version < '3.11'
36
36
  execnet==2.1.1
37
37
  # via pytest-xdist
38
38
  griffe==1.4.0 ; python_full_version < '3.9'
39
- griffe==1.13.0 ; python_full_version >= '3.9'
39
+ griffe==1.14.0 ; python_full_version >= '3.9'
40
40
  h11==0.16.0
41
41
  # via httpcore
42
42
  httpcore==1.0.9
@@ -62,7 +62,7 @@ from ._types import (
62
62
  ModelBuilderProtocol,
63
63
  )
64
64
  from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
65
- from ._compat import PYDANTIC_V2, model_copy, model_dump
65
+ from ._compat import PYDANTIC_V1, model_copy, model_dump
66
66
  from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
67
67
  from ._response import (
68
68
  APIResponse,
@@ -237,7 +237,7 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
237
237
  model: Type[_T],
238
238
  options: FinalRequestOptions,
239
239
  ) -> None:
240
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
240
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
241
241
  self.__pydantic_private__ = {}
242
242
 
243
243
  self._model = model
@@ -325,7 +325,7 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
325
325
  client: AsyncAPIClient,
326
326
  options: FinalRequestOptions,
327
327
  ) -> None:
328
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
328
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
329
329
  self.__pydantic_private__ = {}
330
330
 
331
331
  self._model = model
@@ -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:
@@ -50,7 +50,7 @@ from ._utils import (
50
50
  strip_annotated_type,
51
51
  )
52
52
  from ._compat import (
53
- PYDANTIC_V2,
53
+ PYDANTIC_V1,
54
54
  ConfigDict,
55
55
  GenericModel as BaseGenericModel,
56
56
  get_args,
@@ -81,11 +81,7 @@ class _ConfigProtocol(Protocol):
81
81
 
82
82
 
83
83
  class BaseModel(pydantic.BaseModel):
84
- if PYDANTIC_V2:
85
- model_config: ClassVar[ConfigDict] = ConfigDict(
86
- extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true"))
87
- )
88
- else:
84
+ if PYDANTIC_V1:
89
85
 
90
86
  @property
91
87
  @override
@@ -95,6 +91,10 @@ class BaseModel(pydantic.BaseModel):
95
91
 
96
92
  class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated]
97
93
  extra: Any = pydantic.Extra.allow # type: ignore
94
+ else:
95
+ model_config: ClassVar[ConfigDict] = ConfigDict(
96
+ extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true"))
97
+ )
98
98
 
99
99
  if TYPE_CHECKING:
100
100
  _request_id: Optional[str] = None
@@ -231,25 +231,25 @@ class BaseModel(pydantic.BaseModel):
231
231
  if key not in model_fields:
232
232
  parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value
233
233
 
234
- if PYDANTIC_V2:
235
- _extra[key] = parsed
236
- else:
234
+ if PYDANTIC_V1:
237
235
  _fields_set.add(key)
238
236
  fields_values[key] = parsed
237
+ else:
238
+ _extra[key] = parsed
239
239
 
240
240
  object.__setattr__(m, "__dict__", fields_values)
241
241
 
242
- if PYDANTIC_V2:
243
- # these properties are copied from Pydantic's `model_construct()` method
244
- object.__setattr__(m, "__pydantic_private__", None)
245
- object.__setattr__(m, "__pydantic_extra__", _extra)
246
- object.__setattr__(m, "__pydantic_fields_set__", _fields_set)
247
- else:
242
+ if PYDANTIC_V1:
248
243
  # init_private_attributes() does not exist in v2
249
244
  m._init_private_attributes() # type: ignore
250
245
 
251
246
  # copied from Pydantic v1's `construct()` method
252
247
  object.__setattr__(m, "__fields_set__", _fields_set)
248
+ else:
249
+ # these properties are copied from Pydantic's `model_construct()` method
250
+ object.__setattr__(m, "__pydantic_private__", None)
251
+ object.__setattr__(m, "__pydantic_extra__", _extra)
252
+ object.__setattr__(m, "__pydantic_fields_set__", _fields_set)
253
253
 
254
254
  return m
255
255
 
@@ -259,7 +259,7 @@ class BaseModel(pydantic.BaseModel):
259
259
  # although not in practice
260
260
  model_construct = construct
261
261
 
262
- if not PYDANTIC_V2:
262
+ if PYDANTIC_V1:
263
263
  # we define aliases for some of the new pydantic v2 methods so
264
264
  # that we can just document these methods without having to specify
265
265
  # a specific pydantic version as some users may not know which
@@ -379,10 +379,10 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
379
379
  if value is None:
380
380
  return field_get_default(field)
381
381
 
382
- if PYDANTIC_V2:
383
- type_ = field.annotation
384
- else:
382
+ if PYDANTIC_V1:
385
383
  type_ = cast(type, field.outer_type_) # type: ignore
384
+ else:
385
+ type_ = field.annotation # type: ignore
386
386
 
387
387
  if type_ is None:
388
388
  raise RuntimeError(f"Unexpected field type is None for {key}")
@@ -391,7 +391,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
391
391
 
392
392
 
393
393
  def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None:
394
- if not PYDANTIC_V2:
394
+ if PYDANTIC_V1:
395
395
  # TODO
396
396
  return None
397
397
 
@@ -644,30 +644,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
644
644
  for variant in get_args(union):
645
645
  variant = strip_annotated_type(variant)
646
646
  if is_basemodel_type(variant):
647
- if PYDANTIC_V2:
648
- field = _extract_field_schema_pv2(variant, discriminator_field_name)
649
- if not field:
647
+ if PYDANTIC_V1:
648
+ field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
649
+ if not field_info:
650
650
  continue
651
651
 
652
652
  # Note: if one variant defines an alias then they all should
653
- discriminator_alias = field.get("serialization_alias")
654
-
655
- field_schema = field["schema"]
653
+ discriminator_alias = field_info.alias
656
654
 
657
- if field_schema["type"] == "literal":
658
- for entry in cast("LiteralSchema", field_schema)["expected"]:
655
+ if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
656
+ for entry in get_args(annotation):
659
657
  if isinstance(entry, str):
660
658
  mapping[entry] = variant
661
659
  else:
662
- field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
663
- if not field_info:
660
+ field = _extract_field_schema_pv2(variant, discriminator_field_name)
661
+ if not field:
664
662
  continue
665
663
 
666
664
  # Note: if one variant defines an alias then they all should
667
- discriminator_alias = field_info.alias
665
+ discriminator_alias = field.get("serialization_alias")
668
666
 
669
- if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
670
- for entry in get_args(annotation):
667
+ field_schema = field["schema"]
668
+
669
+ if field_schema["type"] == "literal":
670
+ for entry in cast("LiteralSchema", field_schema)["expected"]:
671
671
  if isinstance(entry, str):
672
672
  mapping[entry] = variant
673
673
 
@@ -726,7 +726,7 @@ def add_request_id(obj: BaseModel, request_id: str | None) -> None:
726
726
  # in Pydantic v1, using setattr like we do above causes the attribute
727
727
  # to be included when serializing the model which we don't want in this
728
728
  # case so we need to explicitly exclude it
729
- if not PYDANTIC_V2:
729
+ if PYDANTIC_V1:
730
730
  try:
731
731
  exclude_fields = obj.__exclude_fields__ # type: ignore
732
732
  except AttributeError:
@@ -745,7 +745,7 @@ else:
745
745
  pass
746
746
 
747
747
 
748
- if PYDANTIC_V2:
748
+ if not PYDANTIC_V1:
749
749
  from pydantic import TypeAdapter as _TypeAdapter
750
750
 
751
751
  _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter))
@@ -813,12 +813,12 @@ class FinalRequestOptions(pydantic.BaseModel):
813
813
  json_data: Union[Body, None] = None
814
814
  extra_json: Union[AnyMapping, None] = None
815
815
 
816
- if PYDANTIC_V2:
817
- model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
818
- else:
816
+ if PYDANTIC_V1:
819
817
 
820
818
  class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated]
821
819
  arbitrary_types_allowed: bool = True
820
+ else:
821
+ model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
822
822
 
823
823
  def get_max_retries(self, max_retries: int) -> int:
824
824
  if isinstance(self.max_retries, NotGiven):
@@ -851,9 +851,9 @@ class FinalRequestOptions(pydantic.BaseModel):
851
851
  key: strip_not_given(value)
852
852
  for key, value in values.items()
853
853
  }
854
- if PYDANTIC_V2:
855
- return super().model_construct(_fields_set, **kwargs)
856
- return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
854
+ if PYDANTIC_V1:
855
+ return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
856
+ return super().model_construct(_fields_set, **kwargs)
857
857
 
858
858
  if not TYPE_CHECKING:
859
859
  # type checkers incorrectly complain about this assignment
@@ -10,7 +10,6 @@ from ._utils import (
10
10
  lru_cache as lru_cache,
11
11
  is_mapping as is_mapping,
12
12
  is_tuple_t as is_tuple_t,
13
- parse_date as parse_date,
14
13
  is_iterable as is_iterable,
15
14
  is_sequence as is_sequence,
16
15
  coerce_float as coerce_float,
@@ -23,7 +22,6 @@ from ._utils import (
23
22
  coerce_boolean as coerce_boolean,
24
23
  coerce_integer as coerce_integer,
25
24
  file_from_path as file_from_path,
26
- parse_datetime as parse_datetime,
27
25
  strip_not_given as strip_not_given,
28
26
  deepcopy_minimal as deepcopy_minimal,
29
27
  get_async_library as get_async_library,
@@ -32,6 +30,13 @@ from ._utils import (
32
30
  maybe_coerce_boolean as maybe_coerce_boolean,
33
31
  maybe_coerce_integer as maybe_coerce_integer,
34
32
  )
33
+ from ._compat import (
34
+ get_args as get_args,
35
+ is_union as is_union,
36
+ get_origin as get_origin,
37
+ is_typeddict as is_typeddict,
38
+ is_literal_type as is_literal_type,
39
+ )
35
40
  from ._typing import (
36
41
  is_list_type as is_list_type,
37
42
  is_union_type as is_union_type,
@@ -56,3 +61,4 @@ from ._reflection import (
56
61
  function_has_argument as function_has_argument,
57
62
  assert_signatures_in_sync as assert_signatures_in_sync,
58
63
  )
64
+ from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
@@ -0,0 +1,45 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+ import typing_extensions
5
+ from typing import Any, Type, Union, Literal, Optional
6
+ from datetime import date, datetime
7
+ from typing_extensions import get_args as _get_args, get_origin as _get_origin
8
+
9
+ from .._types import StrBytesIntFloat
10
+ from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime
11
+
12
+ _LITERAL_TYPES = {Literal, typing_extensions.Literal}
13
+
14
+
15
+ def get_args(tp: type[Any]) -> tuple[Any, ...]:
16
+ return _get_args(tp)
17
+
18
+
19
+ def get_origin(tp: type[Any]) -> type[Any] | None:
20
+ return _get_origin(tp)
21
+
22
+
23
+ def is_union(tp: Optional[Type[Any]]) -> bool:
24
+ if sys.version_info < (3, 10):
25
+ return tp is Union # type: ignore[comparison-overlap]
26
+ else:
27
+ import types
28
+
29
+ return tp is Union or tp is types.UnionType
30
+
31
+
32
+ def is_typeddict(tp: Type[Any]) -> bool:
33
+ return typing_extensions.is_typeddict(tp)
34
+
35
+
36
+ def is_literal_type(tp: Type[Any]) -> bool:
37
+ return get_origin(tp) in _LITERAL_TYPES
38
+
39
+
40
+ def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
41
+ return _parse_date(value)
42
+
43
+
44
+ def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
45
+ return _parse_datetime(value)