Skip to content

Commit 1687f0c

Browse files
authored
[Firebase AI] More naming updates (#14779)
1 parent 6ae6d9e commit 1687f0c

File tree

11 files changed

+30
-39
lines changed

11 files changed

+30
-39
lines changed

FirebaseAI/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Vertex AI for Firebase SDK
1+
# Firebase AI SDK
22

33
- For developer documentation, please visit https://firebase.google.com/docs/vertex-ai.
44
- Try out the [sample app](https://github.com/firebase/quickstart-ios/tree/main/vertexai to get started.
@@ -7,15 +7,15 @@
77

88
After following the Swift Package Manager
99
[setup instructions](https://github.com/firebase/firebase-ios-sdk#swift-package-manager-1),
10-
choose the `FirebaseVertexAI` scheme to build the SDK.
10+
choose the `FirebaseAI` scheme to build the SDK.
1111

1212
### Unit Tests
1313

1414
> [!IMPORTANT]
1515
> These unit tests require mock response files, which can be downloaded by
1616
running `scripts/update_vertexai_responses.sh` from the root of this repository.
1717

18-
Choose the `FirebaseVertexAIUnit` scheme to build and run the unit tests.
18+
Choose the `FirebaseAIUnit` scheme to build and run the unit tests.
1919

2020
#### Updating Mock Responses
2121

FirebaseAI/Sample/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Vertex AI for Firebase Quickstart
1+
# Firebase AI SDK Quickstart
22

33
Try out the
4-
[Vertex AI Quickstart](https://github.com/firebase/quickstart-ios/tree/main/vertexai)
4+
[Firebase AI SDK Quickstart](https://github.com/firebase/quickstart-ios/tree/main/firebaseai)
55
in the `quickstart-ios` repository to get started.

FirebaseAI/Sources/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Foundation
1616

17-
/// Constants associated with the Vertex AI for Firebase SDK.
17+
/// Constants associated with the Firebase AI SDK.
1818
enum Constants {
1919
/// The base reverse-DNS name for `NSError` or `CustomNSError` error domains.
2020
///

FirebaseAI/Sources/FirebaseAI.swift

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Foundation
2020
// Avoids exposing internal FirebaseCore APIs to Swift users.
2121
internal import FirebaseCoreExtension
2222

23-
/// The Vertex AI for Firebase SDK provides access to Gemini models directly from your app.
23+
/// The Firebase AI SDK provides access to Gemini models directly from your app.
2424
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2525
public final class FirebaseAI: Sendable {
2626
// MARK: - Public APIs
@@ -95,7 +95,7 @@ public final class FirebaseAI: Sendable {
9595

9696
/// **[Public Preview]** Initializes an ``ImagenModel`` with the given parameters.
9797
///
98-
/// > Warning: For Vertex AI in Firebase, image generation using Imagen 3 models is in Public
98+
/// > Warning: For Firebase AI SDK, image generation using Imagen 3 models is in Public
9999
/// Preview, which means that the feature is not subject to any SLA or deprecation policy and
100100
/// could change in backwards-incompatible ways.
101101
///
@@ -129,32 +129,23 @@ public final class FirebaseAI: Sendable {
129129
)
130130
}
131131

132-
/// Class to enable VertexAI to register via the Objective-C based Firebase component system
133-
/// to include VertexAI in the userAgent.
132+
/// Class to enable FirebaseAI to register via the Objective-C based Firebase component system
133+
/// to include FirebaseAI in the userAgent.
134134
@objc(FIRVertexAIComponent) class FirebaseVertexAIComponent: NSObject {}
135135

136136
// MARK: - Private
137137

138-
/// Firebase data relevant to Vertex AI.
138+
/// Firebase data relevant to Firebase AI.
139139
let firebaseInfo: FirebaseInfo
140140

141141
let apiConfig: APIConfig
142142

143-
#if compiler(>=6)
144-
/// A map of active `VertexAI` instances keyed by the `FirebaseApp` name and the `location`, in
145-
/// the format `appName:location`.
146-
private nonisolated(unsafe) static var instances: [InstanceKey: FirebaseAI] = [:]
143+
/// A map of active `FirebaseAI` instances keyed by the `FirebaseApp` name and the `location`,
144+
/// in the format `appName:location`.
145+
private nonisolated(unsafe) static var instances: [InstanceKey: FirebaseAI] = [:]
147146

148-
/// Lock to manage access to the `instances` array to avoid race conditions.
149-
private nonisolated(unsafe) static var instancesLock: os_unfair_lock = .init()
150-
#else
151-
/// A map of active `VertexAI` instances keyed by the `FirebaseApp` name and the `location`, in
152-
/// the format `appName:location`.
153-
private static var instances: [InstanceKey: VertexAI] = [:]
154-
155-
/// Lock to manage access to the `instances` array to avoid race conditions.
156-
private static var instancesLock: os_unfair_lock = .init()
157-
#endif
147+
/// Lock to manage access to the `instances` array to avoid race conditions.
148+
private nonisolated(unsafe) static var instancesLock: os_unfair_lock = .init()
158149

159150
let location: String?
160151

@@ -225,7 +216,7 @@ public final class FirebaseAI: Sendable {
225216

226217
private func vertexAIModelResourceName(modelName: String) -> String {
227218
guard let location else {
228-
fatalError("Location must be specified for the Vertex AI service.")
219+
fatalError("Location must be specified for the Firebase AI service.")
229220
}
230221
guard !location.isEmpty && location
231222
.allSatisfy({ !$0.isWhitespace && !$0.isNewline && $0 != "/" }) else {
@@ -250,7 +241,7 @@ public final class FirebaseAI: Sendable {
250241
}
251242
}
252243

253-
/// Identifier for a unique instance of ``VertexAI``.
244+
/// Identifier for a unique instance of ``FirebaseAI``.
254245
///
255246
/// This type is `Hashable` so that it can be used as a key in the `instances` dictionary.
256247
private struct InstanceKey: Sendable, Hashable {

FirebaseAI/Sources/FirebaseInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Foundation
1919
@preconcurrency import FirebaseAuthInterop
2020
@preconcurrency import FirebaseCore
2121

22-
/// Firebase data used by VertexAI
22+
/// Firebase data used by FirebaseAI
2323
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2424
struct FirebaseInfo: Sendable {
2525
let appCheck: AppCheckInterop?

FirebaseAI/Sources/GenerativeModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public final class GenerativeModel: Sendable {
5959
/// - modelName: The name of the model, for example "gemini-2.0-flash".
6060
/// - modelResourceName: The model resource name corresponding with `modelName` in the backend.
6161
/// The form depends on the backend and will be one of:
62-
/// - Vertex AI via Vertex AI in Firebase:
62+
/// - Vertex AI via Firebase AI SDK:
6363
/// `"projects/{projectID}/locations/{locationID}/publishers/google/models/{modelName}"`
64-
/// - Developer API via Vertex AI in Firebase: `"projects/{projectID}/models/{modelName}"`
64+
/// - Developer API via Firebase AI SDK: `"projects/{projectID}/models/{modelName}"`
6565
/// - Developer API via Generative Language: `"models/{modelName}"`
6666
/// - firebaseInfo: Firebase data used by the SDK, including project ID and API key.
6767
/// - apiConfig: Configuration for the backend API used by this model.

FirebaseAI/Sources/Types/Internal/APIConfig.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ extension APIConfig {
6969
extension APIConfig.Service {
7070
/// Network addresses for generative AI API services.
7171
enum Endpoint: String {
72-
/// The Vertex AI in Firebase production endpoint.
72+
/// The Firebase AI SDK production endpoint.
7373
case firebaseVertexAIProd = "https://firebasevertexai.googleapis.com"
7474

75-
/// The Vertex AI in Firebase staging endpoint; for SDK development and testing only.
75+
/// The Firebase AI SDK staging endpoint; for SDK development and testing only.
7676
case firebaseVertexAIStaging = "https://staging-firebasevertexai.sandbox.googleapis.com"
7777

7878
/// The Gemini Developer API production endpoint; for SDK development and testing only.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import Foundation
2121
/// See the [generate images
2222
/// documentation](https://firebase.google.com/docs/vertex-ai/generate-images-imagen?platform=ios)
2323
/// for more details about the image generation capabilities offered by the Imagen model in the
24-
/// Vertex AI in Firebase SDK.
24+
/// Firebase AI SDK SDK.
2525
///
26-
/// > Warning: For Vertex AI in Firebase, image generation using Imagen 3 models is in Public
26+
/// > Warning: For Firebase AI SDK, image generation using Imagen 3 models is in Public
2727
/// Preview, which means that the feature is not subject to any SLA or deprecation policy and
2828
/// could change in backwards-incompatible ways.
2929
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
@@ -73,7 +73,7 @@ public final class ImagenModel {
7373
/// > Note: By default, 1 image sample is generated; see ``ImagenGenerationConfig/numberOfImages``
7474
/// to configure the number of images that are generated.
7575
///
76-
/// > Warning: For Vertex AI in Firebase, image generation using Imagen 3 models is in Public
76+
/// > Warning: For Firebase AI SDK, image generation using Imagen 3 models is in Public
7777
/// Preview, which means that the feature is not subject to any SLA or deprecation policy and
7878
/// could change in backwards-incompatible ways.
7979
///
@@ -105,7 +105,7 @@ public final class ImagenModel {
105105
/// > Note: By default, 1 image sample is generated; see ``ImagenGenerationConfig/numberOfImages``
106106
/// to configure the number of images that are generated.
107107
///
108-
/// > Warning: For Vertex AI in Firebase, image generation using Imagen 3 models is in Public
108+
/// > Warning: For Firebase AI SDK, image generation using Imagen 3 models is in Public
109109
/// Preview, which means that the feature is not subject to any SLA or deprecation policy and
110110
/// could change in backwards-incompatible ways.
111111
///

FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ struct GenerateContentIntegrationTests {
219219
InstanceConfig.vertexV1AppCheckNotConfigured,
220220
InstanceConfig.vertexV1BetaAppCheckNotConfigured,
221221
// App Check is not supported on the Generative Language Developer API endpoint since it
222-
// bypasses the Vertex AI in Firebase proxy.
222+
// bypasses the Firebase AI SDK proxy.
223223
])
224224
func generateContent_appCheckNotConfigured_shouldFail(_ config: InstanceConfig) async throws {
225225
let model = FirebaseAI.componentInstance(config).generativeModel(

FirebaseAI/Tests/Unit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
See the Vertex AI for Firebase
1+
See the Firebase AI SDK
22
[README](https://github.com/firebase/firebase-ios-sdk/tree/main/FirebaseVertexAI#unit-tests)
33
for required setup instructions.

0 commit comments

Comments
 (0)