Skip to content

Commit 6ae1700

Browse files
authored
Merge branch 'main' into ep/vertex-compile-tests
2 parents e5c03b4 + 5ff9d95 commit 6ae1700

File tree

9 files changed

+35
-5
lines changed

9 files changed

+35
-5
lines changed

firebase-crashlytics-ndk/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
2-
2+
# 19.4.3
3+
* [changed] Updated internal Crashpad version to commit `8df174`.
34

45
# 19.4.2
56
* [changed] Updated `firebase-crashlytics` dependency to v19.4.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_ABI := arm64-v8a armeabi-v7a x86_64 x86
22
APP_STL := c++_static
3-
APP_PLATFORM := android-16
3+
APP_PLATFORM := android-21

firebase-crashlytics-ndk/src/main/jni/crashpad/crashpad_util/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ LOCAL_SRC_FILES := \
4444
$(THIRD_PARTY_PATH)/crashpad/util/linux/exception_handler_protocol.cc \
4545
$(THIRD_PARTY_PATH)/crashpad/util/linux/initial_signal_dispositions.cc \
4646
$(THIRD_PARTY_PATH)/crashpad/util/linux/memory_map.cc \
47+
$(THIRD_PARTY_PATH)/crashpad/util/linux/pac_helper.cc \
4748
$(THIRD_PARTY_PATH)/crashpad/util/linux/proc_stat_reader.cc \
4849
$(THIRD_PARTY_PATH)/crashpad/util/linux/proc_task_reader.cc \
4950
$(THIRD_PARTY_PATH)/crashpad/util/linux/ptrace_broker.cc \

firebase-crashlytics-ndk/src/main/jni/crashpad/mini_chromium_base/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ LOCAL_SRC_FILES := \
2525
$(THIRD_PARTY_PATH)/mini_chromium/base/posix/safe_strerror.cc \
2626
$(THIRD_PARTY_PATH)/mini_chromium/base/process/memory.cc \
2727
$(THIRD_PARTY_PATH)/mini_chromium/base/rand_util.cc \
28+
$(THIRD_PARTY_PATH)/mini_chromium/base/strings/pattern.cc \
2829
$(THIRD_PARTY_PATH)/mini_chromium/base/strings/string_number_conversions.cc \
2930
$(THIRD_PARTY_PATH)/mini_chromium/base/strings/string_util.cc \
3031
$(THIRD_PARTY_PATH)/mini_chromium/base/strings/stringprintf.cc \
Submodule crashpad updated from c902f6b to 8df174c
Submodule lss updated from 9719c1e to ed31caa
Submodule mini_chromium updated from 4332ddb to 8b56c77

firebase-vertexai/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Unreleased
2+
* [feature] Emits a warning when attempting to use an incompatible model with
3+
`GenerativeModel` or `ImagenModel`.
24
* [changed] Added new exception type for quota exceeded scenarios.
35
* [feature] `CountTokenRequest` now includes `GenerationConfig` from the model.
46
* [changed] **Breaking Change**: `ImagenInlineImage.data` now returns the raw

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/FirebaseVertexAI.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.firebase.vertexai
1818

19+
import android.util.Log
1920
import com.google.firebase.Firebase
2021
import com.google.firebase.FirebaseApp
2122
import com.google.firebase.app
@@ -68,6 +69,15 @@ internal constructor(
6869
if (location.trim().isEmpty() || location.contains("/")) {
6970
throw InvalidLocationException(location)
7071
}
72+
if (!modelName.startsWith(GEMINI_MODEL_NAME_PREFIX)) {
73+
Log.w(
74+
TAG,
75+
"""Unsupported Gemini model "${modelName}"; see
76+
https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names.
77+
"""
78+
.trimIndent()
79+
)
80+
}
7181
return GenerativeModel(
7282
"projects/${firebaseApp.options.projectId}/locations/${location}/publishers/google/models/${modelName}",
7383
firebaseApp.options.apiKey,
@@ -103,6 +113,15 @@ internal constructor(
103113
if (location.trim().isEmpty() || location.contains("/")) {
104114
throw InvalidLocationException(location)
105115
}
116+
if (!modelName.startsWith(IMAGEN_MODEL_NAME_PREFIX)) {
117+
Log.w(
118+
TAG,
119+
"""Unsupported Imagen model "${modelName}"; see
120+
https://firebase.google.com/docs/vertex-ai/models for a list supported Imagen model names.
121+
"""
122+
.trimIndent()
123+
)
124+
}
106125
return ImagenModel(
107126
"projects/${firebaseApp.options.projectId}/locations/${location}/publishers/google/models/${modelName}",
108127
firebaseApp.options.apiKey,
@@ -136,6 +155,12 @@ internal constructor(
136155
val multiResourceComponent = app[FirebaseVertexAIMultiResourceComponent::class.java]
137156
return multiResourceComponent.get(location)
138157
}
158+
159+
private const val GEMINI_MODEL_NAME_PREFIX = "gemini-"
160+
161+
private const val IMAGEN_MODEL_NAME_PREFIX = "imagen-"
162+
163+
private val TAG = FirebaseVertexAI::class.java.simpleName
139164
}
140165
}
141166

0 commit comments

Comments
 (0)