The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
fix(anthropic): update integration tests (#35396)
ccurme2fa460d325d0
diff --git a/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gzindex 5bba3864cd..facb0e335c 100644Binary files a/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_agent_loop.yaml.gz differdiff --git a/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_agent_loop_streaming.yaml.gzindex 7dc728333b..cdda77a3dc 100644Binary 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 differdiff --git a/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gzindex dd957413da..72ed6e1965 100644Binary files a/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_citations.yaml.gz differdiff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gzindex dd71c3d67e..01285d5648 100644Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_code_execution.yaml.gz differdiff --git a/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gznew file mode 100644index 0000000000..f5c4dcb809Binary files /dev/null and b/libs/partners/anthropic/tests/cassettes/test_code_execution_old.yaml.gz differdiff --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.gzdeleted file mode 100644index f3e5eab068..0000000000Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v0].yaml.gz and /dev/null differdiff --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.gzdeleted file mode 100644index 56bf786f3d..0000000000Binary files a/libs/partners/anthropic/tests/cassettes/test_code_execution_old[v1].yaml.gz and /dev/null differdiff --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.gzindex 4f80f56903..416277a2cd 100644Binary 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 differdiff --git a/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gzindex a9a0a51b9b..48db86a79c 100644Binary files a/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz differdiff --git a/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_fetch_v1.yaml.gzindex a2a4679c15..2b33be19dd 100644Binary 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 differdiff --git a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gzindex e8e4dea5bf..a9186820fc 100644Binary files a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz differdiff --git a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py b/libs/partners/anthropic/tests/integration_tests/test_chat_models.pyindex 74b624a94c..899f1f4a46 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 = Truechunks: 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 modelstream = llm_with_tools.stream([@@ -1654,6 +1638,7 @@ def test_web_fetch_v1(output_version: Literal["v0", "v1"]) -> None:)[email protected]_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: