Skip to content

Commit 229db86

Browse files
authored
[Firebase AI] Make GenerativeAIRequest.Response Sendable (#14947)
1 parent 5d84076 commit 229db86

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

FirebaseAI/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- [fixed] Fixed `Sendable` warnings introduced in the Xcode 26 beta. (#14947)
3+
14
# 11.13.0
25
- [feature] Initial release of the Firebase AI Logic SDK (`FirebaseAI`). This
36
SDK *replaces* the previous Vertex AI in Firebase SDK (`FirebaseVertexAI`) to

FirebaseAI/Sources/GenerativeAIRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
1818
protocol GenerativeAIRequest: Sendable, Encodable {
19-
associatedtype Response: Decodable
19+
associatedtype Response: Sendable, Decodable
2020

2121
var url: URL { get }
2222

FirebaseAI/Sources/Types/Internal/Imagen/ImagenGCSImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Foundation
1818
///
1919
/// TODO(#14451): Make this `public` and move to the `Public` directory when ready.
2020
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
21-
struct ImagenGCSImage {
21+
struct ImagenGCSImage: Sendable {
2222
/// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`.
2323
///
2424
/// > Note: To request a different format, set ``ImagenGenerationConfig/imageFormat`` in

FirebaseAI/Sources/Types/Internal/Requests/CountTokensRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension CountTokensRequest: GenerativeAIRequest {
3838

3939
/// The model's response to a count tokens request.
4040
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
41-
public struct CountTokensResponse {
41+
public struct CountTokensResponse: Sendable {
4242
/// The total number of tokens in the input given to the model as a prompt.
4343
public let totalTokens: Int
4444

FirebaseAI/Sources/Types/Public/Imagen/ImagenGenerationResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Foundation
2323
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2424
// TODO(#14451): Re-add "- ``ImagenModel/generateImages(prompt:gcsURI:)`` where `T` is
2525
// ``ImagenGCSImage``" in the DocC above.
26-
public struct ImagenGenerationResponse<T> {
26+
public struct ImagenGenerationResponse<T>: Sendable where T: Sendable {
2727
/// The images generated by Imagen; see ``ImagenInlineImage``.
2828
///
2929
/// > Important: The number of images generated may be fewer than the number requested if one or

FirebaseAI/Sources/Types/Public/Imagen/ImagenInlineImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717
/// An image generated by Imagen, represented as inline data.
1818
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
19-
public struct ImagenInlineImage {
19+
public struct ImagenInlineImage: Sendable {
2020
/// The IANA standard MIME type of the image file; either `"image/png"` or `"image/jpeg"`.
2121
///
2222
/// > Note: To request a different format, set ``ImagenGenerationConfig/imageFormat`` in

0 commit comments

Comments
 (0)