Commit 17359444 by tbphp

fix: Gemini & Vertex empty content error

parent 423796e7
...@@ -374,8 +374,10 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon ...@@ -374,8 +374,10 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
if content.Role == "assistant" { if content.Role == "assistant" {
content.Role = "model" content.Role = "model"
} }
if len(content.Parts) > 0 {
geminiRequest.Contents = append(geminiRequest.Contents, content) geminiRequest.Contents = append(geminiRequest.Contents, content)
} }
}
if len(system_content) > 0 { if len(system_content) > 0 {
geminiRequest.SystemInstructions = &GeminiChatContent{ geminiRequest.SystemInstructions = &GeminiChatContent{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment