@@ -2126,10 +2126,11 @@ def test_parse_referenced_documents_file_search_call(
21262126 mock_result1 .attributes = {
21272127 "link" : "https://example.com/doc1" ,
21282128 "title" : "Document 1" ,
2129+ "document_id" : "doc_1" ,
21292130 }
21302131
21312132 mock_result2 = {
2132- "attributes" : {"url" : "https://example.com/doc2" , "title" : "Document 2" },
2133+ "attributes" : {"url" : "https://example.com/doc2" , "title" : "Document 2" , "doc_id" : "doc_2" },
21332134 }
21342135
21352136 mock_output_item = mocker .Mock ()
@@ -2143,8 +2144,10 @@ def test_parse_referenced_documents_file_search_call(
21432144 assert len (result ) == 2
21442145 assert result [0 ].doc_title == "Document 1"
21452146 assert result [0 ].doc_url == AnyUrl ("https://example.com/doc1" )
2147+ assert result [0 ].document_id == "doc_1"
21462148 assert result [1 ].doc_title == "Document 2"
21472149 assert result [1 ].doc_url == AnyUrl ("https://example.com/doc2" )
2150+ assert result [1 ].document_id == "doc_2"
21482151
21492152 def test_parse_referenced_documents_message_annotations (
21502153 self , mocker : MockerFixture
@@ -2206,6 +2209,7 @@ def test_parse_referenced_documents_deduplication(
22062209 mock_result .attributes = {
22072210 "link" : "https://example.com/doc1" ,
22082211 "title" : "Document 1" ,
2212+ "document_id" : "doc_1" ,
22092213 }
22102214
22112215 mock_output_item = mocker .Mock ()
@@ -2992,6 +2996,7 @@ def test_single_store_source_populated(self, mocker: MockerFixture) -> None:
29922996 mock_result .attributes = {
29932997 "url" : "https://docs.example.com/page" ,
29942998 "title" : "Example Page" ,
2999+ "document_id" : "doc_page_1" ,
29953000 }
29963001
29973002 mock_output = mocker .Mock ()
@@ -3014,7 +3019,7 @@ def test_single_store_source_populated(self, mocker: MockerFixture) -> None:
30143019 def test_no_mapping_source_is_none (self , mocker : MockerFixture ) -> None :
30153020 """Test that source is None when no mapping provided."""
30163021 mock_result = mocker .Mock ()
3017- mock_result .attributes = {"title" : "Doc" }
3022+ mock_result .attributes = {"title" : "Doc" , "document_id" : "doc_no_mapping" }
30183023
30193024 mock_output = mocker .Mock ()
30203025 mock_output .type = "file_search_call"
@@ -3031,7 +3036,7 @@ def test_no_mapping_source_is_none(self, mocker: MockerFixture) -> None:
30313036 def test_multiple_stores_source_is_none (self , mocker : MockerFixture ) -> None :
30323037 """Test that source is None with multiple stores (ambiguous)."""
30333038 mock_result = mocker .Mock ()
3034- mock_result .attributes = {"title" : "Doc" }
3039+ mock_result .attributes = {"title" : "Doc" , "document_id" : "doc_multi_stores" }
30353040
30363041 mock_output = mocker .Mock ()
30373042 mock_output .type = "file_search_call"
0 commit comments