Skip to content

Commit 423d4ce

Browse files
authored
Merge branch 'main' into dependabot/gradle/androidx.test.services-test-services-1.6.0
2 parents 5d0f674 + d8cb105 commit 423d4ce

File tree

69 files changed

+1025
-262
lines changed

Some content is hidden

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

69 files changed

+1025
-262
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: 12 additions & 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' }}
@@ -271,6 +271,17 @@ jobs:
271271
with:
272272
args: -color /github/workspace/.github/workflows/dataconnect.yml
273273

274+
shellcheck:
275+
continue-on-error: false
276+
runs-on: ubuntu-latest
277+
steps:
278+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
279+
with:
280+
show-progress: false
281+
sparse-checkout: 'firebase-dataconnect/'
282+
- name: shellcheck
283+
run: find . -name '*.sh' -print0 | xargs --verbose -0 shellcheck --norc --enable=all --shell=bash
284+
274285
python-ci-unit-tests:
275286
continue-on-error: false
276287
runs-on: ubuntu-latest

.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: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# Unreleased
2-
* [feature] added support for Imagen Editing, including inpainting, outpainting, control, style
2+
* [feature] Added support for returning thought summaries, which are synthesized
3+
versions of a model's internal reasoning process.
4+
* [fixed] Fixed an issue causing the accessor methods in `GenerateContentResponse` to throw an exception
5+
when the response contained no candidates.
6+
* [changed] Added better description for requests which fail due to the Gemini API not being
7+
configured.
8+
* [changed] Added a `dilation` parameter to `ImagenMaskReference.generateMaskAndPadForOutpainting`
9+
(#7260)
10+
11+
# 17.1.0
12+
=======
13+
* [feature] added support for Imagen Editing, including inpainting, outpainting, control, style
314
transfer, and subject references (#7075)
4-
* [feature] **Preview:** Added support for bidirectional streaming in Gemini Developer Api
15+
* [feature] **Preview:** Added support for bidirectional streaming in Gemini Developer Api
516

617
# 17.0.0
718
* [feature] Added support for configuring the "thinking" budget when using Gemini
@@ -44,4 +55,3 @@
4455

4556
Note: This feature is in Public Preview, which means that it is not subject to any SLA or
4657
deprecation policy and could change in backwards-incompatible ways.
47-

firebase-ai/api.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ package com.google.firebase.ai.java {
157157

158158
package com.google.firebase.ai.type {
159159

160+
public final class APINotConfiguredException extends com.google.firebase.ai.type.FirebaseAIException {
161+
}
162+
160163
public final class AudioRecordInitializationFailedException extends com.google.firebase.ai.type.FirebaseAIException {
161164
ctor public AudioRecordInitializationFailedException(String message);
162165
}
@@ -210,6 +213,16 @@ package com.google.firebase.ai.type {
210213
property public final java.util.List<com.google.firebase.ai.type.Citation> citations;
211214
}
212215

216+
public final class CodeExecutionResultPart implements com.google.firebase.ai.type.Part {
217+
ctor public CodeExecutionResultPart(String outcome, String output);
218+
method public String getOutcome();
219+
method public String getOutput();
220+
method public boolean isThought();
221+
property public boolean isThought;
222+
property public final String outcome;
223+
property public final String output;
224+
}
225+
213226
public final class Content {
214227
ctor public Content(String? role = "user", java.util.List<? extends com.google.firebase.ai.type.Part> parts);
215228
ctor public Content(java.util.List<? extends com.google.firebase.ai.type.Part> parts);
@@ -277,10 +290,22 @@ package com.google.firebase.ai.type {
277290
property public final int width;
278291
}
279292

293+
public final class ExecutableCodePart implements com.google.firebase.ai.type.Part {
294+
ctor public ExecutableCodePart(String language, String code);
295+
method public String getCode();
296+
method public String getLanguage();
297+
method public boolean isThought();
298+
property public final String code;
299+
property public boolean isThought;
300+
property public final String language;
301+
}
302+
280303
public final class FileDataPart implements com.google.firebase.ai.type.Part {
281304
ctor public FileDataPart(String uri, String mimeType);
282305
method public String getMimeType();
283306
method public String getUri();
307+
method public boolean isThought();
308+
property public boolean isThought;
284309
property public final String mimeType;
285310
property public final String uri;
286311
}
@@ -315,8 +340,10 @@ package com.google.firebase.ai.type {
315340
method public java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement> getArgs();
316341
method public String? getId();
317342
method public String getName();
343+
method public boolean isThought();
318344
property public final java.util.Map<java.lang.String,kotlinx.serialization.json.JsonElement> args;
319345
property public final String? id;
346+
property public boolean isThought;
320347
property public final String name;
321348
}
322349

@@ -345,7 +372,9 @@ package com.google.firebase.ai.type {
345372
method public String? getId();
346373
method public String getName();
347374
method public kotlinx.serialization.json.JsonObject getResponse();
375+
method public boolean isThought();
348376
property public final String? id;
377+
property public boolean isThought;
349378
property public final String name;
350379
property public final kotlinx.serialization.json.JsonObject response;
351380
}
@@ -357,12 +386,14 @@ package com.google.firebase.ai.type {
357386
method public java.util.List<com.google.firebase.ai.type.InlineDataPart> getInlineDataParts();
358387
method public com.google.firebase.ai.type.PromptFeedback? getPromptFeedback();
359388
method public String? getText();
389+
method public String? getThoughtSummary();
360390
method public com.google.firebase.ai.type.UsageMetadata? getUsageMetadata();
361391
property public final java.util.List<com.google.firebase.ai.type.Candidate> candidates;
362392
property public final java.util.List<com.google.firebase.ai.type.FunctionCallPart> functionCalls;
363393
property public final java.util.List<com.google.firebase.ai.type.InlineDataPart> inlineDataParts;
364394
property public final com.google.firebase.ai.type.PromptFeedback? promptFeedback;
365395
property public final String? text;
396+
property public final String? thoughtSummary;
366397
property public final com.google.firebase.ai.type.UsageMetadata? usageMetadata;
367398
}
368399

@@ -533,7 +564,9 @@ package com.google.firebase.ai.type {
533564
public final class ImagePart implements com.google.firebase.ai.type.Part {
534565
ctor public ImagePart(android.graphics.Bitmap image);
535566
method public android.graphics.Bitmap getImage();
567+
method public boolean isThought();
536568
property public final android.graphics.Bitmap image;
569+
property public boolean isThought;
537570
}
538571

539572
@com.google.firebase.ai.type.PublicPreviewAPI public final class ImagenAspectRatio {
@@ -682,12 +715,14 @@ package com.google.firebase.ai.type {
682715
@com.google.firebase.ai.type.PublicPreviewAPI public abstract class ImagenMaskReference extends com.google.firebase.ai.type.ImagenReferenceImage {
683716
method public static final java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions);
684717
method public static final java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions, com.google.firebase.ai.type.ImagenImagePlacement newPosition = com.google.firebase.ai.type.ImagenImagePlacement.CENTER);
718+
method public static final java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions, com.google.firebase.ai.type.ImagenImagePlacement newPosition = com.google.firebase.ai.type.ImagenImagePlacement.CENTER, double dilation = 0.01);
685719
field public static final com.google.firebase.ai.type.ImagenMaskReference.Companion Companion;
686720
}
687721

688722
public static final class ImagenMaskReference.Companion {
689723
method public java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions);
690724
method public java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions, com.google.firebase.ai.type.ImagenImagePlacement newPosition = com.google.firebase.ai.type.ImagenImagePlacement.CENTER);
725+
method public java.util.List<com.google.firebase.ai.type.ImagenReferenceImage> generateMaskAndPadForOutpainting(com.google.firebase.ai.type.ImagenInlineImage image, com.google.firebase.ai.type.Dimensions newDimensions, com.google.firebase.ai.type.ImagenImagePlacement newPosition = com.google.firebase.ai.type.ImagenImagePlacement.CENTER, double dilation = 0.01);
691726
}
692727

693728
@com.google.firebase.ai.type.PublicPreviewAPI public final class ImagenPersonFilterLevel {
@@ -756,7 +791,9 @@ package com.google.firebase.ai.type {
756791
ctor public InlineDataPart(byte[] inlineData, String mimeType);
757792
method public byte[] getInlineData();
758793
method public String getMimeType();
794+
method public boolean isThought();
759795
property public final byte[] inlineData;
796+
property public boolean isThought;
760797
property public final String mimeType;
761798
}
762799

@@ -865,6 +902,8 @@ package com.google.firebase.ai.type {
865902
}
866903

867904
public interface Part {
905+
method public boolean isThought();
906+
property public abstract boolean isThought;
868907
}
869908

870909
public final class PartKt {
@@ -1125,6 +1164,8 @@ package com.google.firebase.ai.type {
11251164
public final class TextPart implements com.google.firebase.ai.type.Part {
11261165
ctor public TextPart(String text);
11271166
method public String getText();
1167+
method public boolean isThought();
1168+
property public boolean isThought;
11281169
property public final String text;
11291170
}
11301171

@@ -1134,6 +1175,7 @@ package com.google.firebase.ai.type {
11341175
public static final class ThinkingConfig.Builder {
11351176
ctor public ThinkingConfig.Builder();
11361177
method public com.google.firebase.ai.type.ThinkingConfig build();
1178+
method public com.google.firebase.ai.type.ThinkingConfig.Builder setIncludeThoughts(boolean includeThoughts);
11371179
method public com.google.firebase.ai.type.ThinkingConfig.Builder setThinkingBudget(int thinkingBudget);
11381180
}
11391181

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/gradle.properties

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

15-
version=17.1.0
16-
latestReleasedVersion=17.0.0
15+
version=17.2.0
16+
latestReleasedVersion=17.1.0

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(

0 commit comments

Comments
 (0)