mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
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:
@@ -22,8 +22,7 @@ def _convert_annotation_from_v1(annotation: types.Annotation) -> dict[str, Any]:
|
||||
if "title" in annotation:
|
||||
out["title"] = annotation["title"]
|
||||
out["type"] = "web_search_result_location"
|
||||
if "url" in annotation:
|
||||
out["url"] = annotation["url"]
|
||||
out["url"] = annotation.get("url")
|
||||
|
||||
for key, value in annotation.get("extras", {}).items():
|
||||
if key not in out:
|
||||
|
||||
Reference in New Issue
Block a user