From 228b3114ebbd2abeb614676102640f43fdbad854 Mon Sep 17 00:00:00 2001 From: Emily Ploszaj Date: Wed, 27 Aug 2025 09:22:33 -0500 Subject: [PATCH 1/3] Doc changes for m169 --- .../google/firebase/ai/common/Exceptions.kt | 2 +- .../com/google/firebase/ai/type/Exceptions.kt | 2 +- .../ai/type/GenerateContentResponse.kt | 2 +- .../com/google/firebase/ai/type/Part.kt | 31 +++++++++++-------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt index 82ad80838f6..9e94f88dcfa 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/common/Exceptions.kt @@ -90,7 +90,7 @@ internal class UnsupportedUserLocationException(cause: Throwable? = null) : FirebaseCommonAIException("User location is not supported for the API use.", cause) /** - * The user's project has not been configured and enabled for the selected API. + * The Firebase project has not been configured and enabled for the selected API. * * For the Gemini Developer API, see * [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt index a006f34e915..fb23ca26e95 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Exceptions.kt @@ -152,7 +152,7 @@ public class UnsupportedUserLocationException internal constructor(cause: Throwa FirebaseAIException("User location is not supported for the API use.", cause) /** - * The user's project has not been configured and enabled for the selected API. + * The Firebase project has not been configured and enabled for the selected API. * * For the Gemini Developer API, see * [steps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting?api=dev#error-genai-config-not-found) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GenerateContentResponse.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GenerateContentResponse.kt index 45398ce356b..bbf5fc0ff73 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GenerateContentResponse.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/GenerateContentResponse.kt @@ -59,7 +59,7 @@ public class GenerateContentResponse( /** * Convenience field representing all the text parts in the response that are marked as thoughts - * as a single string, if they exists. + * as a single string, if they exist. * * Learn more about [thinking](https://firebase.google.com/docs/ai-logic/thinking?api=dev). */ diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt index 24bbd888cf9..d3343a53279 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt @@ -106,8 +106,6 @@ internal constructor( /** * Represents image data sent to and received from requests. The image is converted client-side to * JPEG encoding at 80% quality before being sent to the server. - * - * @param image [Bitmap] to convert into a [Part] */ public class ImagePart internal constructor( @@ -116,6 +114,9 @@ internal constructor( internal val thoughtSignature: String? ) : Part { + /** + * @param image [Bitmap] to convert into a [Part] + */ public constructor(image: Bitmap) : this(image, false, null) internal fun toInlineDataPart() = @@ -130,8 +131,6 @@ internal constructor( /** * Represents binary data with an associated MIME type sent to and received from requests. * - * @param inlineData the binary data as a [ByteArray] - * @param mimeType an IANA standard MIME type. For supported values, see the * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). */ public class InlineDataPart @@ -142,6 +141,10 @@ internal constructor( internal val thoughtSignature: String? ) : Part { + /** + * @param inlineData the binary data as a [ByteArray] + * @param mimeType an IANA standard MIME type. For supported values, see the + */ public constructor( inlineData: ByteArray, mimeType: String @@ -201,10 +204,6 @@ internal constructor( /** * Represents function call output to be returned to the model when it requests a function call. - * - * @param name The name of the called function. - * @param response The response produced by the function as a [JSONObject]. - * @param id Matching `id` for a [FunctionCallPart], if one was provided. */ public class FunctionResponsePart internal constructor( @@ -215,6 +214,11 @@ internal constructor( internal val thoughtSignature: String? ) : Part { + /** + * @param name The name of the called function. + * @param response The response produced by the function as a [JSONObject]. + * @param id Matching `id` for a [FunctionCallPart], if one was provided. + */ @JvmOverloads public constructor( name: String, @@ -244,11 +248,6 @@ internal constructor( /** * Represents file data stored in Cloud Storage for Firebase, referenced by URI. - * - * @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example, - * `"gs://bucket-name/path/image.jpg"` - * @param mimeType an IANA standard MIME type. For supported MIME type values see the - * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). */ public class FileDataPart internal constructor( @@ -258,6 +257,12 @@ internal constructor( internal val thoughtSignature: String? ) : Part { + /** + * @param uri The `"gs://"`-prefixed URI of the file in Cloud Storage for Firebase, for example, + * `"gs://bucket-name/path/image.jpg"` + * @param mimeType an IANA standard MIME type. For supported MIME type values see the + * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). + */ public constructor(uri: String, mimeType: String) : this(uri, mimeType, false, null) @Serializable From e89a8fb6f2e1a315f8aaf822201928fdfd3dc3ad Mon Sep 17 00:00:00 2001 From: Emily Ploszaj Date: Wed, 27 Aug 2025 09:25:08 -0500 Subject: [PATCH 2/3] Format --- .../main/kotlin/com/google/firebase/ai/type/Part.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt index d3343a53279..aa38d6556c4 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt @@ -114,9 +114,7 @@ internal constructor( internal val thoughtSignature: String? ) : Part { - /** - * @param image [Bitmap] to convert into a [Part] - */ + /** @param image [Bitmap] to convert into a [Part] */ public constructor(image: Bitmap) : this(image, false, null) internal fun toInlineDataPart() = @@ -202,9 +200,7 @@ internal constructor( } } -/** - * Represents function call output to be returned to the model when it requests a function call. - */ +/** Represents function call output to be returned to the model when it requests a function call. */ public class FunctionResponsePart internal constructor( public val name: String, @@ -246,9 +242,7 @@ internal constructor( } } -/** - * Represents file data stored in Cloud Storage for Firebase, referenced by URI. - */ +/** Represents file data stored in Cloud Storage for Firebase, referenced by URI. */ public class FileDataPart internal constructor( public val uri: String, From d29364f3eddb7ca55b65ea52576be2895f434511 Mon Sep 17 00:00:00 2001 From: Emily Ploszaj Date: Wed, 27 Aug 2025 09:36:11 -0500 Subject: [PATCH 3/3] Adjust broken sentence --- .../src/main/kotlin/com/google/firebase/ai/type/Part.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt index aa38d6556c4..a6bbb83e406 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Part.kt @@ -126,11 +126,7 @@ internal constructor( ) } -/** - * Represents binary data with an associated MIME type sent to and received from requests. - * - * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). - */ +/** Represents binary data with an associated MIME type sent to and received from requests. */ public class InlineDataPart internal constructor( public val inlineData: ByteArray, @@ -142,6 +138,7 @@ internal constructor( /** * @param inlineData the binary data as a [ByteArray] * @param mimeType an IANA standard MIME type. For supported values, see the + * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). */ public constructor( inlineData: ByteArray,