Skip to content

Commit 9e5ad27

Browse files
authored
Merge ef4dbf2 into 335379a
2 parents 335379a + ef4dbf2 commit 9e5ad27

File tree

17 files changed

+52
-1
lines changed

17 files changed

+52
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import com.google.firebase.vertexai.type.GenerationConfig
2727
import com.google.firebase.vertexai.type.ImagenGenerationConfig
2828
import com.google.firebase.vertexai.type.ImagenSafetySettings
2929
import com.google.firebase.vertexai.type.InvalidLocationException
30+
import com.google.firebase.vertexai.type.PublicPreviewAPI
3031
import com.google.firebase.vertexai.type.RequestOptions
3132
import com.google.firebase.vertexai.type.SafetySetting
3233
import com.google.firebase.vertexai.type.Tool
@@ -91,6 +92,7 @@ internal constructor(
9192
* @return The initialized [ImagenModel] instance.
9293
*/
9394
@JvmOverloads
95+
@PublicPreviewAPI
9496
public fun imagenModel(
9597
modelName: String,
9698
generationConfig: ImagenGenerationConfig? = null,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ import com.google.firebase.vertexai.type.ImagenGenerationConfig
2828
import com.google.firebase.vertexai.type.ImagenGenerationResponse
2929
import com.google.firebase.vertexai.type.ImagenInlineImage
3030
import com.google.firebase.vertexai.type.ImagenSafetySettings
31+
import com.google.firebase.vertexai.type.PublicPreviewAPI
3132
import com.google.firebase.vertexai.type.RequestOptions
3233

3334
/**
3435
* Represents a generative model (like Imagen), capable of generating images based on various input
3536
* types.
3637
*/
38+
@PublicPreviewAPI
3739
public class ImagenModel
3840
internal constructor(
3941
private val modelName: String,
@@ -126,6 +128,7 @@ internal constructor(
126128
}
127129
}
128130

131+
@OptIn(PublicPreviewAPI::class)
129132
private fun ImagenGenerationResponse.Internal.validate(): ImagenGenerationResponse.Internal {
130133
if (predictions.none { it.mimeType != null }) {
131134
throw ContentBlockedException(

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.google.firebase.vertexai.type.FinishReason
2626
import com.google.firebase.vertexai.type.GRpcErrorResponse
2727
import com.google.firebase.vertexai.type.GenerateContentResponse
2828
import com.google.firebase.vertexai.type.ImagenGenerationResponse
29+
import com.google.firebase.vertexai.type.PublicPreviewAPI
2930
import com.google.firebase.vertexai.type.RequestOptions
3031
import com.google.firebase.vertexai.type.Response
3132
import io.ktor.client.HttpClient
@@ -82,6 +83,7 @@ internal val JSON = Json {
8283
* @property apiClient The value to pass in the `x-goog-api-client` header.
8384
* @property headerProvider A provider that generates extra headers to include in all HTTP requests.
8485
*/
86+
@OptIn(PublicPreviewAPI::class)
8587
internal class APIController
8688
internal constructor(
8789
private val key: String,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import com.google.firebase.vertexai.common.util.fullModelName
2020
import com.google.firebase.vertexai.type.Content
2121
import com.google.firebase.vertexai.type.GenerationConfig
2222
import com.google.firebase.vertexai.type.ImagenImageFormat
23+
import com.google.firebase.vertexai.type.PublicPreviewAPI
2324
import com.google.firebase.vertexai.type.SafetySetting
2425
import com.google.firebase.vertexai.type.Tool
2526
import com.google.firebase.vertexai.type.ToolConfig
@@ -74,6 +75,7 @@ internal data class GenerateImageRequest(
7475
) : Request {
7576
@Serializable internal data class ImagenPrompt(val prompt: String)
7677

78+
@OptIn(PublicPreviewAPI::class)
7779
@Serializable
7880
internal data class ImagenParameters(
7981
val sampleCount: Int = 1,

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/java/ImagenModelFutures.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ import com.google.firebase.vertexai.ImagenModel
2222
import com.google.firebase.vertexai.type.ImagenGCSImage
2323
import com.google.firebase.vertexai.type.ImagenGenerationResponse
2424
import com.google.firebase.vertexai.type.ImagenInlineImage
25+
import com.google.firebase.vertexai.type.PublicPreviewAPI
2526

2627
/**
2728
* Wrapper class providing Java compatible methods for [ImagenModel].
2829
*
2930
* @see [ImagenModel]
3031
*/
32+
@PublicPreviewAPI
3133
public abstract class ImagenModelFutures internal constructor() {
3234
/**
3335
* Generates an image, returning the result directly to the caller.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.firebase.vertexai.type
1818

1919
/** Represents the aspect ratio that the generated image should conform to. */
20+
@PublicPreviewAPI
2021
public class ImagenAspectRatio private constructor(internal val internalVal: String) {
2122
public companion object {
2223
/** A square image, useful for icons, profile pictures, etc. */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ package com.google.firebase.vertexai.type
2222
* @param gcsUri Contains the `gs://` URI for the image.
2323
* @param mimeType Contains the MIME type of the image (for example, `"image/png"`).
2424
*/
25+
@PublicPreviewAPI
2526
public class ImagenGCSImage
2627
internal constructor(public val gcsUri: String, public val mimeType: String) {}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package com.google.firebase.vertexai.type
2626
* @param imageFormat The file format/compression of the generated images.
2727
* @param addWatermark Adds an invisible watermark to mark the image as AI generated.
2828
*/
29+
@PublicPreviewAPI
2930
public class ImagenGenerationConfig(
3031
public val negativePrompt: String? = null,
3132
public val numberOfImages: Int? = 1,
@@ -88,6 +89,7 @@ public class ImagenGenerationConfig(
8889
* }
8990
* ```
9091
*/
92+
@PublicPreviewAPI
9193
public fun imagenGenerationConfig(
9294
init: ImagenGenerationConfig.Builder.() -> Unit
9395
): ImagenGenerationConfig {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import kotlinx.serialization.Serializable
2525
* @param filteredReason if fewer images were generated than were requested, this field will contain
2626
* the reason they were filtered out.
2727
*/
28+
@PublicPreviewAPI
2829
public class ImagenGenerationResponse<T>
2930
internal constructor(public val images: List<T>, public val filteredReason: String?) {
3031

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import kotlinx.serialization.Serializable
2626
* means the image is permitted to be lower quality to reduce size. This parameter is not relevant
2727
* for every MIME type.
2828
*/
29+
@PublicPreviewAPI
2930
public class ImagenImageFormat
3031
private constructor(public val mimeType: String, public val compressionQuality: Int?) {
3132

0 commit comments

Comments
 (0)