From 3c0180863bd44f4af8e5d13f3b57b0be4a0bbe25 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Thu, 21 Aug 2025 11:30:26 -0400 Subject: [PATCH 1/2] [AI] Improve refdocs The improvements include: - Link directly to the list of supported models in the documentation. - Fix rendering issues with numbers being translated as numbered lists - Link to firebase documentation instead of vertex documentation when corresponding. --- .../src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt | 9 ++++++--- .../main/kotlin/com/google/firebase/ai/ImagenModel.kt | 3 +++ .../main/kotlin/com/google/firebase/ai/type/Candidate.kt | 4 ++-- .../com/google/firebase/ai/type/CountTokensResponse.kt | 7 +++---- .../src/main/kotlin/com/google/firebase/ai/type/Part.kt | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt index d9b2c5a0f57..47e657a8bd6 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt @@ -51,7 +51,8 @@ internal constructor( /** * Instantiates a new [GenerativeModel] given the provided parameters. * - * @param modelName The name of the model to use, for example `"gemini-2.0-flash-exp"`. + * @param modelName The name of the model to use. See the documentation for a list of + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for content generation. * @param safetySettings The safety bounds the model will abide to during content generation. * @param tools A list of [Tool]s the model may use to generate content. @@ -106,7 +107,8 @@ internal constructor( /** * Instantiates a new [LiveGenerationConfig] given the provided parameters. * - * @param modelName The name of the model to use, for example `"gemini-2.0-flash-exp"`. + * @param modelName The name of the model to use. See the documentation for a list of + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for content generation. * @param tools A list of [Tool]s the model may use to generate content. * @param systemInstruction [Content] instructions that direct the model to behave a certain way. @@ -157,7 +159,8 @@ internal constructor( /** * Instantiates a new [ImagenModel] given the provided parameters. * - * @param modelName The name of the model to use, for example `"imagen-3.0-generate-001"`. + * @param modelName The name of the model to use. See the documentation for a list of + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for image generation. * @param safetySettings The safety bounds the model will abide by during image generation. * @param requestOptions Configuration options for sending requests to the backend. diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/ImagenModel.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/ImagenModel.kt index 399da4c77cf..97a27465b61 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/ImagenModel.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/ImagenModel.kt @@ -41,6 +41,9 @@ import com.google.firebase.auth.internal.InternalAuthProvider /** * Represents a generative model (like Imagen), capable of generating images based on various input * types. + * + * See the documentation for a list of + * [supported models](https://firebase.google.com/docs/ai-logic/models). */ @PublicPreviewAPI public class ImagenModel diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt index 0c6819defd8..b7671aa0ccb 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Candidate.kt @@ -76,8 +76,8 @@ internal constructor( * * @property category The category of harm being assessed (e.g., Hate speech). * @property probability The likelihood of the content causing harm. - * @property probabilityScore A numerical score representing the probability of harm, between 0 and - * 1. + * @property probabilityScore A numerical score representing the probability of harm, between `0` + * and `1`. * @property blocked Indicates whether the content was blocked due to safety concerns. * @property severity The severity of the potential harm. * @property severityScore A numerical score representing the severity of harm. diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/CountTokensResponse.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/CountTokensResponse.kt index 5d66518d61c..ac485a2c0d9 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/CountTokensResponse.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/CountTokensResponse.kt @@ -22,14 +22,13 @@ import kotlinx.serialization.Serializable * The model's response to a count tokens request. * * **Important:** The counters in this class do not include billable image, video or other non-text - * input. See [Vertex AI pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing) for - * details. + * input. See [Pricing](https://firebase.google.com/docs/ai-logic/pricing) for details. * * @property totalTokens The total number of tokens in the input given to the model as a prompt. * @property totalBillableCharacters The total number of billable characters in the text input given * to the model as a prompt. **Important:** this property does not include billable image, video or - * other non-text input. See - * [Vertex AI pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing) for details. + * other non-text input. See [Pricing](https://firebase.google.com/docs/ai-logic/pricing) for + * details. * @property promptTokensDetails The breakdown, by modality, of how many tokens are consumed by the * prompt. */ 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 34898631479..24bbd888cf9 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 @@ -132,7 +132,7 @@ internal constructor( * * @param inlineData the binary data as a [ByteArray] * @param mimeType an IANA standard MIME type. For supported values, see the - * [Vertex AI documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/send-multimodal-prompts#media_requirements) + * [Firebase documentation](https://firebase.google.com/docs/vertex-ai/input-file-requirements). */ public class InlineDataPart internal constructor( From 62efc87427df0756751e6740e21f9661755d5e02 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Thu, 21 Aug 2025 11:43:07 -0400 Subject: [PATCH 2/2] Fix format --- .../src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt index 47e657a8bd6..34490b3cf6e 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt @@ -52,7 +52,7 @@ internal constructor( * Instantiates a new [GenerativeModel] given the provided parameters. * * @param modelName The name of the model to use. See the documentation for a list of - * [supported models](https://firebase.google.com/docs/ai-logic/models). + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for content generation. * @param safetySettings The safety bounds the model will abide to during content generation. * @param tools A list of [Tool]s the model may use to generate content. @@ -108,7 +108,7 @@ internal constructor( * Instantiates a new [LiveGenerationConfig] given the provided parameters. * * @param modelName The name of the model to use. See the documentation for a list of - * [supported models](https://firebase.google.com/docs/ai-logic/models). + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for content generation. * @param tools A list of [Tool]s the model may use to generate content. * @param systemInstruction [Content] instructions that direct the model to behave a certain way. @@ -160,7 +160,7 @@ internal constructor( * Instantiates a new [ImagenModel] given the provided parameters. * * @param modelName The name of the model to use. See the documentation for a list of - * [supported models](https://firebase.google.com/docs/ai-logic/models). + * [supported models](https://firebase.google.com/docs/ai-logic/models). * @param generationConfig The configuration parameters to use for image generation. * @param safetySettings The safety bounds the model will abide by during image generation. * @param requestOptions Configuration options for sending requests to the backend.