-
Notifications
You must be signed in to change notification settings - Fork 270
Add Gemini Developer API code snippets #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cartland
wants to merge
3
commits into
main
Choose a base branch
from
cartland/gemini-developer-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Oct 8, 2025
6449cbe
to
61a97f5
Compare
askandroid
approved these changes
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, Cartland!
This commit introduces a collection of code snippets demonstrating the usage of the Gemini Developer API. It includes examples for model configuration, text-only and multimodal inputs (image, audio, video), multi-turn chat, and image generation/editing. The necessary dependencies for Firebase AI, Guava, and Reactive Streams have been added to gradle/libs.versions.toml and misc/build.gradle.kts. Region-Tag: android_gemini_developer_api_gemini_25_flash_model Region-Tag: android_gemini_developer_api_gemini_25_flash_image_model Region-Tag: android_gemini_developer_api_text_only_input Region-Tag: android_gemini_developer_api_multimodal_input Region-Tag: android_gemini_developer_api_multimodal_audio_input Region-Tag: android_gemini_developer_api_multimodal_video_input Region-Tag: android_gemini_developer_api_multiturn_chat Region-Tag: android_gemini_developer_api_generate_image_from_text Region-Tag: android_gemini_developer_api_edit_image Region-Tag: android_gemini_developer_api_edit_image_chat Region-Tag: android_gemini_developer_api_gemini_25_flash_model_java Region-Tag: android_gemini_developer_api_gemini_25_flash_image_model_java Region-Tag: android_gemini_developer_api_text_only_input_java Region-Tag: android_gemini_developer_api_multimodal_input_java Region-Tag: android_gemini_developer_api_multimodal_audio_input_java Region-Tag: android_gemini_developer_api_multimodal_video_input_java Region-Tag: android_gemini_developer_api_multiturn_chat_java Region-Tag: android_gemini_developer_api_generate_image_from_text_java Region-Tag: android_gemini_developer_api_edit_image_java Region-Tag: android_gemini_developer_api_edit_image_chat_java
61a97f5
to
e04c9fd
Compare
This commit adds new Kotlin snippets for the Firebase AI Imagen API. The snippets demonstrate how to: - Configure the Imagen model with options like image count, aspect ratio, and safety settings. - Generate an image from a text prompt. Region-Tags: - `android_imagen_model_configuration` - `android_imagen_generate_images`
This commit introduces snippets for Imagen 4.0, a text-to-image generation model. It adds new files, `ImagenSnippets.kt` and `ImagenSnippetsJava.java`, which demonstrate how to configure the model and generate images from a text prompt. The commit also includes the following changes: - Adds the `@PublicPreviewAPI` annotation to the new Imagen snippets. - Refactors existing Gemini snippets to initialize models within a static block for consistency. - Adds `@SuppressWarnings("unused")` to several functions and classes to handle linter warnings. - Updates the `build.gradle.kts` file to exclude the `.idea` directory from Spotless XML formatting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a collection of code snippets demonstrating the usage of the Gemini Developer API. It includes examples for model configuration, text-only and multimodal inputs (image, audio, video), multi-turn chat, and image generation/editing.
The necessary dependencies for Firebase AI, Guava, and Reactive Streams have been added to gradle/libs.versions.toml and misc/build.gradle.kts.
Intended documentation pages: