File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed
FirebaseAI/Tests/TestApp/Tests/Integration Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -441,25 +441,14 @@ struct GenerateContentIntegrationTests {
441
441
let response = try await model. generateContent ( prompt)
442
442
443
443
let candidate = try #require( response. candidates. first)
444
- let groundingMetadata = try #require( candidate. groundingMetadata)
445
- #expect( !groundingMetadata. groundingChunks. isEmpty)
446
- #expect( !groundingMetadata. groundingSupports. isEmpty)
447
-
448
- for chunk in groundingMetadata. groundingChunks {
449
- #expect( chunk. web != nil )
450
- }
451
-
452
- for support in groundingMetadata. groundingSupports {
453
- let segment = support. segment
454
- #expect( segment. endIndex > segment. startIndex)
455
- #expect( !segment. text. isEmpty)
456
- #expect( !support. groundingChunkIndices. isEmpty)
457
-
458
- // Ensure indices point to valid chunks
459
- for index in support. groundingChunkIndices {
460
- #expect( index < groundingMetadata. groundingChunks. count)
461
- }
462
- }
444
+ let urlContextMetadata = try #require( candidate. urlContextMetadata)
445
+ #expect( urlContextMetadata. urlMetadata. count == 1 )
446
+ let urlMetadata = try #require( urlContextMetadata. urlMetadata. first)
447
+ let retrievedURL = try #require( urlMetadata. retrievedURL)
448
+ #expect(
449
+ retrievedURL == URL ( string: " https://developers.googleblog.com/en/introducing-gemma-3-270m/ " )
450
+ )
451
+ #expect( urlMetadata. retrievalStatus == . success)
463
452
}
464
453
465
454
// MARK: Streaming Tests
You can’t perform that action at this time.
0 commit comments