refactor: removing unused if statement

This commit is contained in:
David Zhuang 2023-12-16 13:24:15 -05:00
parent d027041f67
commit 655405462f

View File

@ -195,9 +195,7 @@ func geminiChatStreamHandler(c *gin.Context, resp *http.Response) (*OpenAIErrorW
fullTextResponse := streamResponseGeminiChat2OpenAI(&geminiResponse) fullTextResponse := streamResponseGeminiChat2OpenAI(&geminiResponse)
fullTextResponse.Id = responseId fullTextResponse.Id = responseId
fullTextResponse.Created = createdTime fullTextResponse.Created = createdTime
if len(geminiResponse.Candidates) > 0 {
responseText = geminiResponse.Candidates[0].Content.Parts[0].Text responseText = geminiResponse.Candidates[0].Content.Parts[0].Text
}
jsonResponse, err := json.Marshal(fullTextResponse) jsonResponse, err := json.Marshal(fullTextResponse)
if err != nil { if err != nil {
common.SysError("error marshalling stream response: " + err.Error()) common.SysError("error marshalling stream response: " + err.Error())