anthropic 0.72.1__tar.gz → 0.73.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.
- anthropic-0.73.0/.release-please-manifest.json +3 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/CHANGELOG.md +8 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/PKG-INFO +1 -1
- {anthropic-0.72.1 → anthropic-0.73.0}/api.md +1 -0
- anthropic-0.73.0/examples/structured_outputs.py +37 -0
- anthropic-0.73.0/examples/structured_outputs_streaming.py +38 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/pyproject.toml +2 -2
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/__init__.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_compat.py +6 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_models.py +13 -1
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_transform.py +1 -1
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_version.py +1 -1
- anthropic-0.73.0/src/anthropic/lib/_parse/_response.py +44 -0
- anthropic-0.73.0/src/anthropic/lib/_parse/_transform.py +167 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/streaming/__init__.py +14 -4
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/streaming/_beta_messages.py +82 -43
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/streaming/_beta_types.py +21 -13
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/tools/_beta_runner.py +102 -101
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/messages/batches.py +12 -12
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/messages/messages.py +365 -29
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/messages/batches.py +12 -12
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/messages/messages.py +14 -8
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/__init__.py +1 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_20250522_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_20250825_param.py +2 -0
- anthropic-0.73.0/src/anthropic/types/beta/beta_json_output_format_param.py +15 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_bash_20241022_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_bash_20250124_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_computer_use_20241022_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_computer_use_20250124_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_text_editor_20241022_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_text_editor_20250124_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_text_editor_20250429_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_text_editor_20250728_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_20250305_param.py +2 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/message_count_tokens_params.py +4 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/message_create_params.py +24 -2
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/batch_create_params.py +8 -2
- anthropic-0.73.0/src/anthropic/types/beta/parsed_beta_message.py +68 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/batch_create_params.py +0 -1
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/messages/test_batches.py +10 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/test_messages.py +65 -0
- anthropic-0.73.0/tests/lib/_parse/test_transform.py +191 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/test_beta_messages.py +7 -4
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/test_partial_json.py +3 -3
- anthropic-0.73.0/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_streaming_call_sync_events/9cb114c8-69bd-4111-841b-edee30333afd.json +4 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/tools/test_runners.py +40 -143
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/utils.py +7 -13
- {anthropic-0.72.1 → anthropic-0.73.0}/uv.lock +5 -5
- anthropic-0.72.1/.release-please-manifest.json +0 -3
- anthropic-0.72.1/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_max_iterations/ef758469-6fa6-454c-b2e6-19d0b450a8c5.json +0 -4
- anthropic-0.72.1/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_streaming_call_sync_events/9cb114c8-69bd-4111-841b-edee30333afd.json +0 -4
- anthropic-0.72.1/tests/lib/tools/__inline_snapshot__/test_runners/test_streaming_call_sync/e2140c0f-07db-47ee-b86b-c2ec476866d5.json +0 -4
- {anthropic-0.72.1 → anthropic-0.73.0}/.gitignore +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/CONTRIBUTING.md +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/LICENSE +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/README.md +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/SECURITY.md +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/bin/check-release-environment +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/bin/publish-pypi +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/.keep +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/batch_results.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/bedrock.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/images.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/logo.png +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/memory/basic.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/messages_stream.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/text_completions_demo_async.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/text_completions_demo_sync.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/text_completions_streaming.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/thinking.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/thinking_stream.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/tools.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/tools_runner.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/tools_stream.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/vertex.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/web_search.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/examples/web_search_stream.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/helpers.md +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/release-please-config.json +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/requirements-dev.lock +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_base_client.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_client.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_constants.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_decoders/jsonl.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_exceptions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_legacy_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_qs.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_resource.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_streaming.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_types.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_compat.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_datetime_parse.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_httpx.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_logs.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_proxy.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_reflection.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_resources_proxy.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_streams.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_sync.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_typing.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/_utils/_utils.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/.keep +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/_extras/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/_extras/_common.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/_extras/_google_auth.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/_files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_auth.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_beta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_beta_messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_client.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_stream.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/bedrock/_stream_decoder.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/streaming/_messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/streaming/_types.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/tools/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/tools/_beta_builtin_memory_tool.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/tools/_beta_functions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/vertex/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/vertex/_auth.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/vertex/_beta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/vertex/_beta_messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/lib/vertex/_client.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/pagination.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/py.typed +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/beta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/models.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/skills/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/skills/skills.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/beta/skills/versions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/completions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/resources/models.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/anthropic_beta_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/base64_image_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/base64_pdf_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_all_thinking_turns_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_base64_image_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_base64_pdf_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_base64_pdf_source.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_base64_pdf_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_output_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_output_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_cache_control_ephemeral_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_cache_creation.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_char_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_char_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_config.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_content_block_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_content_block_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_page_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_page_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_search_result_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_search_result_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citation_web_search_result_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citations_config_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citations_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_citations_web_search_result_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_clear_thinking_20251015_edit_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_clear_thinking_20251015_edit_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_clear_tool_uses_20250919_edit_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_clear_tool_uses_20250919_edit_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_output_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_output_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_content.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error_code.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_container.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_container_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_container_upload_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_container_upload_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_content_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_content_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_content_block_source_content_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_content_block_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_context_management_config_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_context_management_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_count_tokens_context_management_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_document_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_file_document_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_file_image_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_image_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_input_json_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_input_tokens_clear_at_least_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_input_tokens_trigger_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_mcp_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_mcp_tool_use_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_mcp_tool_use_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_create_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_delete_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_insert_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_rename_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_str_replace_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_memory_tool_20250818_view_command.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_message.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_message_delta_usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_message_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_message_tokens_count.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_metadata_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_model_info.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_plain_text_source.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_plain_text_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_content_block_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_content_block_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_content_block_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_content_block_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_message_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_message_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_message_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_raw_message_stream_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_redacted_thinking_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_redacted_thinking_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_request_document_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_request_mcp_server_tool_configuration_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_request_mcp_server_url_definition_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_request_mcp_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_search_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_server_tool_usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_server_tool_use_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_server_tool_use_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_signature_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_skill.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_skill_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_stop_reason.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_citation.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_citation_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_config_disabled_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_config_enabled_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_config_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_thinking_turns_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_choice_any_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_choice_auto_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_choice_none_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_choice_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_choice_tool_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_union_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_use_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_use_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_uses_keep_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_tool_uses_trigger_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_url_image_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_url_pdf_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_request_error_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_content.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/beta_web_search_tool_result_error_code.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/deleted_file.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/file_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/file_metadata.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/file_upload_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/batch_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_deleted_message_batch.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_canceled_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_errored_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_expired_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_individual_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_request_counts.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/model_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_create_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_create_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_delete_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_list_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skill_retrieve_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_create_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_create_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_delete_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_list_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta/skills/version_retrieve_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_api_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_authentication_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_billing_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_error_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_gateway_timeout_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_invalid_request_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_not_found_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_overloaded_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_permission_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/beta_rate_limit_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/cache_control_ephemeral_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/cache_creation.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_char_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_char_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_content_block_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_content_block_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_page_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_page_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_search_result_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citation_web_search_result_location_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citations_config_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citations_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citations_search_result_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/citations_web_search_result_location.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/completion.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/completion_create_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_source_content_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/content_block_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/document_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/image_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/input_json_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_count_tokens_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_count_tokens_tool_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_create_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_delta_usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_stream_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/message_tokens_count.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/batch_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/deleted_message_batch.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_canceled_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_errored_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_expired_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_individual_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_request_counts.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/messages/message_batch_succeeded_result.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/metadata_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/model.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/model_info.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/model_list_params.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/model_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/plain_text_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_content_block_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_content_block_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_content_block_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_content_block_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_message_delta_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_message_start_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_message_stop_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/raw_message_stream_event.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/redacted_thinking_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/redacted_thinking_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/search_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/server_tool_usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/server_tool_use_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/server_tool_use_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/api_error_object.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/authentication_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/billing_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/error_object.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/error_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/gateway_timeout_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/invalid_request_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/not_found_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/overloaded_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/permission_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/shared/rate_limit_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/signature_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/stop_reason.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/text_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/text_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/text_citation.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/text_citation_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/text_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_config_disabled_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_config_enabled_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_config_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/thinking_delta.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_bash_20250124_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_choice_any_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_choice_auto_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_choice_none_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_choice_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_choice_tool_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_text_editor_20250124_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_text_editor_20250429_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_text_editor_20250728_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_union_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_use_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/tool_use_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/url_image_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/url_pdf_source_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/usage.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_20250305_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_request_error_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_result_block.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_result_block_content.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_result_block_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/src/anthropic/types/web_search_tool_result_error.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/skills/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/skills/test_versions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/test_files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/test_models.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/beta/test_skills.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/messages/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/messages/test_batches.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/test_completions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/test_messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/api_resources/test_models.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/conftest.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/decoders/test_jsonl.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/snapshots.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/fixtures/basic_response.txt +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/fixtures/incomplete_partial_json_response.txt +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/fixtures/tool_use_response.txt +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/helpers.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/streaming/test_messages.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/test_bedrock.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/test_vertex.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/tools/__init__.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/tools/__inline_snapshot__/test_runners/test_streaming_call_sync_events/9cb114c8-69bd-4111-841b-edee30333afd.json +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/lib/tools/test_functions.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/sample_file.txt +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_client.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_deepcopy.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_extract_files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_files.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_legacy_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_models.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_qs.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_required_args.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_response.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_streaming.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_transform.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_utils/test_proxy.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/test_utils/test_typing.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tests/utils.py +0 -0
- {anthropic-0.72.1 → anthropic-0.73.0}/tools.md +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.73.0 (2025-11-14)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.72.1...v0.73.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.72.1...v0.73.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add support for structured outputs beta ([688da81](https://github.com/anthropics/anthropic-sdk-python/commit/688da8126df8a304c5f01f0dc63cda437a62c217))
|
|
10
|
+
|
|
3
11
|
## 0.72.1 (2025-11-11)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.72.0...v0.72.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.72.0...v0.72.1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: anthropic
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.73.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
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.9"
|
|
3
|
+
# dependencies = [
|
|
4
|
+
# "anthropic",
|
|
5
|
+
# ]
|
|
6
|
+
#
|
|
7
|
+
# [tool.uv.sources]
|
|
8
|
+
# anthropic = { path = "../", editable = true }
|
|
9
|
+
# ///
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import pydantic
|
|
13
|
+
|
|
14
|
+
import anthropic
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Order(pydantic.BaseModel):
|
|
18
|
+
product_name: str
|
|
19
|
+
price: float
|
|
20
|
+
quantity: int
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
client = anthropic.Anthropic()
|
|
24
|
+
|
|
25
|
+
prompt = """
|
|
26
|
+
Extract the product name, price, and quantity from this customer message:
|
|
27
|
+
"Hi, I’d like to order 2 packs of Green Tea for 5.50 dollars each."
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
parsed_message = client.beta.messages.parse(
|
|
31
|
+
model="claude-sonnet-4-5-20250929-structured-outputs",
|
|
32
|
+
messages=[{"role": "user", "content": prompt}],
|
|
33
|
+
max_tokens=1024,
|
|
34
|
+
output_format=Order,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
print(parsed_message.parsed_output) # Order(product_name='Green Tea', price=5.5, quantity=2)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.9"
|
|
3
|
+
# dependencies = [
|
|
4
|
+
# "anthropic",
|
|
5
|
+
# ]
|
|
6
|
+
#
|
|
7
|
+
# [tool.uv.sources]
|
|
8
|
+
# anthropic = { path = "../", editable = true }
|
|
9
|
+
# ///
|
|
10
|
+
|
|
11
|
+
import pydantic
|
|
12
|
+
|
|
13
|
+
import anthropic
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Order(pydantic.BaseModel):
|
|
17
|
+
product_name: str
|
|
18
|
+
price: float
|
|
19
|
+
quantity: int
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
client = anthropic.Anthropic()
|
|
23
|
+
|
|
24
|
+
prompt = """
|
|
25
|
+
Extract the product name, price, and quantity from this customer message:
|
|
26
|
+
"Hi, I’d like to order 2 packs of Green Tea for 5.50 dollars each."
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
with client.beta.messages.stream(
|
|
30
|
+
model="claude-sonnet-4-5-20250929-structured-outputs",
|
|
31
|
+
messages=[{"role": "user", "content": prompt}],
|
|
32
|
+
betas=["structured-outputs-2025-09-17"],
|
|
33
|
+
max_tokens=1024,
|
|
34
|
+
output_format=Order,
|
|
35
|
+
) as stream:
|
|
36
|
+
for event in stream:
|
|
37
|
+
if event.type == "text":
|
|
38
|
+
print(event.parsed_snapshot())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "anthropic"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.73.0"
|
|
4
4
|
description = "The official Python library for the anthropic API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "MIT"
|
|
@@ -160,7 +160,7 @@ show_error_codes = true
|
|
|
160
160
|
#
|
|
161
161
|
# We also exclude our `tests` as mypy doesn't always infer
|
|
162
162
|
# types correctly and Pyright will still catch any type errors.
|
|
163
|
-
exclude = ['src/anthropic/_files.py', '_dev/.*.py', 'tests/.*', 'examples/mcp_server_weather.py', 'examples/tools_with_mcp.py', 'examples/memory/basic.py']
|
|
163
|
+
exclude = ['src/anthropic/_files.py', '_dev/.*.py', 'tests/.*', 'examples/mcp_server_weather.py', 'examples/tools_with_mcp.py', 'examples/memory/basic.py', 'src/anthropic/lib/_parse/_transform.py']
|
|
164
164
|
|
|
165
165
|
strict_equality = true
|
|
166
166
|
implicit_reexport = true
|
|
@@ -44,6 +44,7 @@ from ._exceptions import (
|
|
|
44
44
|
)
|
|
45
45
|
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
46
46
|
from ._utils._logs import setup_logging as _setup_logging
|
|
47
|
+
from .lib._parse._transform import transform_schema
|
|
47
48
|
|
|
48
49
|
__all__ = [
|
|
49
50
|
"types",
|
|
@@ -91,6 +92,7 @@ __all__ = [
|
|
|
91
92
|
"AI_PROMPT",
|
|
92
93
|
"beta_tool",
|
|
93
94
|
"beta_async_tool",
|
|
95
|
+
"transform_schema",
|
|
94
96
|
]
|
|
95
97
|
|
|
96
98
|
if not _t.TYPE_CHECKING:
|
|
@@ -131,6 +131,12 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|
|
131
131
|
return model.model_dump_json(indent=indent)
|
|
132
132
|
|
|
133
133
|
|
|
134
|
+
def model_parse_json(model: type[_ModelT], data: str | bytes) -> _ModelT:
|
|
135
|
+
if PYDANTIC_V1:
|
|
136
|
+
return model.parse_raw(data) # pyright: ignore[reportDeprecated]
|
|
137
|
+
return model.model_validate_json(data)
|
|
138
|
+
|
|
139
|
+
|
|
134
140
|
def model_dump(
|
|
135
141
|
model: pydantic.BaseModel,
|
|
136
142
|
*,
|
|
@@ -774,7 +774,7 @@ else:
|
|
|
774
774
|
|
|
775
775
|
|
|
776
776
|
if not PYDANTIC_V1:
|
|
777
|
-
from pydantic import TypeAdapter as _TypeAdapter
|
|
777
|
+
from pydantic import TypeAdapter as _TypeAdapter, computed_field as computed_field
|
|
778
778
|
|
|
779
779
|
_CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter))
|
|
780
780
|
|
|
@@ -811,6 +811,18 @@ elif not TYPE_CHECKING: # TODO: condition is weird
|
|
|
811
811
|
def TypeAdapter(*_args: Any, **_kwargs: Any) -> Any:
|
|
812
812
|
raise RuntimeError("attempted to use TypeAdapter in pydantic v1")
|
|
813
813
|
|
|
814
|
+
def computed_field(func: Any | None = None, /, **__: Any) -> Any:
|
|
815
|
+
def _exc_func(*_: Any, **__: Any) -> Any:
|
|
816
|
+
raise RuntimeError("attempted to use computed_field in pydantic v1")
|
|
817
|
+
|
|
818
|
+
def _dec(*_: Any, **__: Any) -> Any:
|
|
819
|
+
return _exc_func
|
|
820
|
+
|
|
821
|
+
if func is not None:
|
|
822
|
+
return _dec(func)
|
|
823
|
+
else:
|
|
824
|
+
return _dec
|
|
825
|
+
|
|
814
826
|
|
|
815
827
|
class FinalRequestOptionsInput(TypedDict, total=False):
|
|
816
828
|
method: Required[str]
|
|
@@ -218,7 +218,7 @@ def _transform_recursive(
|
|
|
218
218
|
return data
|
|
219
219
|
|
|
220
220
|
if isinstance(data, pydantic.BaseModel):
|
|
221
|
-
return model_dump(data, exclude_unset=True, mode="json")
|
|
221
|
+
return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, "__api_exclude__", None))
|
|
222
222
|
|
|
223
223
|
annotated_type = _get_annotated_type(annotation)
|
|
224
224
|
if annotated_type is None:
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypeVar
|
|
4
|
+
|
|
5
|
+
from ..._types import NotGiven
|
|
6
|
+
from ..._models import TypeAdapter, construct_type_unchecked
|
|
7
|
+
from ..._utils._utils import is_given
|
|
8
|
+
from ...types.beta.beta_message import BetaMessage
|
|
9
|
+
from ...types.beta.parsed_beta_message import ParsedBetaMessage, ParsedBetaTextBlock, ParsedBetaContentBlock
|
|
10
|
+
|
|
11
|
+
ResponseFormatT = TypeVar("ResponseFormatT", default=None)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def parse_text(text: str, output_format: ResponseFormatT | NotGiven) -> ResponseFormatT | None:
|
|
15
|
+
if is_given(output_format):
|
|
16
|
+
adapted_type: TypeAdapter[ResponseFormatT] = TypeAdapter(output_format)
|
|
17
|
+
return adapted_type.validate_json(text)
|
|
18
|
+
return None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def parse_response(
|
|
22
|
+
*,
|
|
23
|
+
output_format: ResponseFormatT | NotGiven,
|
|
24
|
+
response: BetaMessage,
|
|
25
|
+
) -> ParsedBetaMessage[ResponseFormatT]:
|
|
26
|
+
content_list: list[ParsedBetaContentBlock[ResponseFormatT]] = []
|
|
27
|
+
for content in response.content:
|
|
28
|
+
if content.type == "text":
|
|
29
|
+
content_list.append(
|
|
30
|
+
construct_type_unchecked(
|
|
31
|
+
type_=ParsedBetaTextBlock[ResponseFormatT],
|
|
32
|
+
value={**content.to_dict(), "parsed_output": parse_text(content.text, output_format)},
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
else:
|
|
36
|
+
content_list.append(content) # type: ignore
|
|
37
|
+
|
|
38
|
+
return construct_type_unchecked(
|
|
39
|
+
type_=ParsedBetaMessage[ResponseFormatT],
|
|
40
|
+
value={
|
|
41
|
+
**response.to_dict(),
|
|
42
|
+
"content": content_list,
|
|
43
|
+
},
|
|
44
|
+
)
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import inspect
|
|
4
|
+
from typing import Any, Literal, Optional, cast
|
|
5
|
+
from typing_extensions import assert_never
|
|
6
|
+
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
from ..._utils import is_list
|
|
10
|
+
|
|
11
|
+
SupportedTypes = Literal[
|
|
12
|
+
"object",
|
|
13
|
+
"array",
|
|
14
|
+
"string",
|
|
15
|
+
"integer",
|
|
16
|
+
"number",
|
|
17
|
+
"boolean",
|
|
18
|
+
"null",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
SupportedStringFormats = {
|
|
22
|
+
"date-time",
|
|
23
|
+
"time",
|
|
24
|
+
"date",
|
|
25
|
+
"duration",
|
|
26
|
+
"email",
|
|
27
|
+
"hostname",
|
|
28
|
+
"uri",
|
|
29
|
+
"ipv4",
|
|
30
|
+
"ipv6",
|
|
31
|
+
"uuid",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_transformed_string(
|
|
36
|
+
schema: dict[str, Any],
|
|
37
|
+
) -> dict[str, Any]:
|
|
38
|
+
"""Transforms a JSON schema of type string to ensure it conforms to the API's expectations.
|
|
39
|
+
|
|
40
|
+
Specifically, it ensures that if the schema is of type "string" and does not already
|
|
41
|
+
specify a "format", it sets the format to "text".
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
schema: The original JSON schema.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
The transformed JSON schema.
|
|
48
|
+
"""
|
|
49
|
+
if schema.get("type") == "string" and "format" not in schema:
|
|
50
|
+
schema["format"] = "text"
|
|
51
|
+
return schema
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def transform_schema(
|
|
55
|
+
json_schema: type[pydantic.BaseModel] | dict[str, Any],
|
|
56
|
+
) -> dict[str, Any]:
|
|
57
|
+
"""
|
|
58
|
+
Transforms a JSON schema to ensure it conforms to the API's expectations.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
json_schema (Dict[str, Any]): The original JSON schema.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
The transformed JSON schema.
|
|
65
|
+
|
|
66
|
+
Examples:
|
|
67
|
+
>>> transform_schema(
|
|
68
|
+
... {
|
|
69
|
+
... "type": "integer",
|
|
70
|
+
... "minimum": 1,
|
|
71
|
+
... "maximum": 10,
|
|
72
|
+
... "description": "A number",
|
|
73
|
+
... }
|
|
74
|
+
... )
|
|
75
|
+
{'type': 'integer', 'description': 'A number\n\n{minimum: 1, maximum: 10}'}
|
|
76
|
+
"""
|
|
77
|
+
if inspect.isclass(json_schema) and issubclass(json_schema, pydantic.BaseModel): # pyright: ignore[reportUnnecessaryIsInstance]
|
|
78
|
+
json_schema = json_schema.model_json_schema()
|
|
79
|
+
|
|
80
|
+
strict_schema: dict[str, Any] = {}
|
|
81
|
+
json_schema = {**json_schema}
|
|
82
|
+
|
|
83
|
+
ref = json_schema.pop("$ref", None)
|
|
84
|
+
if ref is not None:
|
|
85
|
+
strict_schema["$ref"] = ref
|
|
86
|
+
return strict_schema
|
|
87
|
+
|
|
88
|
+
defs = json_schema.pop("$defs", None)
|
|
89
|
+
if defs is not None:
|
|
90
|
+
strict_defs: dict[str, Any] = {}
|
|
91
|
+
strict_schema["$defs"] = strict_defs
|
|
92
|
+
|
|
93
|
+
for name, schema in defs.items():
|
|
94
|
+
strict_defs[name] = transform_schema(schema)
|
|
95
|
+
|
|
96
|
+
type_: Optional[SupportedTypes] = json_schema.pop("type", None)
|
|
97
|
+
any_of = json_schema.pop("anyOf", None)
|
|
98
|
+
one_of = json_schema.pop("oneOf", None)
|
|
99
|
+
all_of = json_schema.pop("allOf", None)
|
|
100
|
+
|
|
101
|
+
if is_list(any_of):
|
|
102
|
+
strict_schema["anyOf"] = [transform_schema(cast("dict[str, Any]", variant)) for variant in any_of]
|
|
103
|
+
elif is_list(one_of):
|
|
104
|
+
strict_schema["anyOf"] = [transform_schema(cast("dict[str, Any]", variant)) for variant in one_of]
|
|
105
|
+
elif is_list(all_of):
|
|
106
|
+
strict_schema["allOf"] = [transform_schema(cast("dict[str, Any]", variant)) for variant in all_of]
|
|
107
|
+
else:
|
|
108
|
+
if type_ is None:
|
|
109
|
+
raise ValueError("Schema must have a 'type', 'anyOf', 'oneOf', or 'allOf' field.")
|
|
110
|
+
|
|
111
|
+
strict_schema["type"] = type_
|
|
112
|
+
|
|
113
|
+
description = json_schema.pop("description", None)
|
|
114
|
+
if description is not None:
|
|
115
|
+
strict_schema["description"] = description
|
|
116
|
+
|
|
117
|
+
title = json_schema.pop("title", None)
|
|
118
|
+
if title is not None:
|
|
119
|
+
strict_schema["title"] = title
|
|
120
|
+
|
|
121
|
+
if type_ == "object":
|
|
122
|
+
strict_schema["properties"] = {
|
|
123
|
+
key: transform_schema(prop_schema) for key, prop_schema in json_schema.pop("properties", {}).items()
|
|
124
|
+
}
|
|
125
|
+
json_schema.pop("additionalProperties", None)
|
|
126
|
+
strict_schema["additionalProperties"] = False
|
|
127
|
+
|
|
128
|
+
required = json_schema.pop("required", None)
|
|
129
|
+
if required is not None:
|
|
130
|
+
strict_schema["required"] = required
|
|
131
|
+
|
|
132
|
+
elif type_ == "string":
|
|
133
|
+
format = json_schema.pop("format", None)
|
|
134
|
+
if format and format in SupportedStringFormats:
|
|
135
|
+
strict_schema["format"] = format
|
|
136
|
+
elif format:
|
|
137
|
+
# add it back so its treated as an extra property and appended to the description
|
|
138
|
+
json_schema["format"] = format
|
|
139
|
+
elif type_ == "array":
|
|
140
|
+
items = json_schema.pop("items", None)
|
|
141
|
+
if items is not None:
|
|
142
|
+
strict_schema["items"] = transform_schema(items)
|
|
143
|
+
|
|
144
|
+
min_items = json_schema.pop("minItems", None)
|
|
145
|
+
if min_items is not None and min_items == 0 or min_items == 1:
|
|
146
|
+
strict_schema["minItems"] = min_items
|
|
147
|
+
elif min_items is not None:
|
|
148
|
+
# add it back so its treated as an extra property and appended to the description
|
|
149
|
+
json_schema["minItems"] = min_items
|
|
150
|
+
|
|
151
|
+
elif type_ == "boolean" or type_ == "integer" or type_ == "number" or type_ == "null" or type_ is None:
|
|
152
|
+
pass
|
|
153
|
+
else:
|
|
154
|
+
assert_never(type_)
|
|
155
|
+
|
|
156
|
+
# if there are any propes leftover then they aren't supported, so we add them to the description
|
|
157
|
+
# so that the model *might* follow them.
|
|
158
|
+
if json_schema:
|
|
159
|
+
description = strict_schema.get("description")
|
|
160
|
+
strict_schema["description"] = (
|
|
161
|
+
(description + "\n\n" if description is not None else "")
|
|
162
|
+
+ "{"
|
|
163
|
+
+ ", ".join(f"{key}: {value}" for key, value in json_schema.items())
|
|
164
|
+
+ "}"
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
return strict_schema
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing_extensions import TypeAlias
|
|
2
|
+
|
|
1
3
|
from ._types import (
|
|
2
4
|
TextEvent as TextEvent,
|
|
3
5
|
InputJsonEvent as InputJsonEvent,
|
|
@@ -12,12 +14,20 @@ from ._messages import (
|
|
|
12
14
|
AsyncMessageStreamManager as AsyncMessageStreamManager,
|
|
13
15
|
)
|
|
14
16
|
from ._beta_types import (
|
|
15
|
-
BetaTextEvent as BetaTextEvent,
|
|
16
17
|
BetaInputJsonEvent as BetaInputJsonEvent,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
ParsedBetaTextEvent as ParsedBetaTextEvent,
|
|
19
|
+
ParsedBetaMessageStopEvent as ParsedBetaMessageStopEvent,
|
|
20
|
+
ParsedBetaMessageStreamEvent as ParsedBetaMessageStreamEvent,
|
|
21
|
+
ParsedBetaContentBlockStopEvent as ParsedBetaContentBlockStopEvent,
|
|
20
22
|
)
|
|
23
|
+
|
|
24
|
+
# For backwards compatibility
|
|
25
|
+
BetaTextEvent: TypeAlias = ParsedBetaTextEvent
|
|
26
|
+
BetaMessageStopEvent: TypeAlias = ParsedBetaMessageStopEvent[object]
|
|
27
|
+
BetaMessageStreamEvent: TypeAlias = ParsedBetaMessageStreamEvent
|
|
28
|
+
BetaContentBlockStopEvent: TypeAlias = ParsedBetaContentBlockStopEvent[object]
|
|
29
|
+
|
|
30
|
+
|
|
21
31
|
from ._beta_messages import (
|
|
22
32
|
BetaMessageStream as BetaMessageStream,
|
|
23
33
|
BetaAsyncMessageStream as BetaAsyncMessageStream,
|