Skip to content

[AI] Consolidate duplicate generateContentStream code - #16046

Merged
paulb777 merged 1 commit into
mainfrom
pb-code-cleanup
Apr 8, 2026
Merged

[AI] Consolidate duplicate generateContentStream code#16046
paulb777 merged 1 commit into
mainfrom
pb-code-cleanup

Conversation

@paulb777

@paulb777 paulb777 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Refactor the generateContentStream method to delegate to a shared implementation, reducing code duplication.

#no-changelog

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@paulb777

paulb777 commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 refactors the generateContentStream(_ content: [ModelContent]) method in GenerativeModel.swift to delegate its implementation to another overload, effectively reducing code duplication. I have no feedback to provide.

@paulb777

paulb777 commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

/gemini summarize

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request streamlines the codebase by consolidating redundant logic within the GenerativeModel class. By centralizing the stream generation process, the change improves maintainability and ensures consistent behavior across different entry points for content generation.

Highlights

  • Code Consolidation: Refactored the generateContentStream method to delegate to a shared implementation, reducing code duplication.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Activity
  • Gemini Code Assist provided initial setup instructions.
  • Author requested a code review via /gemini review.
  • Author requested a summary via /gemini summarize.

@paulb777
paulb777 requested a review from andrewheard April 6, 2026 17:44
@paulb777
paulb777 enabled auto-merge (squash) April 6, 2026 17:44

@andrewheard andrewheard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this!

@paulb777
paulb777 merged commit 8571f71 into main Apr 8, 2026
87 checks passed
@paulb777
paulb777 deleted the pb-code-cleanup branch April 8, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants