Skip to content
Open
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
2 changes: 2 additions & 0 deletions ai-logic/firebase-ai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- [changed] **Breaking Change**: Removed deprecated Imagen methods and types due to Imagen models being shut down in August 2026. As a replacement, you can [migrate your apps to use Gemini Image models (the "Nano Banana" models)](https://firebase.google.com/docs/ai-logic/imagen-models-migration).

# 17.15.0

- [feature] Added support for `RealtimeInputConfig` and `ActivityDetectionConfig` to configure voice activity detection in Live API. Added `sendStartActivityRealtime` and `sendStopActivityRealtime` to `LiveSession` for manual activity control. (#8080)
Expand Down
269 changes: 0 additions & 269 deletions ai-logic/firebase-ai/api.txt

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import com.google.firebase.ai.type.Content
import com.google.firebase.ai.type.GenerationConfig
import com.google.firebase.ai.type.GenerativeBackend
import com.google.firebase.ai.type.GenerativeBackendEnum
import com.google.firebase.ai.type.ImagenGenerationConfig
import com.google.firebase.ai.type.ImagenSafetySettings
import com.google.firebase.ai.type.LiveGenerationConfig
import com.google.firebase.ai.type.PublicPreviewAPI
import com.google.firebase.ai.type.RequestOptions
Expand Down Expand Up @@ -235,76 +233,6 @@ internal constructor(
)
}

/**
* Instantiates a new [ImagenModel] given the provided parameters.
*
* @param modelName The name of the model to use. See the documentation for a list of
* [supported models](https://firebase.google.com/docs/ai-logic/models).
* @param generationConfig The configuration parameters to use for image generation.
* @param safetySettings The safety bounds the model will abide by during image generation.
* @param requestOptions Configuration options for sending requests to the backend.
* @return The initialized [ImagenModel] instance.
*/
@JvmOverloads
public fun imagenModel(
modelName: String,
generationConfig: ImagenGenerationConfig? = null,
safetySettings: ImagenSafetySettings? = null,
requestOptions: RequestOptions = RequestOptions(),
): ImagenModel {
val modelUri =
when (backend.backend) {
GenerativeBackendEnum.VERTEX_AI,
GenerativeBackendEnum.AGENT_PLATFORM ->
"projects/${firebaseApp.options.projectId}/locations/${backend.location}/publishers/google/models/${modelName}"
GenerativeBackendEnum.GOOGLE_AI ->
"projects/${firebaseApp.options.projectId}/models/${modelName}"
}
if (!modelName.startsWith(IMAGEN_MODEL_NAME_PREFIX)) {
Log.w(
TAG,
"""Unsupported Imagen model "${modelName}"; see
https://firebase.google.com/docs/vertex-ai/models for a list supported Imagen model names.
"""
.trimIndent(),
)
}
return ImagenModel(
modelUri,
firebaseApp.options.apiKey,
firebaseApp,
useLimitedUseAppCheckTokens,
generationConfig,
safetySettings,
requestOptions,
appCheckProvider.get(),
internalAuthProvider.get(),
)
}

/**
* Instantiates a new [TemplateImagenModel] given the provided parameters.
*
* @param requestOptions Configuration options for sending requests to the backend.
* @return The initialized [TemplateImagenModel] instance.
*/
@JvmOverloads
@PublicPreviewAPI
public fun templateImagenModel(
requestOptions: RequestOptions = RequestOptions(),
): TemplateImagenModel {
val templateUri = getTemplateUri(backend)
return TemplateImagenModel(
templateUri,
firebaseApp.options.apiKey,
firebaseApp,
useLimitedUseAppCheckTokens,
requestOptions,
appCheckProvider.get(),
internalAuthProvider.get(),
)
}

public companion object {
/** The [FirebaseAI] instance for the default [FirebaseApp] using the Google AI Backend. */
@JvmStatic
Expand Down Expand Up @@ -354,8 +282,6 @@ internal constructor(

private const val GEMINI_MODEL_NAME_PREFIX = "gemini-"

private const val IMAGEN_MODEL_NAME_PREFIX = "imagen-"

private val TAG = FirebaseAI::class.java.simpleName
}

Expand Down
Loading
Loading