Skip to content

Commit acca6db

Browse files
author
David Motsonashvili
committed
format
1 parent d9cd660 commit acca6db

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

firebase-ai/app/src/main/java/com/google/firebase/quickstart/ai/FirebaseAISamples.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ val FIREBASE_AI_SAMPLES = listOf(
328328
),
329329
Sample(
330330
title = "Grounding with Google Search",
331-
description = "Use Grounding with Google Search to get responses based on up-to-date information from the web.",
331+
description = "Use Grounding with Google Search to get responses based on up-to-date information from the" +
332+
" web.",
332333
navRoute = "chat",
333334
categories = listOf(Category.TEXT, Category.DOCUMENT),
334335
modelName = "gemini-2.5-flash",
@@ -341,7 +342,8 @@ val FIREBASE_AI_SAMPLES = listOf(
341342
),
342343
Sample(
343344
title = "Server Prompt Template - Imagen",
344-
description = "Generate an image using a server prompt template. Note that you need to setup the template in the Firebase console before running this demo.",
345+
description = "Generate an image using a server prompt template. Note that you need to setup the template in" +
346+
"the Firebase console before running this demo.",
345347
navRoute = "imagen",
346348
categories = listOf(Category.IMAGE),
347349
initialPrompt = content { text("List of things that should be in the image") },
@@ -353,7 +355,8 @@ val FIREBASE_AI_SAMPLES = listOf(
353355
),
354356
Sample(
355357
title = "Server Prompt Templates - Gemini",
356-
description = "Generate an invoice using server prompt templates. Note that you need to setup the template in the Firebase console before running this demo.",
358+
description = "Generate an invoice using server prompt templates. Note that you need to setup the template" +
359+
" in the Firebase console before running this demo.",
357360
navRoute = "text",
358361
categories = listOf(Category.TEXT),
359362
initialPrompt = content { text("Jane Doe") },

firebase-ai/app/src/main/java/com/google/firebase/quickstart/ai/feature/media/imagen/ImagenViewModel.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,17 @@ class ImagenViewModel(
111111
EditingMode.OUTPAINTING -> outpaint(imagenModel, inputText)
112112
EditingMode.SUBJECT_REFERENCE -> drawReferenceSubject(imagenModel, inputText)
113113
EditingMode.STYLE_TRANSFER -> transferStyle(imagenModel, inputText)
114-
EditingMode.TEMPLATE -> generateWithTemplate(templateImagenModel, templateId!!, mapOf(templateKey!! to inputText))
114+
EditingMode.TEMPLATE ->
115+
generateWithTemplate(templateImagenModel, templateId!!, mapOf(templateKey!! to inputText))
115116
else -> generate(imagenModel, inputText)
116117
}
117118
_generatedBitmaps.value = imageResponse.images.map { it.asBitmap() }
118119
} catch (e: Exception) {
119120
val errorMessage =
120-
if ((e.localizedMessage?.contains("not found") == true) && sample.editingMode == EditingMode.TEMPLATE) {
121-
"Template was not found, please verify that your project contains a template named \"$templateId\"."
121+
if ((e.localizedMessage?.contains("not found") == true) &&
122+
sample.editingMode == EditingMode.TEMPLATE) {
123+
"Template was not found, please verify that your project contains a" +
124+
" template named \"$templateId\"."
122125
} else {
123126
e.localizedMessage
124127
}

firebase-ai/app/src/main/java/com/google/firebase/quickstart/ai/feature/text/TextGenViewModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class TextGenViewModel(
6969
} catch (e: Exception) {
7070
val errorMessage =
7171
if ((e.localizedMessage?.contains("not found") == true) && (templateId != null)) {
72-
"Template was not found, please verify that your project contains a template named \"$templateId\"."
72+
"Template was not found, please verify that your project contains a" +
73+
" template named \"$templateId\"."
7374
} else {
7475
e.localizedMessage
7576
}

0 commit comments

Comments
 (0)