Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/firebaseai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ permissions:

jobs:
spm:
strategy:
matrix:
target: [FirebaseAILogicUnit, FirebaseAIUnit]
uses: ./.github/workflows/common.yml
with:
target: FirebaseAIUnit
target: ${{ matrix.target }}
setup_command: scripts/update_vertexai_responses.sh

testapp-integration:
Expand Down Expand Up @@ -77,9 +80,12 @@ jobs:
retention-days: 2

pod_lib_lint:
strategy:
matrix:
product: [FirebaseAILogic, FirebaseAI]
uses: ./.github/workflows/common_cocoapods.yml
with:
product: FirebaseAI
product: ${{ matrix.product }}
supports_swift6: true
setup_command: scripts/update_vertexai_responses.sh

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,57 @@ jobs:
name: quickstart_artifacts database
path: quickstart-ios/

quickstart_framework_firebaseai:
needs: package-head
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
SDK: "FirebaseAI"
# This is a workaround to use the FirebaseAIExampleZip scheme that does not have the SPM dependency.
SWIFT_SUFFIX: "Zip"
strategy:
matrix:
artifact: [Firebase-actions-dir, Firebase-actions-dir-dynamic]
build-env:
- os: macos-15
xcode: Xcode_16.4
runs-on: ${{ matrix.build-env.os }}
steps:
- uses: actions/checkout@v4
- name: Get framework dir
uses: actions/[email protected]
with:
name: ${{ matrix.artifact }}
run-id: ${{ github.event.inputs.zip_run_id || github.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
- name: Setup Bundler
run: ./scripts/setup_bundler.sh
- name: Move frameworks
run: |
mkdir -p "${HOME}"/ios_frameworks/
find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} +
- uses: actions/checkout@v4
- name: Setup quickstart
run: SAMPLE="$SDK" TARGET="${SDK}ExampleZip" scripts/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseAILogic/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/*
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/VertexAI/TestApp-GoogleService-Info.plist.gpg \
quickstart-ios/firebaseai/GoogleService-Info.plist "$plist_secret"
- name: Test Quickstart
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}")
- name: Remove data before upload
if: ${{ failure() }}
run: scripts/remove_data.sh firebaseai
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: quickstart_artifacts_firebaseai
path: quickstart-ios/

quickstart_framework_firestore:
needs: package-head
if: ${{ !cancelled() && (success() || github.event.inputs.zip_run_id != '') }}
Expand Down
15 changes: 3 additions & 12 deletions FirebaseAI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK
s.prefix_header_file = false

s.source_files = [
'FirebaseAI/Sources/**/*.swift',
'FirebaseAI/Wrapper/Sources/**/*.swift',
]

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

s.dependency 'FirebaseAppCheckInterop', '~> 12.4.0'
s.dependency 'FirebaseAuthInterop', '~> 12.4.0'
s.dependency 'FirebaseAILogic', '12.4.0'
s.dependency 'FirebaseCore', '~> 12.4.0'
s.dependency 'FirebaseCoreExtension', '~> 12.4.0'

s.test_spec 'unit' do |unit_tests|
unit_tests_dir = 'FirebaseAI/Tests/Unit/'
unit_tests_dir = 'FirebaseAI/Wrapper/Tests/'
unit_tests.scheme = { :code_coverage => true }
unit_tests.platforms = {
:ios => ios_deployment_target,
Expand All @@ -59,12 +57,5 @@ Build AI-powered apps and features with the Gemini API using the Firebase AI SDK
unit_tests.source_files = [
unit_tests_dir + '**/*.swift',
]
unit_tests.exclude_files = [
unit_tests_dir + 'Snippets/**/*.swift',
]
unit_tests.resources = [
unit_tests_dir + 'vertexai-sdk-test-data/mock-responses',
unit_tests_dir + 'Resources/**/*',
]
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseAuth
import FirebaseCore
import FirebaseStorage
import Testing

@testable import struct FirebaseAI.APIConfig
@testable import struct FirebaseAILogic.APIConfig

@Suite(.serialized)
struct CountTokensIntegrationTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseAuth
import FirebaseCore
Expand All @@ -23,7 +23,7 @@ import Testing
import UIKit
#endif // canImport(UIKit)

@testable import struct FirebaseAI.BackendError
@testable import struct FirebaseAILogic.BackendError

@Suite(.serialized)
struct GenerateContentIntegrationTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseAuth
import FirebaseCore
Expand All @@ -24,7 +24,7 @@ import Testing
#endif // canImport(UIKit)

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

@Suite(
.enabled(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseAuth
import FirebaseCore
import FirebaseStorage
import XCTest

@testable import struct FirebaseAI.CountTokensRequest
@testable import struct FirebaseAILogic.CountTokensRequest

// TODO(#14405): Migrate to Swift Testing and parameterize tests.
final class IntegrationTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAI/Tests/TestApp/Tests/Integration/SchemaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseAuth
import FirebaseCore
Expand All @@ -23,7 +23,7 @@ import Testing
import UIKit
#endif // canImport(UIKit)

@testable import struct FirebaseAI.BackendError
@testable import struct FirebaseAILogic.BackendError

/// Test the schema fields.
@Suite(.serialized)
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseAITestApp
import FirebaseCore
import Testing

@testable import struct FirebaseAI.APIConfig
@testable import struct FirebaseAILogic.APIConfig

struct InstanceConfig: Equatable, Encodable {
static let vertexAI_v1beta = InstanceConfig(
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/APITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest
#if canImport(AppKit)
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/ChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import FirebaseCore
import Foundation
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class ChatTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/GenerationConfigTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import Foundation
import XCTest

Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/GenerativeModelGoogleAITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import FirebaseAuthInterop
import FirebaseCore
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class GenerativeModelGoogleAITests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/GenerativeModelVertexAITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import FirebaseAuthInterop
import FirebaseCore
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class GenerativeModelVertexAITests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/JSONValueTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class JSONValueTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/PartTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Foundation
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class PartTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/PartsRepresentableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import XCTest
import CoreImage
#endif // canImport(CoreImage)

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class PartsRepresentableTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/RequestOptionsTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class RequestOptionsTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/SafetyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
final class SafetyTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Snippets/ChatSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Snippets/CloudStorageSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#if SWIFT_PACKAGE // The FirebaseStorage dependency has only been added in Package.swift.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import FirebaseStorage

Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Snippets/CountTokensSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Snippets/MultimodalSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Snippets/TextSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import FirebaseAI
import FirebaseAILogic
import FirebaseCore
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import FirebaseCore
import Foundation
import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
enum GenerativeModelTestUtil {
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAI/Tests/Unit/Types/BackendTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import XCTest

@testable import FirebaseAI
@testable import FirebaseAILogic

final class BackendTests: XCTestCase {
func testVertexAI_defaultLocation() {
Expand Down
Loading
Loading