Skip to content

Commit a98ea60

Browse files
authored
[Firebase AI] Rename module to FirebaseAILogic (#15275)
1 parent 5deec14 commit a98ea60

File tree

60 files changed

+493
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+493
-76
lines changed

.github/workflows/firebaseai.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ permissions:
2727

2828
jobs:
2929
spm:
30+
strategy:
31+
matrix:
32+
target: [FirebaseAILogicUnit, FirebaseAIUnit]
3033
uses: ./.github/workflows/common.yml
3134
with:
32-
target: FirebaseAIUnit
35+
target: ${{ matrix.target }}
3336
setup_command: scripts/update_vertexai_responses.sh
3437

3538
testapp-integration:
@@ -77,9 +80,12 @@ jobs:
7780
retention-days: 2
7881

7982
pod_lib_lint:
83+
strategy:
84+
matrix:
85+
product: [FirebaseAILogic, FirebaseAI]
8086
uses: ./.github/workflows/common_cocoapods.yml
8187
with:
82-
product: FirebaseAI
88+
product: ${{ matrix.product }}
8389
supports_swift6: true
8490
setup_command: scripts/update_vertexai_responses.sh
8591

.github/workflows/zip.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,57 @@ jobs:
398398
name: quickstart_artifacts database
399399
path: quickstart-ios/
400400

401+
quickstart_framework_firebaseai:
402+
needs: package-head
403+
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
404+
env:
405+
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
406+
SDK: "FirebaseAI"
407+
# This is a workaround to use the FirebaseAIExampleZip scheme that does not have the SPM dependency.
408+
SWIFT_SUFFIX: "Zip"
409+
strategy:
410+
matrix:
411+
artifact: [Firebase-actions-dir, Firebase-actions-dir-dynamic]
412+
build-env:
413+
- os: macos-15
414+
xcode: Xcode_16.4
415+
runs-on: ${{ matrix.build-env.os }}
416+
steps:
417+
- uses: actions/checkout@v4
418+
- name: Get framework dir
419+
uses: actions/download-artifact@v4.1.7
420+
with:
421+
name: ${{ matrix.artifact }}
422+
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
423+
github-token: ${{ secrets.GITHUB_TOKEN }}
424+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
425+
- name: Xcode
426+
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
427+
- name: Setup Bundler
428+
run: ./scripts/setup_bundler.sh
429+
- name: Move frameworks
430+
run: |
431+
mkdir -p "${HOME}"/ios_frameworks/
432+
find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} +
433+
- uses: actions/checkout@v4
434+
- name: Setup quickstart
435+
run: SAMPLE="$SDK" TARGET="${SDK}ExampleZip" scripts/setup_quickstart_framework.sh \
436+
"${HOME}"/ios_frameworks/Firebase/FirebaseAILogic/* \
437+
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
438+
- name: Install Secret GoogleService-Info.plist
439+
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FirebaseAI/TestApp-GoogleService-Info.plist.gpg \
440+
quickstart-ios/firebaseai/GoogleService-Info.plist "$plist_secret"
441+
- name: Test Quickstart
442+
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}")
443+
- name: Remove data before upload
444+
if: ${{ failure() }}
445+
run: scripts/remove_data.sh firebaseai
446+
- uses: actions/upload-artifact@v4
447+
if: ${{ failure() }}
448+
with:
449+
name: quickstart_artifacts_firebaseai
450+
path: quickstart-ios/
451+
401452
quickstart_framework_firestore:
402453
needs: package-head
403454
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}

FirebaseAI.podspec

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK
3232
s.prefix_header_file = false
3333

3434
s.source_files = [
35-
'FirebaseAI/Sources/**/*.swift',
35+
'FirebaseAI/Wrapper/Sources/**/*.swift',
3636
]
3737

3838
s.swift_version = '5.9'
@@ -43,13 +43,11 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK
4343
s.tvos.framework = 'UIKit'
4444
s.watchos.framework = 'WatchKit'
4545

46-
s.dependency 'FirebaseAppCheckInterop', '~> 12.5.0'
47-
s.dependency 'FirebaseAuthInterop', '~> 12.5.0'
46+
s.dependency 'FirebaseAILogic', '12.5.0'
4847
s.dependency 'FirebaseCore', '~> 12.5.0'
49-
s.dependency 'FirebaseCoreExtension', '~> 12.5.0'
5048

5149
s.test_spec 'unit' do |unit_tests|
52-
unit_tests_dir = 'FirebaseAI/Tests/Unit/'
50+
unit_tests_dir = 'FirebaseAI/Wrapper/Tests/'
5351
unit_tests.scheme = { :code_coverage => true }
5452
unit_tests.platforms = {
5553
:ios => ios_deployment_target,
@@ -59,12 +57,5 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK
5957
unit_tests.source_files = [
6058
unit_tests_dir + '**/*.swift',
6159
]
62-
unit_tests.exclude_files = [
63-
unit_tests_dir + 'Snippets/**/*.swift',
64-
]
65-
unit_tests.resources = [
66-
unit_tests_dir + 'vertexai-sdk-test-data/mock-responses',
67-
unit_tests_dir + 'Resources/**/*',
68-
]
6960
end
7061
end

FirebaseAI/Tests/TestApp/Tests/Integration/CountTokensIntegrationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseAuth
1818
import FirebaseCore
1919
import FirebaseStorage
2020
import Testing
2121

22-
@testable import struct FirebaseAI.APIConfig
22+
@testable import struct FirebaseAILogic.APIConfig
2323

2424
@Suite(.serialized)
2525
struct CountTokensIntegrationTests {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseAuth
1818
import FirebaseCore
@@ -23,7 +23,7 @@ import Testing
2323
import UIKit
2424
#endif // canImport(UIKit)
2525

26-
@testable import struct FirebaseAI.BackendError
26+
@testable import struct FirebaseAILogic.BackendError
2727

2828
@Suite(.serialized)
2929
struct GenerateContentIntegrationTests {

FirebaseAI/Tests/TestApp/Tests/Integration/ImagenIntegrationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseAuth
1818
import FirebaseCore
@@ -24,7 +24,7 @@ import Testing
2424
#endif // canImport(UIKit)
2525

2626
// TODO(#14452): Remove `@testable import` when `generateImages(prompt:gcsURI:)` is public.
27-
@testable import class FirebaseAI.ImagenModel
27+
@testable import class FirebaseAILogic.ImagenModel
2828

2929
@Suite(
3030
.enabled(

FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseAuth
1818
import FirebaseCore
1919
import FirebaseStorage
2020
import XCTest
2121

22-
@testable import struct FirebaseAI.CountTokensRequest
22+
@testable import struct FirebaseAILogic.CountTokensRequest
2323

2424
// TODO(#14405): Migrate to Swift Testing and parameterize tests.
2525
final class IntegrationTests: XCTestCase {

FirebaseAI/Tests/TestApp/Tests/Integration/LiveSessionTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import SwiftUI
1818
import Testing
1919

20-
@testable import struct FirebaseAI.APIConfig
20+
@testable import struct FirebaseAILogic.APIConfig
2121

2222
@Suite(.serialized)
2323
struct LiveSessionTests {

FirebaseAI/Tests/TestApp/Tests/Integration/SchemaTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseAuth
1818
import FirebaseCore
@@ -23,7 +23,7 @@ import Testing
2323
import UIKit
2424
#endif // canImport(UIKit)
2525

26-
@testable import struct FirebaseAI.BackendError
26+
@testable import struct FirebaseAILogic.BackendError
2727

2828
/// Test the schema fields.
2929
@Suite(.serialized)

FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import FirebaseAI
15+
import FirebaseAILogic
1616
import FirebaseAITestApp
1717
import FirebaseCore
1818
import Testing
1919

20-
@testable import struct FirebaseAI.APIConfig
20+
@testable import struct FirebaseAILogic.APIConfig
2121

2222
struct InstanceConfig: Equatable, Encodable {
2323
static let vertexAI_v1beta = InstanceConfig(

0 commit comments

Comments
 (0)