llm_engineering
llm_engineering copied to clipboard
Add Gemini streaming support to brochure generator
Add Gemini Streaming Support to Brochure Generator
This PR adds support for using Google's Gemini model in the brochure generator, alongside the existing GPT and Claude options.
Changes
- Added
stream_geminifunction to handle Gemini API streaming responses - Updated
stream_brochureto support Gemini model option - Added Gemini to model dropdown in UI
- Maintains consistent streaming pattern with GPT and Claude implementations
Implementation Details
- Uses Gemini's streaming API with the same pattern as GPT and Claude
- Handles streaming chunks consistently with other models
- Preserves markdown formatting in responses
- Maintains same error handling pattern as other models
Testing
The implementation has been tested with:
- Basic company website URLs
- Streaming functionality works as expected
- UI updates in real-time as responses are generated
Requirements
- Requires Google API key to be configured (same as existing setup)
- Uses
gemini-2.5-flashmodel for optimal performance - No additional dependencies required beyond existing ones
Notes
- Follows the same streaming pattern as existing models for consistency
- Uses the OpenAI-compatible endpoint for better integration
- Maintains the same error handling patterns
Hey - this PR seems to be changing an existing file in the repo - was that intentional? Ed