diff --git a/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz index 5bba3864cd2..facb0e335cf 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gz index 7dc728333be..cdda77a3dc6 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz index dd957413dac..72ed6e19657 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz index dd71c3d67ec..01285d56486 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gz new file mode 100644 index 00000000000..f5c4dcb8098 Binary files /dev/null and b/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v0].yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v0].yaml.gz deleted file mode 100644 index f3e5eab0682..00000000000 Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v0].yaml.gz and /dev/null differ diff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v1].yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v1].yaml.gz deleted file mode 100644 index 56bf786f3d7..00000000000 Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v1].yaml.gz and /dev/null differ diff --git a/libs/partners/anthropic/tests/cassettes/test_search_result_tool_message.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_search_result_tool_message.yaml.gz index 4f80f569039..416277a2cd9 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_search_result_tool_message.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_search_result_tool_message.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz index a9a0a51b9b5..48db86a79c8 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gz index a2a4679c15f..2b33be19dd0 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gz differ diff --git a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz index e8e4dea5bff..a9186820fcb 100644 Binary files a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz differ diff --git a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py index 74b624a94ce..899f1f4a46a 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py +++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py @@ -486,14 +486,7 @@ def test_tool_use() -> None: assert content_blocks[1]["args"] == tool_call["args"] # Test streaming - llm = ChatAnthropic( - model="claude-sonnet-4-5-20250929", # type: ignore[call-arg] - temperature=0, - # Add extra headers to also test token-efficient tools - model_kwargs={ - "extra_headers": {"anthropic-beta": "token-efficient-tools-2025-02-19"}, - }, - ) + llm = ChatAnthropic(model="claude-sonnet-4-5-20250929") # type: ignore[call-arg] llm_with_tools = llm.bind_tools([tool_definition]) first = True chunks: list[BaseMessage | BaseMessageChunk] = [] @@ -535,15 +528,6 @@ def test_tool_use() -> None: assert content_blocks[1]["name"] == "get_weather" assert content_blocks[1]["args"] - # Testing token-efficient tools - # https://platform.claude.com/docs/en/agents-and-tools/tool-use/token-efficient-tool-use - assert gathered.usage_metadata - assert response.usage_metadata - assert ( - gathered.usage_metadata["total_tokens"] - < response.usage_metadata["total_tokens"] - ) - # Test passing response back to model stream = llm_with_tools.stream( [ @@ -1654,6 +1638,7 @@ def test_web_fetch_v1(output_version: Literal["v0", "v1"]) -> None: ) +@pytest.mark.default_cassette("test_code_execution_old.yaml.gz") @pytest.mark.vcr @pytest.mark.parametrize("output_version", ["v0", "v1"]) def test_code_execution_old(output_version: Literal["v0", "v1"]) -> None: @@ -1752,7 +1737,6 @@ def test_code_execution(output_version: Literal["v0", "v1"]) -> None: assert block_types == { "text", "server_tool_use", - "text_editor_code_execution_tool_result", "bash_code_execution_tool_result", } else: @@ -1770,7 +1754,6 @@ def test_code_execution(output_version: Literal["v0", "v1"]) -> None: assert block_types == { "text", "server_tool_use", - "text_editor_code_execution_tool_result", "bash_code_execution_tool_result", } else: