Skip to content

Commit c58621b

Browse files
authored
Merge branch 'main' into davidmotson.imagen_docs_fix
2 parents ad40654 + 5e778b9 commit c58621b

File tree

26 files changed

+193
-57
lines changed

26 files changed

+193
-57
lines changed

.github/workflows/ai-nightlies.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Firebase AI Nightlies
2+
3+
on:
4+
schedule:
5+
- cron: 2 7 * * * # Runs automatically once a day
6+
workflow_dispatch: # Allow triggering the workflow manually
7+
8+
jobs:
9+
nightlies:
10+
name: "Nightlies"
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
fetch-depth: 2
17+
submodules: true
18+
19+
- name: Enable KVM
20+
run: |
21+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
22+
sudo udevadm control --reload-rules
23+
sudo udevadm trigger --name-match=kvm
24+
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
27+
with:
28+
java-version: 17
29+
distribution: temurin
30+
cache: gradle
31+
32+
- name: Add google-services.json
33+
env:
34+
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
35+
run: |
36+
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json
37+
- uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
38+
with:
39+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
40+
41+
- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
42+
43+
- name: Run tests
44+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
45+
env:
46+
FIREBASE_CI: 1
47+
FTL_RESULTS_BUCKET: android-ci
48+
FTL_RESULTS_DIR: ${{ format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt) }}
49+
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
50+
with:
51+
api-level: 31
52+
arch: x86_64
53+
ram-size: 4096M
54+
heap-size: 4096M
55+
script: |
56+
adb logcat -v time > logcat.txt &
57+
./gradlew firebase-ai:connectedCheck withErrorProne -PtargetBackend="prod"
58+
59+
- name: Upload logs
60+
if: failure()
61+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
62+
with:
63+
name: logcat.txt
64+
path: logcat.txt
65+
retention-days: 7
66+
if-no-files-found: ignore

.github/workflows/ci_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
run: |
7373
./gradlew ${{matrix.module}}:check withErrorProne
7474
- name: Compute upload file name
75+
if: always()
7576
run: |
7677
MODULE=${{matrix.module}}
7778
echo "ARTIFACT_NAME=${MODULE//:/_}" >> $GITHUB_ENV

.github/workflows/dataconnect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
3535
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
3636
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
37-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.11.1' }}
37+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.12.0' }}
3838
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
3939
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
4040
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }}

.github/workflows/dataconnect_demo_app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
env:
2020
FDC_NODE_VERSION: ${{ inputs.nodeVersion || '20' }}
21-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.11.1' }}
21+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.12.0' }}
2222
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
2323
FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools
2424
FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase

ci/fireci/fireciplugins/binary_size.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ def binary_size(pull_request, log, metrics_service_url, access_token):
5555
affected_artifacts, all_artifacts = _parse_artifacts()
5656
artifacts = affected_artifacts if pull_request else all_artifacts
5757
sdks = ','.join(artifacts)
58+
if not sdks:
59+
_logger.info(
60+
"No sdks found whose binary size to measure ("
61+
"pull_request=%s affected_artifacts=%s all_artifacts=%s)",
62+
pull_request, affected_artifacts, all_artifacts
63+
)
64+
return
5865

5966
workdir = 'health-metrics/apk-size'
6067
process = gradle.run('assemble', '--continue', gradle.P('sdks', sdks), workdir=workdir, check=False)

firebase-ai/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Unreleased
2+
* [changed] Added better description for requests which fail due to the Gemini API not being
3+
configured.
24
* [feature] added support for Imagen Editing, including inpainting, outpainting, control, style
35
transfer, and subject references (#7075)
4-
* [feature] **Preview:** Added support for bidirectional streaming in Gemini Developer Api
56

67
# 17.0.0
78
* [feature] Added support for configuring the "thinking" budget when using Gemini

firebase-ai/firebase-ai.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2121
plugins {
2222
id("firebase-library")
2323
id("kotlin-android")
24+
id("copy-google-services")
2425
alias(libs.plugins.kotlinx.serialization)
2526
}
2627

firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/AIModels.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package com.google.firebase.ai
1717

1818
import androidx.test.platform.app.InstrumentationRegistry
1919
import com.google.firebase.FirebaseApp
20-
import com.google.firebase.FirebaseOptions
2120
import com.google.firebase.ai.type.GenerativeBackend
2221

2322
class AIModels {
@@ -48,15 +47,7 @@ class AIModels {
4847

4948
fun setup() {
5049
val context = InstrumentationRegistry.getInstrumentation().context
51-
app =
52-
FirebaseApp.initializeApp(
53-
context,
54-
FirebaseOptions.Builder()
55-
.setApiKey(API_KEY)
56-
.setApplicationId(APP_ID)
57-
.setProjectId(PROJECT_ID)
58-
.build()
59-
)
50+
app = FirebaseApp.initializeApp(context)
6051
flash2Model =
6152
FirebaseAI.getInstance(app!!, GenerativeBackend.vertexAI())
6253
.generativeModel(

firebase-ai/src/androidTest/kotlin/com/google/firebase/ai/ImagenTests.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ import com.google.firebase.ai.type.ImagenEditingConfig
2222
import com.google.firebase.ai.type.ImagenRawImage
2323
import com.google.firebase.ai.type.PublicPreviewAPI
2424
import kotlinx.coroutines.runBlocking
25+
import org.junit.Ignore
2526
import org.junit.Test
2627

2728
@OptIn(PublicPreviewAPI::class)
2829
class ImagenTests {
30+
31+
@Ignore("Currently not supported by backend model")
2932
@Test
3033
fun testGenerateAndEditImage() {
3134
val imageGenerationModel = FirebaseAI.getInstance(app()).imagenModel("imagen-3.0-generate-002")

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/APIController.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ private suspend fun validateResponse(response: HttpResponse) {
334334
if (message.contains("The prompt could not be submitted")) {
335335
throw PromptBlockedException(message)
336336
}
337+
if (message.contains("genai config not found")) {
338+
throw APINotConfiguredException()
339+
}
337340
getServiceDisabledErrorDetailsOrNull(error)?.let {
338341
val errorMessage =
339342
if (it.metadata?.get("service") == "firebasevertexai.googleapis.com") {

0 commit comments

Comments
 (0)