Skip to content

Commit 3bfde82

Browse files
author
David Motsonashvili
committed
formatting
1 parent 2c18396 commit 3bfde82

File tree

11 files changed

+43
-77
lines changed

11 files changed

+43
-77
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ import com.google.firebase.vertexai.type.ImagenInlineImage
3737
import com.google.firebase.vertexai.type.ImagenModelConfig
3838
import com.google.firebase.vertexai.type.PromptBlockedException
3939
import com.google.firebase.vertexai.type.RequestOptions
40-
import kotlinx.coroutines.tasks.await
4140
import kotlin.time.Duration
4241
import kotlin.time.Duration.Companion.seconds
42+
import kotlinx.coroutines.tasks.await
4343

4444
/**
4545
* Represents an image model (like Imagen), capable of generating images based on various input
@@ -163,7 +163,8 @@ internal constructor(
163163

164164
internal companion object {
165165
private val TAG = ImageModel::class.java.simpleName
166-
internal const val DEFAULT_FILTERED_ERROR = "Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback."
166+
internal const val DEFAULT_FILTERED_ERROR =
167+
"Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback."
167168
}
168169
}
169170

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/APIController.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,4 @@ private fun GenerateContentResponse.validate() = apply {
309309
?.let { throw ResponseStoppedException(this) }
310310
}
311311

312-
private fun GenerateImageResponse.validate() = apply {
313-
314-
}
312+
private fun GenerateImageResponse.validate() = apply {}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImageFormat.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.firebase.vertexai.type
1818

19-
2019
/**
2120
* Represents the format an image should be returned in.
2221
* @param mimeType A string (like "image/jpeg") specifying the encoding mimetype of the image.
@@ -37,9 +36,7 @@ private constructor(public val mimeType: String, public val compressionQuality:
3736
return ImageFormat("image/jpeg", compressionQuality)
3837
}
3938

40-
/**
41-
* An [ImageFormat] representing a PNG image
42-
*/
39+
/** An [ImageFormat] representing a PNG image */
4340
public fun png(): ImageFormat {
4441
return ImageFormat("image/png", null)
4542
}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenAspectRatio.kt

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,21 @@
1616

1717
package com.google.firebase.vertexai.type
1818

19-
/**
20-
* Represents the aspect ratio that the generated image should conform to.
21-
*/
19+
/** Represents the aspect ratio that the generated image should conform to. */
2220
@Suppress("EnumEntryName")
2321
public enum class ImagenAspectRatio(internal val internalVal: String) {
24-
/**
25-
* A square image, useful for icons, profile pictures, etc.
26-
*/
27-
SQUARE_1x1("1:1"),
22+
/** A square image, useful for icons, profile pictures, etc. */
23+
SQUARE_1x1("1:1"),
2824

29-
/**
30-
* A portrait image in 3:4, the aspect ratio of older TVs.
31-
*/
32-
PORTRAIT_3x4("3:4"),
25+
/** A portrait image in 3:4, the aspect ratio of older TVs. */
26+
PORTRAIT_3x4("3:4"),
3327

34-
/**
35-
* A landscape image in 4:3, the aspect ratio of older TVs.
36-
*/
37-
LANDSCAPE_4x3("4:3"),
28+
/** A landscape image in 4:3, the aspect ratio of older TVs. */
29+
LANDSCAPE_4x3("4:3"),
3830

39-
/**
40-
* A portrait image in 9:16, the aspect ratio of modern monitors and phone screens.
41-
*/
42-
PORTRAIT_9x16("9:16"),
31+
/** A portrait image in 9:16, the aspect ratio of modern monitors and phone screens. */
32+
PORTRAIT_9x16("9:16"),
4333

44-
/**
45-
* A landscape image in 16:9, the aspect ratio of modern monitors and phone screens.
46-
*/
47-
LANDSCAPE_16x9("16:9")
34+
/** A landscape image in 16:9, the aspect ratio of modern monitors and phone screens. */
35+
LANDSCAPE_16x9("16:9")
4836
}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenGCSImage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package com.google.firebase.vertexai.type
2121
*
2222
* @param gcsUri Contains the gs:// uri for the image.
2323
* @param mimeType Contains the mime type of the image eg. "image/png"
24-
* */
24+
*/
2525
public class ImagenGCSImage(public val gcsUri: String, public val mimeType: String) :
2626
ImagenImageRepresentible {
2727

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenGenerationConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package com.google.firebase.vertexai.type
2424
* @param aspectRatio The aspect ratio of the generated images.
2525
*/
2626
public class ImagenGenerationConfig(
27-
public val negativePrompt: String? = null,
28-
public val numberOfImages: Int = 1,
29-
public val aspectRatio: ImagenAspectRatio? = null,
27+
public val negativePrompt: String? = null,
28+
public val numberOfImages: Int = 1,
29+
public val aspectRatio: ImagenAspectRatio? = null,
3030
) {}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenImage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ package com.google.firebase.vertexai.type
2222
* @param data Contains the raw bytes of the image, mutually exclusive with [gcsUri]
2323
* @param gcsUri Contains the gs:// uri for the image , mutually exclusive with [data]
2424
* @param mimeType Contains the mime type of the image eg. "image/png"
25-
* */
25+
*/
2626
public class ImagenImage(
2727
public val data: ByteArray?,
2828
public val gcsUri: String?,

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenImageRepresentible.kt

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

1717
package com.google.firebase.vertexai.type
1818

19-
/** Interface representing images which can be passed into Imagen (for upscaling, editing, etc.)*/
19+
/** Interface representing images which can be passed into Imagen (for upscaling, editing, etc.) */
2020
public interface ImagenImageRepresentible {
21-
public fun asImagenImage(): ImagenImage
21+
public fun asImagenImage(): ImagenImage
2222
}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenModelConfig.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,5 @@ package com.google.firebase.vertexai.type
2121
* @param imageFormat Specifies the encoding format for the image.
2222
* @param addWatermark If true, the image is invisibly watermarked as AI generated.
2323
*/
24-
public class ImagenModelConfig private constructor(
25-
public val imageFormat: ImageFormat,
26-
public val addWatermark: Boolean?
27-
) {
28-
29-
}
24+
public class ImagenModelConfig
25+
private constructor(public val imageFormat: ImageFormat, public val addWatermark: Boolean?) {}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ImagenPersonFilter.kt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,14 @@
1616

1717
package com.google.firebase.vertexai.type
1818

19-
/**
20-
* A filter used to prevent images from containing depictions of people or children.
21-
*/
19+
/** A filter used to prevent images from containing depictions of people or children. */
2220
public enum class ImagenPersonFilter(internal val internalVal: String) {
23-
/**
24-
* Doesn't apply any filtering.
25-
*/
26-
ALLOW_ALL("allow_all"),
21+
/** Doesn't apply any filtering. */
22+
ALLOW_ALL("allow_all"),
2723

28-
/**
29-
* Filters out any images containing depictions of children.
30-
*/
31-
ALLOW_ADULT("allow_adult"),
24+
/** Filters out any images containing depictions of children. */
25+
ALLOW_ADULT("allow_adult"),
3226

33-
/**
34-
* Filters out any images with depictions of people.
35-
*/
36-
BLOCK_ALL("dont_allow"),
27+
/** Filters out any images with depictions of people. */
28+
BLOCK_ALL("dont_allow"),
3729
}

0 commit comments

Comments
 (0)