anthropic 0.76.0__tar.gz → 0.77.1__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.77.1/.release-please-manifest.json +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/CHANGELOG.md +37 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/PKG-INFO +1 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/api.md +2 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/structured_outputs.py +1 -12
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/structured_outputs_streaming.py +6 -12
- {anthropic-0.76.0 → anthropic-0.77.1}/pyproject.toml +1 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_base_client.py +5 -2
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_compat.py +3 -3
- anthropic-0.77.1/src/anthropic/_utils/_json.py +35 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_version.py +1 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_parse/_response.py +29 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/streaming/__init__.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/streaming/_messages.py +74 -40
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/streaming/_types.py +42 -2
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/messages/messages.py +170 -59
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/messages/messages.py +407 -5
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/__init__.py +7 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_20250522_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_20250825_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_param.py +1 -0
- anthropic-0.77.1/src/anthropic/types/beta/beta_output_config_param.py +27 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_server_tool_use_block.py +4 -4
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_bash_20241022_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_bash_20250124_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_computer_use_20241022_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_computer_use_20250124_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_computer_use_20251124_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_bm25_20251119_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_regex_20251119_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_text_editor_20241022_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_text_editor_20250124_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_text_editor_20250429_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_text_editor_20250728_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_20250910_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_20250305_param.py +1 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_error_code.py +1 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/message_count_tokens_params.py +9 -5
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/message_create_params.py +9 -5
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/batch_create_params.py +2 -9
- anthropic-0.77.1/src/anthropic/types/json_output_format_param.py +15 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_count_tokens_params.py +4 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_create_params.py +4 -0
- anthropic-0.77.1/src/anthropic/types/output_config_param.py +19 -0
- anthropic-0.77.1/src/anthropic/types/parsed_message.py +56 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_bash_20250124_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_text_editor_20250124_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_text_editor_20250429_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_text_editor_20250728_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_20250305_param.py +3 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_request_error_param.py +8 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_result_error.py +8 -1
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/messages/test_batches.py +14 -2
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/test_messages.py +42 -6
- anthropic-0.77.1/tests/api_resources/beta/test_output_format_conversion.py +594 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/test_messages.py +42 -0
- anthropic-0.77.1/tests/lib/_parse/__inline_snapshot__/test_beta_messages/TestAsyncMessages.test_parse_uses_output_config/044ce19d-3e9c-42d2-90e7-759c978cd94b.json +3 -0
- anthropic-0.77.1/tests/lib/_parse/__inline_snapshot__/test_beta_messages/TestAsyncMessages.test_stream_with_raw_schema/48aac7c3-f271-47b3-854b-af4ed31e10bb.json +3 -0
- anthropic-0.77.1/tests/lib/_parse/__inline_snapshot__/test_messages/TestAsyncStream.test_stream_with_raw_schema/b2c4d6e8-f012-4a56-8b90-1234567890ab.json +3 -0
- anthropic-0.77.1/tests/lib/_parse/test_beta_messages.py +131 -0
- anthropic-0.77.1/tests/lib/_parse/test_messages.py +199 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/test_messages.py +3 -3
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/test_runners.py +1 -1
- anthropic-0.77.1/tests/test_utils/test_json.py +126 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/uv.lock +1 -1
- anthropic-0.76.0/.release-please-manifest.json +0 -3
- anthropic-0.76.0/src/anthropic/types/beta/beta_output_config_param.py +0 -13
- anthropic-0.76.0/tests/lib/_parse/__inline_snapshot__/test_beta_messages/TestAsyncMessages.test_stream_with_raw_schema/48aac7c3-f271-47b3-854b-af4ed31e10bb.json +0 -3
- anthropic-0.76.0/tests/lib/_parse/test_beta_messages.py +0 -43
- {anthropic-0.76.0 → anthropic-0.77.1}/.gitignore +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/CONTRIBUTING.md +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/LICENSE +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/README.md +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/SECURITY.md +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/bin/check-release-environment +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/bin/publish-pypi +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/.keep +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/auto_compaction.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/azure.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/batch_results.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/bedrock.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/images.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/logo.png +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/memory/basic.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/messages.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/messages_stream.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/text_completions_demo_async.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/text_completions_demo_sync.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/text_completions_streaming.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/thinking.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/thinking_stream.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/tools.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/tools_runner.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/tools_runner_search_tool.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/tools_stream.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/vertex.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/web_search.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/examples/web_search_stream.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/helpers.md +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/release-please-config.json +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/requirements-dev.lock +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_client.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_constants.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_decoders/jsonl.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_exceptions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_legacy_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_qs.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_resource.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_streaming.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_types.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_compat.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_datetime_parse.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_httpx.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_logs.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_proxy.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_reflection.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_resources_proxy.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_streams.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_sync.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_transform.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_typing.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/_utils/_utils.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/.keep +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_extras/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_extras/_common.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_extras/_google_auth.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/_parse/_transform.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_auth.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_beta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_beta_messages.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_client.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_stream.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/bedrock/_stream_decoder.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/foundry.md +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/foundry.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/streaming/_beta_messages.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/streaming/_beta_types.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/tools/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/tools/_beta_builtin_memory_tool.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/tools/_beta_compaction_control.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/tools/_beta_functions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/tools/_beta_runner.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/vertex/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/vertex/_auth.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/vertex/_beta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/vertex/_beta_messages.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/lib/vertex/_client.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/pagination.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/py.typed +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/beta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/messages/batches.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/skills/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/skills/skills.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/beta/skills/versions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/completions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/messages/batches.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/resources/models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/anthropic_beta_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/base64_image_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/base64_pdf_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_all_thinking_turns_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_base64_image_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_base64_pdf_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_base64_pdf_source.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_base64_pdf_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_output_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_output_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_bash_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_cache_control_ephemeral_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_cache_creation.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_char_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_char_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_config.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_content_block_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_content_block_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_page_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_page_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_search_result_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_search_result_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citation_web_search_result_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citations_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citations_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_citations_web_search_result_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_clear_thinking_20251015_edit_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_clear_thinking_20251015_edit_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_clear_tool_uses_20250919_edit_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_clear_tool_uses_20250919_edit_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_output_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_output_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_block_content.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_error_code.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_container.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_container_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_container_upload_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_container_upload_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_content_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_content_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_content_block_source_content_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_content_block_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_context_management_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_context_management_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_count_tokens_context_management_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_direct_caller.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_direct_caller_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_document_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_file_document_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_file_image_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_image_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_input_json_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_input_tokens_clear_at_least_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_input_tokens_trigger_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_json_output_format_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_tool_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_tool_default_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_tool_use_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_tool_use_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_mcp_toolset_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_create_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_delete_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_insert_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_rename_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_str_replace_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_memory_tool_20250818_view_command.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_message.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_message_delta_usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_message_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_message_tokens_count.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_metadata_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_model_info.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_plain_text_source.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_plain_text_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_content_block_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_content_block_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_content_block_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_content_block_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_message_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_message_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_message_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_raw_message_stream_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_redacted_thinking_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_redacted_thinking_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_request_document_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_request_mcp_server_tool_configuration_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_request_mcp_server_url_definition_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_request_mcp_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_search_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_server_tool_caller.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_server_tool_caller_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_server_tool_usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_server_tool_use_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_signature_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_skill.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_skill_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_stop_reason.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_citation.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_citation_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_create_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_str_replace_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_tool_result_error_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_text_editor_code_execution_view_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_config_disabled_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_config_enabled_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_thinking_turns_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_choice_any_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_choice_auto_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_choice_none_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_choice_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_choice_tool_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_reference_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_reference_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_result_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_result_error_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_search_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_search_tool_search_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_union_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_use_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_use_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_uses_keep_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_tool_uses_trigger_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_url_image_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_url_pdf_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_fetch_tool_result_error_code.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_request_error_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_block_content.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/beta_web_search_tool_result_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/deleted_file.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/file_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/file_metadata.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/file_upload_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/batch_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_deleted_message_batch.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_canceled_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_errored_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_expired_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_individual_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_request_counts.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/messages/beta_message_batch_succeeded_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/model_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/parsed_beta_message.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_create_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_create_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_delete_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_list_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skill_retrieve_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_create_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_create_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_delete_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_list_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta/skills/version_retrieve_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_api_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_authentication_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_billing_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_error_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_gateway_timeout_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_invalid_request_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_not_found_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_overloaded_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_permission_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/beta_rate_limit_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/cache_control_ephemeral_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/cache_creation.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_char_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_char_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_content_block_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_content_block_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_page_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_page_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_search_result_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citation_web_search_result_location_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citations_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citations_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citations_search_result_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/citations_web_search_result_location.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/completion.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/completion_create_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_source_content_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/content_block_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/document_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/image_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/input_json_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_count_tokens_tool_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_delta_usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_stream_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/message_tokens_count.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/batch_create_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/batch_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/deleted_message_batch.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_canceled_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_errored_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_expired_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_individual_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_request_counts.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/messages/message_batch_succeeded_result.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/metadata_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/model.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/model_info.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/model_list_params.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/model_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/plain_text_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_content_block_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_content_block_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_content_block_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_content_block_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_message_delta_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_message_start_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_message_stop_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/raw_message_stream_event.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/redacted_thinking_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/redacted_thinking_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/search_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/server_tool_usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/server_tool_use_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/server_tool_use_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/api_error_object.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/authentication_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/billing_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/error_object.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/error_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/gateway_timeout_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/invalid_request_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/not_found_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/overloaded_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/permission_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/shared/rate_limit_error.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/signature_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/stop_reason.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/text_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/text_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/text_citation.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/text_citation_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/text_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_config_disabled_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_config_enabled_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_config_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/thinking_delta.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_choice_any_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_choice_auto_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_choice_none_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_choice_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_choice_tool_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_union_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_use_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/tool_use_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/url_image_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/url_pdf_source_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/usage.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_result_block.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_result_block_content.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_result_block_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/src/anthropic/types/web_search_tool_result_block_param_content_param.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/skills/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/skills/test_versions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/test_files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/test_models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/beta/test_skills.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/messages/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/messages/test_batches.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/test_completions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/api_resources/test_models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/conftest.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/decoders/test_jsonl.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/_parse/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/_parse/test_transform.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/snapshots.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/fixtures/basic_response.txt +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/fixtures/incomplete_partial_json_response.txt +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/fixtures/tool_use_response.txt +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/helpers.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/test_beta_messages.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/streaming/test_partial_json.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/test_azure.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/test_bedrock.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/test_vertex.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/__init__.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_compaction_control/ab7b2edd-9c2d-4f53-9c04-92bb659b9caa.json +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_server_side_tool/a0a711eb-ee0e-4a42-88d6-5c7f83c0f25a.txt +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/__inline_snapshot__/test_runners/TestSyncRunTools.test_streaming_call_sync_events/9cb114c8-69bd-4111-841b-edee30333afd.json +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/__inline_snapshot__/test_runners/test_streaming_call_sync_events/9cb114c8-69bd-4111-841b-edee30333afd.json +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/tools/test_functions.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/lib/utils.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/sample_file.txt +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_client.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_deepcopy.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_extract_files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_files.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_legacy_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_models.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_qs.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_required_args.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_response.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_streaming.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_transform.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_utils/test_datetime_parse.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_utils/test_proxy.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/test_utils/test_typing.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tests/utils.py +0 -0
- {anthropic-0.76.0 → anthropic-0.77.1}/tools.md +0 -0
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.77.1 (2026-02-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.77.0...v0.77.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.77.0...v0.77.1)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **structured outputs:** send structured output beta header when format is omitted ([#1158](https://github.com/anthropics/anthropic-sdk-python/issues/1158)) ([258494e](https://github.com/anthropics/anthropic-sdk-python/commit/258494e2b814a6a096b01e50f83560b4cf4a98ad))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* remove claude-code-review workflow ([#1338](https://github.com/anthropics/anthropic-sdk-python/issues/1338)) ([aec4512](https://github.com/anthropics/anthropic-sdk-python/commit/aec4512305e8dce41df8ef0ab225f4939e099bcf))
|
|
15
|
+
|
|
16
|
+
## 0.77.0 (2026-01-29)
|
|
17
|
+
|
|
18
|
+
Full Changelog: [v0.76.0...v0.77.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.76.0...v0.77.0)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **api:** add support for Structured Outputs in the Messages API ([ad56677](https://github.com/anthropics/anthropic-sdk-python/commit/ad5667774ad2e7efd181bcfda03fab3ea50630b9))
|
|
23
|
+
* **api:** migrate sending message format in output_config rather than output_format ([af405e4](https://github.com/anthropics/anthropic-sdk-python/commit/af405e473f7cf6091cb8e711264227b9b0508528))
|
|
24
|
+
* **client:** add custom JSON encoder for extended type support ([7780e90](https://github.com/anthropics/anthropic-sdk-python/commit/7780e90bd2fe4c1116d59bc0ad543aa609fc643d))
|
|
25
|
+
* use output_config for structured outputs ([82d669d](https://github.com/anthropics/anthropic-sdk-python/commit/82d669db652ed3d9aede61fd500fabb291b8f035))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **client:** run formatter ([2e4ff86](https://github.com/anthropics/anthropic-sdk-python/commit/2e4ff86d7b8bef8fe5c4b7e62bf47dfff79f0577))
|
|
31
|
+
* remove class causing breaking change ([#1333](https://github.com/anthropics/anthropic-sdk-python/issues/1333)) ([81ee953](https://github.com/anthropics/anthropic-sdk-python/commit/81ee9533d14f9dc3753a4a1320ea744825b17e92))
|
|
32
|
+
* **structured outputs:** avoid including beta header if `output_format` is missing ([#1121](https://github.com/anthropics/anthropic-sdk-python/issues/1121)) ([062077e](https://github.com/anthropics/anthropic-sdk-python/commit/062077e50d182719637403576f59761999b3b2f5))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Chores
|
|
36
|
+
|
|
37
|
+
* **ci:** upgrade `actions/github-script` ([34df616](https://github.com/anthropics/anthropic-sdk-python/commit/34df6160ad386a7e8848e3435b22bd18bd726702))
|
|
38
|
+
* **internal:** update `actions/checkout` version ([ea50de9](https://github.com/anthropics/anthropic-sdk-python/commit/ea50de95bd1e43b8f00a45ef472330a3c8b396c8))
|
|
39
|
+
|
|
3
40
|
## 0.76.0 (2026-01-13)
|
|
4
41
|
|
|
5
42
|
Full Changelog: [v0.75.0...v0.76.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.75.0...v0.76.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: anthropic
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.77.1
|
|
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
|
|
@@ -45,6 +45,7 @@ from anthropic.types import (
|
|
|
45
45
|
DocumentBlockParam,
|
|
46
46
|
ImageBlockParam,
|
|
47
47
|
InputJSONDelta,
|
|
48
|
+
JSONOutputFormat,
|
|
48
49
|
Message,
|
|
49
50
|
MessageCountTokensTool,
|
|
50
51
|
MessageDeltaUsage,
|
|
@@ -52,6 +53,7 @@ from anthropic.types import (
|
|
|
52
53
|
MessageTokensCount,
|
|
53
54
|
Metadata,
|
|
54
55
|
Model,
|
|
56
|
+
OutputConfig,
|
|
55
57
|
PlainTextSource,
|
|
56
58
|
RawContentBlockDelta,
|
|
57
59
|
RawContentBlockDeltaEvent,
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
import pydantic
|
|
13
2
|
|
|
14
3
|
import anthropic
|
|
@@ -27,7 +16,7 @@ Extract the product name, price, and quantity from this customer message:
|
|
|
27
16
|
"Hi, I’d like to order 2 packs of Green Tea for 5.50 dollars each."
|
|
28
17
|
"""
|
|
29
18
|
|
|
30
|
-
parsed_message = client.
|
|
19
|
+
parsed_message = client.messages.parse(
|
|
31
20
|
model="claude-sonnet-4-5",
|
|
32
21
|
messages=[{"role": "user", "content": prompt}],
|
|
33
22
|
max_tokens=1024,
|
|
@@ -1,13 +1,3 @@
|
|
|
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
1
|
import pydantic
|
|
12
2
|
|
|
13
3
|
import anthropic
|
|
@@ -23,10 +13,10 @@ client = anthropic.Anthropic()
|
|
|
23
13
|
|
|
24
14
|
prompt = """
|
|
25
15
|
Extract the product name, price, and quantity from this customer message:
|
|
26
|
-
"Hi, I
|
|
16
|
+
"Hi, I'd like to order 2 packs of Green Tea for 5.50 dollars each."
|
|
27
17
|
"""
|
|
28
18
|
|
|
29
|
-
with client.
|
|
19
|
+
with client.messages.stream(
|
|
30
20
|
model="claude-sonnet-4-5",
|
|
31
21
|
messages=[{"role": "user", "content": prompt}],
|
|
32
22
|
max_tokens=1024,
|
|
@@ -35,3 +25,7 @@ with client.beta.messages.stream(
|
|
|
35
25
|
for event in stream:
|
|
36
26
|
if event.type == "text":
|
|
37
27
|
print(event.parsed_snapshot())
|
|
28
|
+
|
|
29
|
+
# Get the final parsed output
|
|
30
|
+
final_message = stream.get_final_message()
|
|
31
|
+
print(f"\nFinal parsed order: {final_message.parsed_output}")
|
|
@@ -89,6 +89,7 @@ from ._exceptions import (
|
|
|
89
89
|
APIConnectionError,
|
|
90
90
|
APIResponseValidationError,
|
|
91
91
|
)
|
|
92
|
+
from ._utils._json import openapi_dumps
|
|
92
93
|
from ._utils._httpx import get_environment_proxies
|
|
93
94
|
from ._legacy_response import LegacyAPIResponse
|
|
94
95
|
|
|
@@ -567,8 +568,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
567
568
|
kwargs["content"] = options.content
|
|
568
569
|
elif isinstance(json_data, bytes):
|
|
569
570
|
kwargs["content"] = json_data
|
|
570
|
-
|
|
571
|
-
|
|
571
|
+
elif not files:
|
|
572
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
573
|
+
# since httpx's content param overrides other body arguments
|
|
574
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
572
575
|
kwargs["files"] = files
|
|
573
576
|
else:
|
|
574
577
|
headers.pop("Content-Type", None)
|
|
@@ -145,6 +145,7 @@ def model_dump(
|
|
|
145
145
|
exclude_defaults: bool = False,
|
|
146
146
|
warnings: bool = True,
|
|
147
147
|
mode: Literal["json", "python"] = "python",
|
|
148
|
+
by_alias: bool | None = None,
|
|
148
149
|
) -> dict[str, Any]:
|
|
149
150
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
150
151
|
return model.model_dump(
|
|
@@ -154,13 +155,12 @@ def model_dump(
|
|
|
154
155
|
exclude_defaults=exclude_defaults,
|
|
155
156
|
# warnings are not supported in Pydantic v1
|
|
156
157
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
158
|
+
by_alias=by_alias,
|
|
157
159
|
)
|
|
158
160
|
return cast(
|
|
159
161
|
"dict[str, Any]",
|
|
160
162
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
161
|
-
exclude=exclude,
|
|
162
|
-
exclude_unset=exclude_unset,
|
|
163
|
-
exclude_defaults=exclude_defaults,
|
|
163
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
164
164
|
),
|
|
165
165
|
)
|
|
166
166
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|
|
@@ -5,6 +5,8 @@ from typing_extensions import TypeVar
|
|
|
5
5
|
from ..._types import NotGiven
|
|
6
6
|
from ..._models import TypeAdapter, construct_type_unchecked
|
|
7
7
|
from ..._utils._utils import is_given
|
|
8
|
+
from ...types.message import Message
|
|
9
|
+
from ...types.parsed_message import ParsedMessage, ParsedTextBlock, ParsedContentBlock
|
|
8
10
|
from ...types.beta.beta_message import BetaMessage
|
|
9
11
|
from ...types.beta.parsed_beta_message import ParsedBetaMessage, ParsedBetaTextBlock, ParsedBetaContentBlock
|
|
10
12
|
|
|
@@ -18,7 +20,7 @@ def parse_text(text: str, output_format: ResponseFormatT | NotGiven) -> Response
|
|
|
18
20
|
return None
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
def
|
|
23
|
+
def parse_beta_response(
|
|
22
24
|
*,
|
|
23
25
|
output_format: ResponseFormatT | NotGiven,
|
|
24
26
|
response: BetaMessage,
|
|
@@ -42,3 +44,29 @@ def parse_response(
|
|
|
42
44
|
"content": content_list,
|
|
43
45
|
},
|
|
44
46
|
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def parse_response(
|
|
50
|
+
*,
|
|
51
|
+
output_format: ResponseFormatT | NotGiven,
|
|
52
|
+
response: Message,
|
|
53
|
+
) -> ParsedMessage[ResponseFormatT]:
|
|
54
|
+
content_list: list[ParsedContentBlock[ResponseFormatT]] = []
|
|
55
|
+
for content in response.content:
|
|
56
|
+
if content.type == "text":
|
|
57
|
+
content_list.append(
|
|
58
|
+
construct_type_unchecked(
|
|
59
|
+
type_=ParsedTextBlock[ResponseFormatT],
|
|
60
|
+
value={**content.to_dict(), "parsed_output": parse_text(content.text, output_format)},
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
else:
|
|
64
|
+
content_list.append(content) # type: ignore
|
|
65
|
+
|
|
66
|
+
return construct_type_unchecked(
|
|
67
|
+
type_=ParsedMessage[ResponseFormatT],
|
|
68
|
+
value={
|
|
69
|
+
**response.to_dict(),
|
|
70
|
+
"content": content_list,
|
|
71
|
+
},
|
|
72
|
+
)
|
|
@@ -6,6 +6,9 @@ from ._types import (
|
|
|
6
6
|
MessageStopEvent as MessageStopEvent,
|
|
7
7
|
MessageStreamEvent as MessageStreamEvent,
|
|
8
8
|
ContentBlockStopEvent as ContentBlockStopEvent,
|
|
9
|
+
ParsedMessageStopEvent as ParsedMessageStopEvent,
|
|
10
|
+
ParsedMessageStreamEvent as ParsedMessageStreamEvent,
|
|
11
|
+
ParsedContentBlockStopEvent as ParsedContentBlockStopEvent,
|
|
9
12
|
)
|
|
10
13
|
from ._messages import (
|
|
11
14
|
MessageStream as MessageStream,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from types import TracebackType
|
|
4
|
-
from typing import TYPE_CHECKING, Any, Type, Callable, cast
|
|
4
|
+
from typing import TYPE_CHECKING, Any, Type, Generic, Callable, cast
|
|
5
5
|
from typing_extensions import Self, Iterator, Awaitable, AsyncIterator, assert_never
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
@@ -16,17 +16,21 @@ from ._types import (
|
|
|
16
16
|
ThinkingEvent,
|
|
17
17
|
InputJsonEvent,
|
|
18
18
|
SignatureEvent,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
ParsedMessageStopEvent,
|
|
20
|
+
ParsedMessageStreamEvent,
|
|
21
|
+
ParsedContentBlockStopEvent,
|
|
22
22
|
)
|
|
23
|
-
from ...types import
|
|
23
|
+
from ...types import RawMessageStreamEvent
|
|
24
|
+
from ..._types import NOT_GIVEN, NotGiven
|
|
24
25
|
from ..._utils import consume_sync_iterator, consume_async_iterator
|
|
25
26
|
from ..._models import build, construct_type, construct_type_unchecked
|
|
26
27
|
from ..._streaming import Stream, AsyncStream
|
|
28
|
+
from ..._utils._utils import is_given
|
|
29
|
+
from .._parse._response import ResponseFormatT, parse_text
|
|
30
|
+
from ...types.parsed_message import ParsedMessage, ParsedContentBlock
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
class MessageStream:
|
|
33
|
+
class MessageStream(Generic[ResponseFormatT]):
|
|
30
34
|
text_stream: Iterator[str]
|
|
31
35
|
"""Iterator over just the text deltas in the stream.
|
|
32
36
|
|
|
@@ -37,11 +41,16 @@ class MessageStream:
|
|
|
37
41
|
```
|
|
38
42
|
"""
|
|
39
43
|
|
|
40
|
-
def __init__(
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
raw_stream: Stream[RawMessageStreamEvent],
|
|
47
|
+
output_format: ResponseFormatT | NotGiven,
|
|
48
|
+
) -> None:
|
|
41
49
|
self._raw_stream = raw_stream
|
|
42
50
|
self.text_stream = self.__stream_text__()
|
|
43
51
|
self._iterator = self.__stream__()
|
|
44
|
-
self.__final_message_snapshot:
|
|
52
|
+
self.__final_message_snapshot: ParsedMessage[ResponseFormatT] | None = None
|
|
53
|
+
self.__output_format = output_format
|
|
45
54
|
|
|
46
55
|
@property
|
|
47
56
|
def response(self) -> httpx.Response:
|
|
@@ -51,10 +60,10 @@ class MessageStream:
|
|
|
51
60
|
def request_id(self) -> str | None:
|
|
52
61
|
return self.response.headers.get("request-id") # type: ignore[no-any-return]
|
|
53
62
|
|
|
54
|
-
def __next__(self) ->
|
|
63
|
+
def __next__(self) -> ParsedMessageStreamEvent[ResponseFormatT]:
|
|
55
64
|
return self._iterator.__next__()
|
|
56
65
|
|
|
57
|
-
def __iter__(self) -> Iterator[
|
|
66
|
+
def __iter__(self) -> Iterator[ParsedMessageStreamEvent[ResponseFormatT]]:
|
|
58
67
|
for item in self._iterator:
|
|
59
68
|
yield item
|
|
60
69
|
|
|
@@ -77,7 +86,7 @@ class MessageStream:
|
|
|
77
86
|
"""
|
|
78
87
|
self._raw_stream.close()
|
|
79
88
|
|
|
80
|
-
def get_final_message(self) ->
|
|
89
|
+
def get_final_message(self) -> ParsedMessage[ResponseFormatT]:
|
|
81
90
|
"""Waits until the stream has been read to completion and returns
|
|
82
91
|
the accumulated `Message` object.
|
|
83
92
|
"""
|
|
@@ -112,15 +121,16 @@ class MessageStream:
|
|
|
112
121
|
|
|
113
122
|
# properties
|
|
114
123
|
@property
|
|
115
|
-
def current_message_snapshot(self) ->
|
|
124
|
+
def current_message_snapshot(self) -> ParsedMessage[ResponseFormatT]:
|
|
116
125
|
assert self.__final_message_snapshot is not None
|
|
117
126
|
return self.__final_message_snapshot
|
|
118
127
|
|
|
119
|
-
def __stream__(self) -> Iterator[
|
|
128
|
+
def __stream__(self) -> Iterator[ParsedMessageStreamEvent[ResponseFormatT]]:
|
|
120
129
|
for sse_event in self._raw_stream:
|
|
121
130
|
self.__final_message_snapshot = accumulate_event(
|
|
122
131
|
event=sse_event,
|
|
123
132
|
current_snapshot=self.__final_message_snapshot,
|
|
133
|
+
output_format=self.__output_format,
|
|
124
134
|
)
|
|
125
135
|
|
|
126
136
|
events_to_fire = build_events(event=sse_event, message_snapshot=self.current_message_snapshot)
|
|
@@ -133,7 +143,7 @@ class MessageStream:
|
|
|
133
143
|
yield chunk.delta.text
|
|
134
144
|
|
|
135
145
|
|
|
136
|
-
class MessageStreamManager:
|
|
146
|
+
class MessageStreamManager(Generic[ResponseFormatT]):
|
|
137
147
|
"""Wrapper over MessageStream that is returned by `.stream()`.
|
|
138
148
|
|
|
139
149
|
```py
|
|
@@ -146,13 +156,16 @@ class MessageStreamManager:
|
|
|
146
156
|
def __init__(
|
|
147
157
|
self,
|
|
148
158
|
api_request: Callable[[], Stream[RawMessageStreamEvent]],
|
|
159
|
+
*,
|
|
160
|
+
output_format: ResponseFormatT | NotGiven,
|
|
149
161
|
) -> None:
|
|
150
|
-
self.__stream: MessageStream | None = None
|
|
162
|
+
self.__stream: MessageStream[ResponseFormatT] | None = None
|
|
151
163
|
self.__api_request = api_request
|
|
164
|
+
self.__output_format = output_format
|
|
152
165
|
|
|
153
|
-
def __enter__(self) -> MessageStream:
|
|
166
|
+
def __enter__(self) -> MessageStream[ResponseFormatT]:
|
|
154
167
|
raw_stream = self.__api_request()
|
|
155
|
-
self.__stream = MessageStream(raw_stream)
|
|
168
|
+
self.__stream = MessageStream(raw_stream, output_format=self.__output_format)
|
|
156
169
|
return self.__stream
|
|
157
170
|
|
|
158
171
|
def __exit__(
|
|
@@ -165,7 +178,7 @@ class MessageStreamManager:
|
|
|
165
178
|
self.__stream.close()
|
|
166
179
|
|
|
167
180
|
|
|
168
|
-
class AsyncMessageStream:
|
|
181
|
+
class AsyncMessageStream(Generic[ResponseFormatT]):
|
|
169
182
|
text_stream: AsyncIterator[str]
|
|
170
183
|
"""Async iterator over just the text deltas in the stream.
|
|
171
184
|
|
|
@@ -176,11 +189,16 @@ class AsyncMessageStream:
|
|
|
176
189
|
```
|
|
177
190
|
"""
|
|
178
191
|
|
|
179
|
-
def __init__(
|
|
192
|
+
def __init__(
|
|
193
|
+
self,
|
|
194
|
+
raw_stream: AsyncStream[RawMessageStreamEvent],
|
|
195
|
+
output_format: ResponseFormatT | NotGiven,
|
|
196
|
+
) -> None:
|
|
180
197
|
self._raw_stream = raw_stream
|
|
181
198
|
self.text_stream = self.__stream_text__()
|
|
182
199
|
self._iterator = self.__stream__()
|
|
183
|
-
self.__final_message_snapshot:
|
|
200
|
+
self.__final_message_snapshot: ParsedMessage[ResponseFormatT] | None = None
|
|
201
|
+
self.__output_format = output_format
|
|
184
202
|
|
|
185
203
|
@property
|
|
186
204
|
def response(self) -> httpx.Response:
|
|
@@ -190,10 +208,10 @@ class AsyncMessageStream:
|
|
|
190
208
|
def request_id(self) -> str | None:
|
|
191
209
|
return self.response.headers.get("request-id") # type: ignore[no-any-return]
|
|
192
210
|
|
|
193
|
-
async def __anext__(self) ->
|
|
211
|
+
async def __anext__(self) -> ParsedMessageStreamEvent[ResponseFormatT]:
|
|
194
212
|
return await self._iterator.__anext__()
|
|
195
213
|
|
|
196
|
-
async def __aiter__(self) -> AsyncIterator[
|
|
214
|
+
async def __aiter__(self) -> AsyncIterator[ParsedMessageStreamEvent[ResponseFormatT]]:
|
|
197
215
|
async for item in self._iterator:
|
|
198
216
|
yield item
|
|
199
217
|
|
|
@@ -216,7 +234,7 @@ class AsyncMessageStream:
|
|
|
216
234
|
"""
|
|
217
235
|
await self._raw_stream.close()
|
|
218
236
|
|
|
219
|
-
async def get_final_message(self) ->
|
|
237
|
+
async def get_final_message(self) -> ParsedMessage[ResponseFormatT]:
|
|
220
238
|
"""Waits until the stream has been read to completion and returns
|
|
221
239
|
the accumulated `Message` object.
|
|
222
240
|
"""
|
|
@@ -251,15 +269,16 @@ class AsyncMessageStream:
|
|
|
251
269
|
|
|
252
270
|
# properties
|
|
253
271
|
@property
|
|
254
|
-
def current_message_snapshot(self) ->
|
|
272
|
+
def current_message_snapshot(self) -> ParsedMessage[ResponseFormatT]:
|
|
255
273
|
assert self.__final_message_snapshot is not None
|
|
256
274
|
return self.__final_message_snapshot
|
|
257
275
|
|
|
258
|
-
async def __stream__(self) -> AsyncIterator[
|
|
276
|
+
async def __stream__(self) -> AsyncIterator[ParsedMessageStreamEvent[ResponseFormatT]]:
|
|
259
277
|
async for sse_event in self._raw_stream:
|
|
260
278
|
self.__final_message_snapshot = accumulate_event(
|
|
261
279
|
event=sse_event,
|
|
262
280
|
current_snapshot=self.__final_message_snapshot,
|
|
281
|
+
output_format=self.__output_format,
|
|
263
282
|
)
|
|
264
283
|
|
|
265
284
|
events_to_fire = build_events(event=sse_event, message_snapshot=self.current_message_snapshot)
|
|
@@ -272,7 +291,7 @@ class AsyncMessageStream:
|
|
|
272
291
|
yield chunk.delta.text
|
|
273
292
|
|
|
274
293
|
|
|
275
|
-
class AsyncMessageStreamManager:
|
|
294
|
+
class AsyncMessageStreamManager(Generic[ResponseFormatT]):
|
|
276
295
|
"""Wrapper over AsyncMessageStream that is returned by `.stream()`
|
|
277
296
|
so that an async context manager can be used without `await`ing the
|
|
278
297
|
original client call.
|
|
@@ -287,13 +306,16 @@ class AsyncMessageStreamManager:
|
|
|
287
306
|
def __init__(
|
|
288
307
|
self,
|
|
289
308
|
api_request: Awaitable[AsyncStream[RawMessageStreamEvent]],
|
|
309
|
+
*,
|
|
310
|
+
output_format: ResponseFormatT | NotGiven = NOT_GIVEN,
|
|
290
311
|
) -> None:
|
|
291
|
-
self.__stream: AsyncMessageStream | None = None
|
|
312
|
+
self.__stream: AsyncMessageStream[ResponseFormatT] | None = None
|
|
292
313
|
self.__api_request = api_request
|
|
314
|
+
self.__output_format = output_format
|
|
293
315
|
|
|
294
|
-
async def __aenter__(self) -> AsyncMessageStream:
|
|
316
|
+
async def __aenter__(self) -> AsyncMessageStream[ResponseFormatT]:
|
|
295
317
|
raw_stream = await self.__api_request
|
|
296
|
-
self.__stream = AsyncMessageStream(raw_stream)
|
|
318
|
+
self.__stream = AsyncMessageStream(raw_stream, output_format=self.__output_format)
|
|
297
319
|
return self.__stream
|
|
298
320
|
|
|
299
321
|
async def __aexit__(
|
|
@@ -309,16 +331,18 @@ class AsyncMessageStreamManager:
|
|
|
309
331
|
def build_events(
|
|
310
332
|
*,
|
|
311
333
|
event: RawMessageStreamEvent,
|
|
312
|
-
message_snapshot:
|
|
313
|
-
) -> list[
|
|
314
|
-
events_to_fire: list[
|
|
334
|
+
message_snapshot: ParsedMessage[ResponseFormatT],
|
|
335
|
+
) -> list[ParsedMessageStreamEvent[ResponseFormatT]]:
|
|
336
|
+
events_to_fire: list[ParsedMessageStreamEvent[ResponseFormatT]] = []
|
|
315
337
|
|
|
316
338
|
if event.type == "message_start":
|
|
317
339
|
events_to_fire.append(event)
|
|
318
340
|
elif event.type == "message_delta":
|
|
319
341
|
events_to_fire.append(event)
|
|
320
342
|
elif event.type == "message_stop":
|
|
321
|
-
events_to_fire.append(
|
|
343
|
+
events_to_fire.append(
|
|
344
|
+
build(ParsedMessageStopEvent[ResponseFormatT], type="message_stop", message=message_snapshot)
|
|
345
|
+
)
|
|
322
346
|
elif event.type == "content_block_start":
|
|
323
347
|
events_to_fire.append(event)
|
|
324
348
|
elif event.type == "content_block_delta":
|
|
@@ -382,9 +406,14 @@ def build_events(
|
|
|
382
406
|
elif event.type == "content_block_stop":
|
|
383
407
|
content_block = message_snapshot.content[event.index]
|
|
384
408
|
|
|
385
|
-
|
|
386
|
-
|
|
409
|
+
event_to_fire = build(
|
|
410
|
+
ParsedContentBlockStopEvent,
|
|
411
|
+
type="content_block_stop",
|
|
412
|
+
index=event.index,
|
|
413
|
+
content_block=content_block,
|
|
387
414
|
)
|
|
415
|
+
|
|
416
|
+
events_to_fire.append(event_to_fire)
|
|
388
417
|
else:
|
|
389
418
|
# we only want exhaustive checking for linters, not at runtime
|
|
390
419
|
if TYPE_CHECKING: # type: ignore[unreachable]
|
|
@@ -404,8 +433,9 @@ TRACKS_TOOL_INPUT = (
|
|
|
404
433
|
def accumulate_event(
|
|
405
434
|
*,
|
|
406
435
|
event: RawMessageStreamEvent,
|
|
407
|
-
current_snapshot:
|
|
408
|
-
|
|
436
|
+
current_snapshot: ParsedMessage[ResponseFormatT] | None,
|
|
437
|
+
output_format: ResponseFormatT | NotGiven = NOT_GIVEN,
|
|
438
|
+
) -> ParsedMessage[ResponseFormatT]:
|
|
409
439
|
if not isinstance(cast(Any, event), BaseModel):
|
|
410
440
|
event = cast( # pyright: ignore[reportUnnecessaryCast]
|
|
411
441
|
RawMessageStreamEvent,
|
|
@@ -419,7 +449,7 @@ def accumulate_event(
|
|
|
419
449
|
|
|
420
450
|
if current_snapshot is None:
|
|
421
451
|
if event.type == "message_start":
|
|
422
|
-
return
|
|
452
|
+
return cast(ParsedMessage[ResponseFormatT], ParsedMessage.construct(**cast(Any, event.message.to_dict())))
|
|
423
453
|
|
|
424
454
|
raise RuntimeError(f'Unexpected event order, got {event.type} before "message_start"')
|
|
425
455
|
|
|
@@ -427,8 +457,8 @@ def accumulate_event(
|
|
|
427
457
|
# TODO: check index
|
|
428
458
|
current_snapshot.content.append(
|
|
429
459
|
cast(
|
|
430
|
-
|
|
431
|
-
construct_type(type_=
|
|
460
|
+
Any, # Pydantic does not support generic unions at runtime
|
|
461
|
+
construct_type(type_=ParsedContentBlock, value=event.content_block.model_dump()),
|
|
432
462
|
),
|
|
433
463
|
)
|
|
434
464
|
elif event.type == "content_block_delta":
|
|
@@ -466,6 +496,10 @@ def accumulate_event(
|
|
|
466
496
|
# we only want exhaustive checking for linters, not at runtime
|
|
467
497
|
if TYPE_CHECKING: # type: ignore[unreachable]
|
|
468
498
|
assert_never(event.delta)
|
|
499
|
+
elif event.type == "content_block_stop":
|
|
500
|
+
content_block = current_snapshot.content[event.index]
|
|
501
|
+
if content_block.type == "text" and is_given(output_format):
|
|
502
|
+
content_block.parsed_output = parse_text(content_block.text, output_format)
|
|
469
503
|
elif event.type == "message_delta":
|
|
470
504
|
current_snapshot.stop_reason = event.delta.stop_reason
|
|
471
505
|
current_snapshot.stop_sequence = event.delta.stop_sequence
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
from typing import Union
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Union, Generic, cast
|
|
2
2
|
from typing_extensions import List, Literal, Annotated
|
|
3
3
|
|
|
4
|
+
import jiter
|
|
5
|
+
|
|
4
6
|
from ...types import (
|
|
5
7
|
Message,
|
|
6
8
|
ContentBlock,
|
|
@@ -11,8 +13,10 @@ from ...types import (
|
|
|
11
13
|
ContentBlockStartEvent as RawContentBlockStartEvent,
|
|
12
14
|
RawContentBlockStopEvent,
|
|
13
15
|
)
|
|
14
|
-
from ..._models import BaseModel
|
|
16
|
+
from ..._models import BaseModel, GenericModel
|
|
17
|
+
from .._parse._response import ResponseFormatT
|
|
15
18
|
from ..._utils._transform import PropertyInfo
|
|
19
|
+
from ...types.parsed_message import ParsedMessage, ParsedContentBlock
|
|
16
20
|
from ...types.citations_delta import Citation
|
|
17
21
|
|
|
18
22
|
|
|
@@ -25,6 +29,9 @@ class TextEvent(BaseModel):
|
|
|
25
29
|
snapshot: str
|
|
26
30
|
"""The entire accumulated text"""
|
|
27
31
|
|
|
32
|
+
def parsed_snapshot(self) -> Dict[str, Any]:
|
|
33
|
+
return cast(Dict[str, Any], jiter.from_json(self.snapshot.encode("utf-8"), partial_mode="trailing-strings"))
|
|
34
|
+
|
|
28
35
|
|
|
29
36
|
class CitationEvent(BaseModel):
|
|
30
37
|
type: Literal["citation"]
|
|
@@ -98,3 +105,36 @@ MessageStreamEvent = Annotated[
|
|
|
98
105
|
],
|
|
99
106
|
PropertyInfo(discriminator="type"),
|
|
100
107
|
]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class ParsedMessageStopEvent(RawMessageStopEvent, GenericModel, Generic[ResponseFormatT]):
|
|
111
|
+
type: Literal["message_stop"]
|
|
112
|
+
|
|
113
|
+
message: ParsedMessage[ResponseFormatT]
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class ParsedContentBlockStopEvent(RawContentBlockStopEvent, GenericModel, Generic[ResponseFormatT]):
|
|
117
|
+
type: Literal["content_block_stop"]
|
|
118
|
+
|
|
119
|
+
if TYPE_CHECKING:
|
|
120
|
+
content_block: ParsedContentBlock[ResponseFormatT]
|
|
121
|
+
else:
|
|
122
|
+
content_block: ParsedContentBlock
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
ParsedMessageStreamEvent = Annotated[
|
|
126
|
+
Union[
|
|
127
|
+
TextEvent,
|
|
128
|
+
CitationEvent,
|
|
129
|
+
ThinkingEvent,
|
|
130
|
+
SignatureEvent,
|
|
131
|
+
InputJsonEvent,
|
|
132
|
+
RawMessageStartEvent,
|
|
133
|
+
RawMessageDeltaEvent,
|
|
134
|
+
ParsedMessageStopEvent[ResponseFormatT],
|
|
135
|
+
RawContentBlockStartEvent,
|
|
136
|
+
RawContentBlockDeltaEvent,
|
|
137
|
+
ParsedContentBlockStopEvent[ResponseFormatT],
|
|
138
|
+
],
|
|
139
|
+
PropertyInfo(discriminator="type"),
|
|
140
|
+
]
|