Python: fix: keep citation get_url metadata (#6037)

* fix: keep citation get_url metadata

* fix: satisfy citation metadata mypy check
This commit is contained in:
Yufeng He
2026-05-28 04:09:02 +08:00
committed by GitHub
Unverified
parent 1d301af7d2
commit 4c4e1d9b87
2 changed files with 8 additions and 1 deletions
@@ -3407,9 +3407,11 @@ def test_streaming_annotation_added_with_url_citation() -> None:
mock_event = MagicMock()
mock_event.type = "response.output_text.annotation.added"
mock_event.annotation_index = 0
get_url = "https://example.search.windows.net/indexes/docs/documents/doc-123?api-version=2024-07-01"
mock_event.annotation = {
"type": "url_citation",
"url": "https://example.sharepoint.com/sites/my-site/doc.pdf",
"get_url": get_url,
"title": "doc.pdf",
"start_index": 100,
"end_index": 112,
@@ -3427,6 +3429,7 @@ def test_streaming_annotation_added_with_url_citation() -> None:
assert annotation["title"] == "doc.pdf"
assert annotation["url"] == "https://example.sharepoint.com/sites/my-site/doc.pdf"
assert annotation["additional_properties"]["annotation_index"] == 0
assert annotation["additional_properties"]["get_url"] == get_url
assert annotation["raw_representation"] == mock_event.annotation
assert annotation["annotated_regions"] is not None
assert len(annotation["annotated_regions"]) == 1