refactor(anthropic): remove unnecessary url check (#33671)

if "url" in annotation: in Line 15 , already ensures "url" is key in
annotation , so no need to check again to set "url" key in out object

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Arun Prasad
2025-10-27 15:13:54 +00:00
committed by GitHub
parent 09102a634a
commit b3934b9580

View File

@@ -22,8 +22,7 @@ def _convert_annotation_from_v1(annotation: types.Annotation) -> dict[str, Any]:
if "title" in annotation: if "title" in annotation:
out["title"] = annotation["title"] out["title"] = annotation["title"]
out["type"] = "web_search_result_location" out["type"] = "web_search_result_location"
if "url" in annotation: out["url"] = annotation.get("url")
out["url"] = annotation["url"]
for key, value in annotation.get("extras", {}).items(): for key, value in annotation.get("extras", {}).items():
if key not in out: if key not in out: