Skip to content

Commit 52b23fe

Browse files
authored
Merge branch 'main' into dependabot/gradle/org.mockito-mockito-core-5.20.0
2 parents 3f94af1 + d7d820a commit 52b23fe

File tree

52 files changed

+793
-114
lines changed

Some content is hidden

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

52 files changed

+793
-114
lines changed

.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.15.1' }}
37+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.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.15.1' }}
21+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.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

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fun Project.applySpotless() {
6262
}
6363
format("styling") {
6464
target("src/**/*.md", "*.md", "docs/**/*.md")
65-
targetExclude("**/third_party/**", "src/test/resources/**")
65+
targetExclude("**/third_party/**", "src/test/resources/**", "release_report.md")
6666
prettier().config(mapOf("printWidth" to 100, "proseWrap" to "always"))
6767
}
6868
}

firebase-ai/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Unreleased
22

33
- [changed] **Breaking Change**: Removed the `candidateCount` option from `LiveGenerationConfig`
4+
- [changed] Added support for the URL context tool, which allows the model to access content from
5+
provided public web URLs to inform and enhance its responses. (#7382)
6+
- [changed] Added better error messages to `ServiceConnectionHandshakeFailedException` (#7412)
7+
- [changed] Marked the public constructor for `UsageMetadata` as deprecated (#7420)
8+
- [changed] Using Firebase AI Logic with the Gemini Developer API is now Generally Available (GA).
9+
- [changed] Using Firebase AI Logic with the Imagen generation APIs is now Generally Available (GA).
410

511
# 17.3.0
612

@@ -44,7 +50,7 @@
4450

4551
- [feature] Added support for configuring the "thinking" budget when using Gemini 2.5 series models.
4652
(#6990)
47-
- [feature] **Breaking Change**: Add support for Grounding with Google Search (#7042).
53+
- [feature] **Breaking Change**: Add support for grounding with Google Search (#7042).
4854
- **Action Required:** Update all references of `groundingAttributions`, `webSearchQueries`,
4955
`retrievalQueries` in `GroundingMetadata` to be non-optional.
5056
- [changed] require at least one argument for `generateContent()`, `generateContentStream()` and

firebase-ai/api.txt

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ package com.google.firebase.ai.type {
191191
method public com.google.firebase.ai.type.FinishReason? getFinishReason();
192192
method public com.google.firebase.ai.type.GroundingMetadata? getGroundingMetadata();
193193
method public java.util.List<com.google.firebase.ai.type.SafetyRating> getSafetyRatings();
194+
method public com.google.firebase.ai.type.UrlContextMetadata? getUrlContextMetadata();
194195
property public final com.google.firebase.ai.type.CitationMetadata? citationMetadata;
195196
property public final com.google.firebase.ai.type.Content content;
196197
property public final com.google.firebase.ai.type.FinishReason? finishReason;
197198
property public final com.google.firebase.ai.type.GroundingMetadata? groundingMetadata;
198199
property public final java.util.List<com.google.firebase.ai.type.SafetyRating> safetyRatings;
200+
property public final com.google.firebase.ai.type.UrlContextMetadata? urlContextMetadata;
199201
}
200202

201203
public final class Citation {
@@ -942,7 +944,7 @@ package com.google.firebase.ai.type {
942944
property public final java.util.List<com.google.firebase.ai.type.SafetyRating> safetyRatings;
943945
}
944946

945-
@kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level.ERROR, message="This API is part of an experimental public preview and may change in " + "backwards-incompatible ways without notice.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) public @interface PublicPreviewAPI {
947+
@kotlin.RequiresOptIn(level=kotlin.RequiresOptIn.Level.ERROR, message="This API is part of an experimental public preview and may change in " + "backwards-incompatible ways without notice.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.FUNCTION, kotlin.annotation.AnnotationTarget.PROPERTY}) public @interface PublicPreviewAPI {
946948
}
947949

948950
public final class QuotaExceededException extends com.google.firebase.ai.type.FirebaseAIException {
@@ -1201,13 +1203,15 @@ package com.google.firebase.ai.type {
12011203
method public static com.google.firebase.ai.type.Tool codeExecution();
12021204
method public static com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration> functionDeclarations);
12031205
method public static com.google.firebase.ai.type.Tool googleSearch(com.google.firebase.ai.type.GoogleSearch googleSearch = com.google.firebase.ai.type.GoogleSearch());
1206+
method @com.google.firebase.ai.type.PublicPreviewAPI public static com.google.firebase.ai.type.Tool urlContext(com.google.firebase.ai.type.UrlContext urlContext = com.google.firebase.ai.type.UrlContext());
12041207
field public static final com.google.firebase.ai.type.Tool.Companion Companion;
12051208
}
12061209

12071210
public static final class Tool.Companion {
12081211
method public com.google.firebase.ai.type.Tool codeExecution();
12091212
method public com.google.firebase.ai.type.Tool functionDeclarations(java.util.List<com.google.firebase.ai.type.FunctionDeclaration> functionDeclarations);
12101213
method public com.google.firebase.ai.type.Tool googleSearch(com.google.firebase.ai.type.GoogleSearch googleSearch = com.google.firebase.ai.type.GoogleSearch());
1214+
method @com.google.firebase.ai.type.PublicPreviewAPI public com.google.firebase.ai.type.Tool urlContext(com.google.firebase.ai.type.UrlContext urlContext = com.google.firebase.ai.type.UrlContext());
12111215
}
12121216

12131217
public final class ToolConfig {
@@ -1220,19 +1224,55 @@ package com.google.firebase.ai.type {
12201224
public final class UnsupportedUserLocationException extends com.google.firebase.ai.type.FirebaseAIException {
12211225
}
12221226

1227+
@com.google.firebase.ai.type.PublicPreviewAPI public final class UrlContext {
1228+
ctor public UrlContext();
1229+
}
1230+
1231+
@com.google.firebase.ai.type.PublicPreviewAPI public final class UrlContextMetadata {
1232+
method public java.util.List<com.google.firebase.ai.type.UrlMetadata> getUrlMetadata();
1233+
property public final java.util.List<com.google.firebase.ai.type.UrlMetadata> urlMetadata;
1234+
}
1235+
1236+
@com.google.firebase.ai.type.PublicPreviewAPI public final class UrlMetadata {
1237+
method public String? getRetrievedUrl();
1238+
method public com.google.firebase.ai.type.UrlRetrievalStatus getUrlRetrievalStatus();
1239+
property public final String? retrievedUrl;
1240+
property public final com.google.firebase.ai.type.UrlRetrievalStatus urlRetrievalStatus;
1241+
}
1242+
1243+
@com.google.firebase.ai.type.PublicPreviewAPI public final class UrlRetrievalStatus {
1244+
method public String getName();
1245+
method public int getOrdinal();
1246+
property public final String name;
1247+
property public final int ordinal;
1248+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus.Companion Companion;
1249+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus ERROR;
1250+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus PAYWALL;
1251+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus SUCCESS;
1252+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus UNSAFE;
1253+
field public static final com.google.firebase.ai.type.UrlRetrievalStatus UNSPECIFIED;
1254+
}
1255+
1256+
public static final class UrlRetrievalStatus.Companion {
1257+
}
1258+
12231259
public final class UsageMetadata {
1224-
ctor public UsageMetadata(int promptTokenCount, Integer? candidatesTokenCount, int totalTokenCount, java.util.List<com.google.firebase.ai.type.ModalityTokenCount> promptTokensDetails, java.util.List<com.google.firebase.ai.type.ModalityTokenCount> candidatesTokensDetails, int thoughtsTokenCount);
1260+
ctor @Deprecated public UsageMetadata(int promptTokenCount, Integer? candidatesTokenCount, int totalTokenCount, java.util.List<com.google.firebase.ai.type.ModalityTokenCount> promptTokensDetails, java.util.List<com.google.firebase.ai.type.ModalityTokenCount> candidatesTokensDetails, int thoughtsTokenCount);
12251261
method public Integer? getCandidatesTokenCount();
12261262
method public java.util.List<com.google.firebase.ai.type.ModalityTokenCount> getCandidatesTokensDetails();
12271263
method public int getPromptTokenCount();
12281264
method public java.util.List<com.google.firebase.ai.type.ModalityTokenCount> getPromptTokensDetails();
12291265
method public int getThoughtsTokenCount();
1266+
method public int getToolUsePromptTokenCount();
1267+
method public java.util.List<com.google.firebase.ai.type.ModalityTokenCount> getToolUsePromptTokensDetails();
12301268
method public int getTotalTokenCount();
12311269
property public final Integer? candidatesTokenCount;
12321270
property public final java.util.List<com.google.firebase.ai.type.ModalityTokenCount> candidatesTokensDetails;
12331271
property public final int promptTokenCount;
12341272
property public final java.util.List<com.google.firebase.ai.type.ModalityTokenCount> promptTokensDetails;
12351273
property public final int thoughtsTokenCount;
1274+
property public final int toolUsePromptTokenCount;
1275+
property public final java.util.List<com.google.firebase.ai.type.ModalityTokenCount> toolUsePromptTokensDetails;
12361276
property public final int totalTokenCount;
12371277
}
12381278

firebase-ai/gradle.properties

Lines changed: 1 addition & 1 deletion
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.3.1
15+
version=17.4.0
1616
latestReleasedVersion=17.3.0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ class AIModels {
5151
flash2Model =
5252
FirebaseAI.getInstance(app!!, GenerativeBackend.vertexAI())
5353
.generativeModel(
54-
modelName = "gemini-2.0-flash",
54+
modelName = "gemini-2.5-flash",
5555
)
5656
flash2LiteModel =
5757
FirebaseAI.getInstance(app!!, GenerativeBackend.vertexAI())
5858
.generativeModel(
59-
modelName = "gemini-2.0-flash-lite",
59+
modelName = "gemini-2.5-flash-lite",
6060
)
6161
}
6262
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class ToolTests {
299299
val model =
300300
FirebaseAI.getInstance(app(), GenerativeBackend.vertexAI())
301301
.generativeModel(
302-
modelName = "gemini-2.0-flash",
302+
modelName = "gemini-2.5-flash",
303303
toolConfig =
304304
ToolConfig(
305305
functionCallingConfig = FunctionCallingConfig(FunctionCallingConfig.Mode.ANY)

firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ internal constructor(
170170
* @return The initialized [ImagenModel] instance.
171171
*/
172172
@JvmOverloads
173-
@PublicPreviewAPI
174173
public fun imagenModel(
175174
modelName: String,
176175
generationConfig: ImagenGenerationConfig? = null,

firebase-ai/src/main/kotlin/com/google/firebase/ai/ImagenModel.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import com.google.firebase.auth.internal.InternalAuthProvider
4545
* See the documentation for a list of
4646
* [supported models](https://firebase.google.com/docs/ai-logic/models).
4747
*/
48-
@PublicPreviewAPI
4948
public class ImagenModel
5049
internal constructor(
5150
private val modelName: String,
@@ -106,6 +105,7 @@ internal constructor(
106105
* @param prompt the text input given to the model as a prompt
107106
* @param config the editing configuration settings
108107
*/
108+
@PublicPreviewAPI
109109
public suspend fun editImage(
110110
referenceImages: List<ImagenReferenceImage>,
111111
prompt: String,
@@ -130,6 +130,7 @@ internal constructor(
130130
* @param mask the mask which defines where in the image can be painted by Imagen.
131131
* @param config the editing configuration settings, it should include an [ImagenEditMode]
132132
*/
133+
@PublicPreviewAPI
133134
public suspend fun inpaintImage(
134135
image: ImagenInlineImage,
135136
prompt: String,
@@ -154,6 +155,7 @@ internal constructor(
154155
* @param config the editing configuration settings
155156
* @see [ImagenMaskReference.generateMaskAndPadForOutpainting]
156157
*/
158+
@PublicPreviewAPI
157159
public suspend fun outpaintImage(
158160
image: ImagenInlineImage,
159161
newDimensions: Dimensions,
@@ -172,6 +174,7 @@ internal constructor(
172174
prompt: String,
173175
generationConfig: ImagenGenerationConfig? = null,
174176
): GenerateImageRequest {
177+
@OptIn(PublicPreviewAPI::class)
175178
return GenerateImageRequest(
176179
listOf(GenerateImageRequest.ImagenPrompt(prompt, null)),
177180
GenerateImageRequest.ImagenParameters(
@@ -191,6 +194,7 @@ internal constructor(
191194
)
192195
}
193196

197+
@PublicPreviewAPI
194198
private fun constructEditRequest(
195199
referenceImages: List<ImagenReferenceImage>,
196200
prompt: String,

0 commit comments

Comments
 (0)