@@ -18,65 +18,58 @@ package com.google.firebase.vertexai.java
1818
1919import androidx.concurrent.futures.SuspendToFutureAdapter
2020import com.google.common.util.concurrent.ListenableFuture
21- import com.google.firebase.vertexai.ImageModel
21+ import com.google.firebase.vertexai.ImagenModel
2222import com.google.firebase.vertexai.type.ImagenGCSImage
23- import com.google.firebase.vertexai.type.ImagenGenerationConfig
2423import com.google.firebase.vertexai.type.ImagenGenerationResponse
2524import com.google.firebase.vertexai.type.ImagenInlineImage
2625
2726/* *
28- * Wrapper class providing Java compatible methods for [ImageModel ].
27+ * Wrapper class providing Java compatible methods for [ImagenModel ].
2928 *
30- * @see [ImageModel ]
29+ * @see [ImagenModel ]
3130 */
32- public abstract class ImageModelFutures internal constructor() {
31+ public abstract class ImagenModelFutures internal constructor() {
3332 /* *
3433 * Generates an image, returning the result directly to the caller.
3534 *
3635 * @param prompt The main text prompt from which the image is generated.
37- * @param config contains secondary image generation parameters.
3836 */
3937 public abstract fun generateImages (
4038 prompt : String ,
41- config : ImagenGenerationConfig ? ,
4239 ): ListenableFuture <ImagenGenerationResponse <ImagenInlineImage >>
4340
4441 /* *
4542 * Generates an image, storing the result in Google Cloud Storage and returning a URL
4643 *
4744 * @param prompt The main text prompt from which the image is generated.
4845 * @param gcsUri Specifies the GCS bucket in which to store the image.
49- * @param config contains secondary image generation parameters.
5046 */
5147 public abstract fun generateImages (
5248 prompt : String ,
5349 gcsUri : String ,
54- config : ImagenGenerationConfig ? ,
5550 ): ListenableFuture <ImagenGenerationResponse <ImagenGCSImage >>
5651
57- /* * Returns the [ImageModel ] object wrapped by this object. */
58- public abstract fun getImageModel (): ImageModel
52+ /* * Returns the [ImagenModel ] object wrapped by this object. */
53+ public abstract fun getImageModel (): ImagenModel
5954
60- private class FuturesImpl (private val model : ImageModel ) : ImageModelFutures () {
55+ private class FuturesImpl (private val model : ImagenModel ) : ImagenModelFutures () {
6156 override fun generateImages (
6257 prompt : String ,
63- config : ImagenGenerationConfig ? ,
6458 ): ListenableFuture <ImagenGenerationResponse <ImagenInlineImage >> =
65- SuspendToFutureAdapter .launchFuture { model.generateImage (prompt, config ) }
59+ SuspendToFutureAdapter .launchFuture { model.generateImages (prompt) }
6660
6761 override fun generateImages (
6862 prompt : String ,
6963 gcsUri : String ,
70- config : ImagenGenerationConfig ? ,
7164 ): ListenableFuture <ImagenGenerationResponse <ImagenGCSImage >> =
72- SuspendToFutureAdapter .launchFuture { model.generateImage (prompt, gcsUri, config ) }
65+ SuspendToFutureAdapter .launchFuture { model.generateImages (prompt, gcsUri) }
7366
74- override fun getImageModel (): ImageModel = model
67+ override fun getImageModel (): ImagenModel = model
7568 }
7669
7770 public companion object {
7871
79- /* * @return a [ImageModelFutures ] created around the provided [ImageModel ] */
80- @JvmStatic public fun from (model : ImageModel ): ImageModelFutures = FuturesImpl (model)
72+ /* * @return a [ImagenModelFutures ] created around the provided [ImagenModel ] */
73+ @JvmStatic public fun from (model : ImagenModel ): ImagenModelFutures = FuturesImpl (model)
8174 }
8275}
0 commit comments