[Vertex AI] Return ImagenInlineImage.data as binary#6800
Conversation
Javadoc Changes:--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/vertexai/type/ImagenInlineImage.html 2025-03-25 17:33:46.710833161 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/vertexai/type/ImagenInlineImage.html 2025-03-25 17:31:37.539602546 +0000
@@ -11,7 +11,7 @@
<pre>@<a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FPublicPreviewAPI.html">PublicPreviewAPI</a><br>public final class <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html">ImagenInlineImage</a></pre>
</p>
<hr>
- <p>Represents an Imagen-generated image that is contained inline</p>
+ <p>Represents an Imagen-generated image that is returned as inline data.</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
@@ -29,14 +29,14 @@
<td><code>final @<a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fandroidx%2Fannotation%2FNonNull.html">NonNull</a> byte[]</code></td>
<td>
<div><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23data()">data</a></code></div>
- <p>Contains the raw bytes of the image</p>
+ <p>The raw image bytes in JPEG or PNG format, as specified by <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code>.</p>
</td>
</tr>
<tr>
<td><code>final @<a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fandroidx%2Fannotation%2FNonNull.html">NonNull</a> <a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fjava%2Flang%2FString.html">String</a></code></td>
<td>
<div><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code></div>
- <p>Contains the MIME type of the image (for example, <code>"image/png"</code>)</p>
+ <p>The IANA standard MIME type of the image data; either <code>"image/png"</code> or <code>"image/jpeg"</code>; to request a different format, see <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenGenerationConfig.html%23imageFormat()">ImagenGenerationConfig.imageFormat</a></code>.</p>
</td>
</tr>
</tbody>
@@ -69,12 +69,12 @@
<div class="api-item"><a name="getData()"></a><a name="setData()"></a><a name="getData--"></a><a name="setData--"></a>
<h3 class="api-name" id="data()">data</h3>
<pre class="api-signature no-pretty-print">public final @<a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fandroidx%2Fannotation%2FNonNull.html">NonNull</a> byte[] <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23data()">data</a></pre>
- <p>Contains the raw bytes of the image</p>
+ <p>The raw image bytes in JPEG or PNG format, as specified by <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code>.</p>
</div>
<div class="api-item"><a name="getMimeType()"></a><a name="setMimeType()"></a><a name="getMimeType--"></a><a name="setMimeType--"></a>
<h3 class="api-name" id="mimeType()">mimeType</h3>
<pre class="api-signature no-pretty-print">public final @<a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fandroidx%2Fannotation%2FNonNull.html">NonNull</a> <a href="/browse?url=https%3A%2F%2Fdeveloper.android.com%2Freference%2Fkotlin%2Fjava%2Flang%2FString.html">String</a> <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></pre>
- <p>Contains the MIME type of the image (for example, <code>"image/png"</code>)</p>
+ <p>The IANA standard MIME type of the image data; either <code>"image/png"</code> or <code>"image/jpeg"</code>; to request a different format, see <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenGenerationConfig.html%23imageFormat()">ImagenGenerationConfig.imageFormat</a></code>.</p>
</div>
</div>
<div class="list">--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/vertexai/type/package-summary.html 2025-03-25 17:33:46.711833163 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/vertexai/type/package-summary.html 2025-03-25 17:31:37.541602549 +0000
@@ -227,7 +227,7 @@
<tr>
<td><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fandroid%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html">ImagenInlineImage</a></code></td>
<td>
- <p>Represents an Imagen-generated image that is contained inline</p>
+ <p>Represents an Imagen-generated image that is returned as inline data.</p>
</td>
</tr>
<tr>--- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/ImagenInlineImage.html 2025-03-25 17:33:46.702833147 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/ImagenInlineImage.html 2025-03-25 17:31:37.529602528 +0000
@@ -11,7 +11,7 @@
<pre>@<a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FPublicPreviewAPI.html">PublicPreviewAPI</a><br>class <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html">ImagenInlineImage</a></pre>
</p>
<hr>
- <p>Represents an Imagen-generated image that is contained inline</p>
+ <p>Represents an Imagen-generated image that is returned as inline data.</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
@@ -51,14 +51,14 @@
<td><code><a href="/browse?url=https%3A%2F%2Fkotlinlang.org%2Fapi%2Flatest%2Fjvm%2Fstdlib%2Fkotlin%2F-byte-array%2Findex.html">ByteArray</a></code></td>
<td>
<div><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23data()">data</a></code></div>
- <p>Contains the raw bytes of the image</p>
+ <p>The raw image bytes in JPEG or PNG format, as specified by <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code>.</p>
</td>
</tr>
<tr>
<td><code><a href="/browse?url=https%3A%2F%2Fkotlinlang.org%2Fapi%2Flatest%2Fjvm%2Fstdlib%2Fkotlin%2F-string%2Findex.html">String</a></code></td>
<td>
<div><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code></div>
- <p>Contains the MIME type of the image (for example, <code>"image/png"</code>)</p>
+ <p>The IANA standard MIME type of the image data; either <code>"image/png"</code> or <code>"image/jpeg"</code>; to request a different format, see <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenGenerationConfig.html%23imageFormat()">ImagenGenerationConfig.imageFormat</a></code>.</p>
</td>
</tr>
</tbody>
@@ -77,12 +77,12 @@
<div class="api-item"><a name="getData()"></a><a name="setData()"></a><a name="getData--"></a><a name="setData--"></a>
<h3 class="api-name" id="data()">data</h3>
<pre class="api-signature no-pretty-print">val <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23data()">data</a>: <a href="/browse?url=https%3A%2F%2Fkotlinlang.org%2Fapi%2Flatest%2Fjvm%2Fstdlib%2Fkotlin%2F-byte-array%2Findex.html">ByteArray</a></pre>
- <p>Contains the raw bytes of the image</p>
+ <p>The raw image bytes in JPEG or PNG format, as specified by <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a></code>.</p>
</div>
<div class="api-item"><a name="getMimeType()"></a><a name="setMimeType()"></a><a name="getMimeType--"></a><a name="setMimeType--"></a>
<h3 class="api-name" id="mimeType()">mimeType</h3>
<pre class="api-signature no-pretty-print">val <a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html%23mimeType()">mimeType</a>: <a href="/browse?url=https%3A%2F%2Fkotlinlang.org%2Fapi%2Flatest%2Fjvm%2Fstdlib%2Fkotlin%2F-string%2Findex.html">String</a></pre>
- <p>Contains the MIME type of the image (for example, <code>"image/png"</code>)</p>
+ <p>The IANA standard MIME type of the image data; either <code>"image/png"</code> or <code>"image/jpeg"</code>; to request a different format, see <code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenGenerationConfig.html%23imageFormat()">ImagenGenerationConfig.imageFormat</a></code>.</p>
</div>
</div>
</body>--- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/package-summary.html 2025-03-25 17:33:46.703833148 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/vertexai/type/package-summary.html 2025-03-25 17:31:37.530602530 +0000
@@ -200,7 +200,7 @@
<tr>
<td><code><a href="/browse?url=https%3A%2F%2Fgithub.com%2Fdocs%2Freference%2Fkotlin%2Fcom%2Fgoogle%2Ffirebase%2Fvertexai%2Ftype%2FImagenInlineImage.html">ImagenInlineImage</a></code></td>
<td>
- <p>Represents an Imagen-generated image that is contained inline</p>
+ <p>Represents an Imagen-generated image that is returned as inline data.</p>
</td>
</tr>
<tr> |
Test Results 18 files - 1 016 18 suites - 1 016 12s ⏱️ - 34m 19s Results for commit 362ec20. ± Comparison against base commit baa335c. This pull request removes 5786 tests.♻️ This comment has been updated with latest results. |
Size Report 1Affected Products
Test Logs |
|
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
rlazo
left a comment
There was a problem hiding this comment.
I've manually tested the changes and they work as intended.
|
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
Co-authored-by: Rodrigo Lazo <rlazo@users.noreply.github.com>
Updated
ImagenGenerationResponseto decode the base64-encoded image data from the backend when creating a publicImagenInlineImage. TheImagenInlineImage.datanow returns the rawimage bytes (in JPEG or PNG format, specified in
ImagenInlineImage.mimeType), still as aByteArray, instead of Base64-encoded data. See firebase/firebase-ios-sdk#14603 (comment) for the iOS-equivalent discussion, as well as #6786. This makes Android implementation consistent with the Swift SDK.