Skip to content

Commit 5f3b427

Browse files
committed
add documentation
1 parent e3af693 commit 5f3b427

File tree

1 file changed

+13
-5
lines changed
  • firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,23 @@
1717
package com.google.firebase.vertexai.type
1818

1919
import android.util.Base64
20-
import kotlinx.serialization.SerialName
2120
import kotlinx.serialization.Serializable
2221

23-
/* Represent the media data that needs to be sent to the server. */
24-
public class MediaData(public val mimeType: String, public val data: ByteArray) {
22+
/**
23+
* Represents the media data to be sent to the server
24+
*
25+
* @param data Byte array representing the data to be sent.
26+
* @param mimeType an IANA standard MIME type. For supported MIME type values see the
27+
* [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements).
28+
*/
29+
public class MediaData(public val data: ByteArray, public val mimeType: String) {
2530
@Serializable
26-
internal class Internal(@SerialName("mimeType") val mimeType: String, val data: String)
31+
internal class Internal(
32+
val data: String,
33+
val mimeType: String,
34+
)
2735

2836
internal fun toInternal(): Internal {
29-
return Internal(mimeType, Base64.encodeToString(data, BASE_64_FLAGS))
37+
return Internal(Base64.encodeToString(data, BASE_64_FLAGS), mimeType)
3038
}
3139
}

0 commit comments

Comments
 (0)