Skip to content

Conversation

cartland
Copy link
Contributor

@cartland cartland commented Oct 8, 2025

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:

Copy link

snippet-bot bot commented Oct 8, 2025

Here is the summary of changes.

You are about to add 24 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@cartland
Copy link
Contributor Author

cartland commented Oct 8, 2025

This PR will make the following PRs obsolete:
#642
#643
#644
#645
#646

Copy link

@askandroid askandroid left a 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
@cartland cartland force-pushed the cartland/gemini-developer-api branch from 61a97f5 to e04c9fd Compare October 8, 2025 22:37
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants