Skip to content

Commit 678e3ca

Browse files
Update FirebaseVertexAI/Sources/GenerateContentResponse.swift
Co-authored-by: Andrew Heard <andrewheard@google.com>
1 parent 4015b32 commit 678e3ca

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

FirebaseVertexAI/Sources/GenerateContentResponse.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,7 @@ public struct GenerateContentResponse: Sendable {
9797
)
9898
return []
9999
}
100-
let inlineDataParts: [InlineDataPart] = candidate.content.parts.compactMap { part in
101-
switch part {
102-
case let inlineDataPart as InlineDataPart:
103-
return inlineDataPart
104-
default:
105-
return nil
106-
}
107-
}
108-
return inlineDataParts
100+
return candidate.content.parts.compactMap { $0 as? InlineDataPart }
109101
}
110102

111103
/// Initializer for SwiftUI previews or tests.

0 commit comments

Comments
 (0)