Skip to content

feat(ai): ImageConfig and FinishReasons#9819

Draft
paulb777 wants to merge 12 commits intomainfrom
pb-nanobanana-image-config
Draft

feat(ai): ImageConfig and FinishReasons#9819
paulb777 wants to merge 12 commits intomainfrom
pb-nanobanana-image-config

Conversation

@paulb777
Copy link
Copy Markdown
Member

@paulb777 paulb777 commented Apr 7, 2026

Replicating ImageConfig and expanded FinishReason support from iOS to JS SDK.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 03f94d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/ai Minor
firebase Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces image generation configuration options, including aspect ratio and image size, and expands the FinishReason enumeration with new image-related and technical statuses. The badFinishReasons array was updated to include these new reasons; however, feedback indicates that several existing reasons like BLOCKLIST and PROHIBITED_CONTENT are still missing and should be included to ensure consistent error handling across the SDK.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@paulb777
Copy link
Copy Markdown
Member Author

paulb777 commented Apr 8, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for ImageConfig (including aspect ratio and size) and expands the FinishReason enum to achieve parity with the iOS SDK. The changes span the API definition, internal type declarations, response helper logic, and include a new test case for verifying configuration propagation. Feedback focuses on maintaining naming consistency for the ImageConfigAspectRatio constant keys, which should use a lowercase 'x' to match existing patterns in the SDK and the provided API report.

@paulb777 paulb777 force-pushed the pb-nanobanana-image-config branch from ec5f010 to 45efb70 Compare April 8, 2026 04:22
@paulb777 paulb777 force-pushed the pb-nanobanana-image-config branch from 45efb70 to 8911375 Compare April 8, 2026 19:22
@paulb777
Copy link
Copy Markdown
Member Author

paulb777 commented Apr 8, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for ImageConfig (aspect ratio and size) and expands the FinishReason enum to include new values, ensuring parity with the iOS SDK. The changes include updates to the API definitions, documentation, and test cases. A review comment suggested removing quotes from the keys in the ImageConfigAspectRatio constant object to maintain consistency with other constant definitions in the codebase.

@paulb777
Copy link
Copy Markdown
Member Author

paulb777 commented Apr 8, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces ImageConfig to the Firebase AI SDK, enabling configuration of aspect ratios and image sizes for Gemini models. It also expands the FinishReason enumeration with several new values related to image generation and safety to ensure parity with the iOS SDK. The changes include updates to public API definitions, documentation, and the addition of unit tests. Review feedback identifies a redundant sinon.restore() call in the test suite and suggests providing more descriptive documentation for the image size constants.

@paulb777
Copy link
Copy Markdown
Member Author

paulb777 commented Apr 9, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for ImageConfig (aspect ratio and size) for Gemini models and expands the FinishReason enum with new image-related and tool-related values to achieve parity with the iOS SDK. The changes include updates to API definitions, documentation, and a new test case to ensure imageConfig is correctly passed to ChatSession. Feedback from the review suggests removing an unnecessary async keyword in a test and addressing unnecessary ESLint disable/enable comments for the ImageConfigAspectRatio enum to maintain consistency.

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.

1 participant