Skip to content

Commit b3934b9

Browse files
arun-geekmdrxy
andauthored
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 <[email protected]>
1 parent 09102a6 commit b3934b9

File tree

1 file changed

+1
-2
lines changed
  • libs/partners/anthropic/langchain_anthropic

1 file changed

+1
-2
lines changed

libs/partners/anthropic/langchain_anthropic/_compat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def _convert_annotation_from_v1(annotation: types.Annotation) -> dict[str, Any]:
2222
if "title" in annotation:
2323
out["title"] = annotation["title"]
2424
out["type"] = "web_search_result_location"
25-
if "url" in annotation:
26-
out["url"] = annotation["url"]
25+
out["url"] = annotation.get("url")
2726

2827
for key, value in annotation.get("extras", {}).items():
2928
if key not in out:

0 commit comments

Comments
 (0)