-
-
Notifications
You must be signed in to change notification settings - Fork 636
Feature/nano banana #685
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
base: main
Are you sure you want to change the base?
Feature/nano banana #685
Conversation
…litellm + gemini-flash-2.5-image-preview)
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.
Looks like you have some CI issues. At the same token, I don't think a generic array fits the bill of this project.
If you are trying to extend, it would be best to have a CreateResponseImage class to represent the image data. At present you are typing a custom array which we try to avoid for typed class properties.
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.
Build is passing now, but remember we don't really like passing arrays around. We prefer typed class to enforce scalar typing.
See the pattern we do with FunctionCall or ChoiceAudio right above your changes? Thats what we need to continue on.
… `CreateResponseMessage`
@iBotPeaches Thank you for the feedback! You're absolutely right about preferring typed classes over arrays. I've updated the implementation to follow the same pattern as
The updated code now follows the project's established patterns. Ready for another review! 🚀 |
Okay cool - everything passes. I'll take this for a run tonight to confirm functionality. |
Sorry for delay. Still trying to setup LiteLLM w/ Gemini and never done this before. |
Add support for Gemini Flash 2.5 image generation via LiteLLM Proxy
🚀 Description
This PR adds support for Gemini Flash 2.5 (Nano Banana) image generation through LiteLLM Proxy integration. This enhancement allows generating images as part of regular chat conversations, where messages can now contain both text and images simultaneously.
🎯 Motivation
📋 Changes Made
✅ Core Features
CreateResponseChoiceImage
typed class following project patternsChatCompletionResponseMessage
withimages
property🔧 Technical Implementation
CreateResponseChoiceImage
class followingFunctionCall
/ChoiceAudio
pattern📚 Documentation
🎨 Usage Example
🏗️ Class Structure
New
CreateResponseChoiceImage
ClassUpdated
ChatCompletionResponseMessage
🔗 Related Documentation
🧪 Testing
Manual Testing
Unit Tests
CreateResponseChoiceImage
class creationfrom()
factory methodtoArray()
method🔄 Response Structure
The API now returns structured image data:
🎯 Type Safety Benefits
Before (Arrays - Error Prone)
After (Typed Objects - Safe & Predictable)
🌟 Benefits
🏗️ Implementation Details
File Changes
Type Annotations
🔍 Code Quality
FunctionCall
/ChoiceAudio
patternArrayAccessible
andFakeable
traits for consistency🚦 Architecture Compliance
This implementation strictly follows the project's established patterns:
🔄 Updates Based on Review
v2.0 - Typed Classes Implementation
FunctionCall
/ChoiceAudio
CreateResponseChoiceImage
class🤝 Community Impact
This feature brings PHP developers the same cutting-edge capabilities available in Python libraries, ensuring the PHP ecosystem remains competitive in the rapidly evolving AI landscape. The implementation maintains the library's high standards for type safety and architectural consistency.
Ready for review! 🎉
This implementation demonstrates adherence to project standards while opening up exciting new possibilities for PHP developers working with multimodal AI.