Skip to content

The agent engineering platform.

test(anthropic): enable VCR for web fetch test (#32913)

Mason Daugherty649d8a822303
diff --git a/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_fetch.yaml.gz
new file mode 100644
index 0000000000..56db91c639
Binary files /dev/null and b/libs/partners/anthropic/tests/cassettes/test_web_fetch.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 022fb42704..600495c84b 100644
--- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py
+++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py
@@ -940,8 +940,7 @@ def test_web_search() -> None:
)
-# @pytest.mark.vcr
[email protected](reason="Citations broken in Anthropic API; all other features work")
def test_web_fetch() -> None:
"""Note: this is a beta feature.
@@ -999,7 +998,9 @@ def test_web_fetch() -> None:
citation_response = llm_with_citations.invoke([citation_message])
citation_results = [
- block for block in citation_response.content if isinstance(block, dict)
+ block
+ for block in citation_response.content
+ if isinstance(block, dict) and block.get("type") == "web_fetch_tool_result"
]
assert len(citation_results) == 1 # Since max_uses=1
citation_result = citation_results[0]