feat: support gemini-3-pro-image-preview via images/generations
This commit is contained in:
@@ -56,8 +56,15 @@ func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInf
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest) (any, error) {
|
func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest) (any, error) {
|
||||||
if !strings.HasPrefix(info.UpstreamModelName, "imagen") {
|
if strings.HasPrefix(info.UpstreamModelName, "gemini-3-pro-image") {
|
||||||
return nil, errors.New("not supported model for image generation")
|
chatRequest := dto.GeneralOpenAIRequest{
|
||||||
|
Model: request.Model,
|
||||||
|
Messages: []dto.Message{
|
||||||
|
{Role: "user", Content: request.Prompt},
|
||||||
|
},
|
||||||
|
N: int(request.N),
|
||||||
|
}
|
||||||
|
return a.ConvertOpenAIRequest(c, info, &chatRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert size to aspect ratio but allow user to specify aspect ratio
|
// convert size to aspect ratio but allow user to specify aspect ratio
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ var defaultGeminiSettings = GeminiSettings{
|
|||||||
SupportedImagineModels: []string{
|
SupportedImagineModels: []string{
|
||||||
"gemini-2.0-flash-exp-image-generation",
|
"gemini-2.0-flash-exp-image-generation",
|
||||||
"gemini-2.0-flash-exp",
|
"gemini-2.0-flash-exp",
|
||||||
|
"gemini-3-pro-image-preview",
|
||||||
|
"gemini-2.5-flash-image",
|
||||||
|
"nano-banana",
|
||||||
|
"nano-banana-pro",
|
||||||
},
|
},
|
||||||
ThinkingAdapterEnabled: false,
|
ThinkingAdapterEnabled: false,
|
||||||
ThinkingAdapterBudgetTokensPercentage: 0.6,
|
ThinkingAdapterBudgetTokensPercentage: 0.6,
|
||||||
|
|||||||
Reference in New Issue
Block a user