From 655405462fc8894c2b13f8ee0e9b225bf0cc934f Mon Sep 17 00:00:00 2001 From: David Zhuang Date: Sat, 16 Dec 2023 13:24:15 -0500 Subject: [PATCH] refactor: removing unused if statement --- controller/relay-gemini-chat.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/controller/relay-gemini-chat.go b/controller/relay-gemini-chat.go index 94f723ad..d2c252e7 100644 --- a/controller/relay-gemini-chat.go +++ b/controller/relay-gemini-chat.go @@ -195,9 +195,7 @@ func geminiChatStreamHandler(c *gin.Context, resp *http.Response) (*OpenAIErrorW fullTextResponse := streamResponseGeminiChat2OpenAI(&geminiResponse) fullTextResponse.Id = responseId 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) if err != nil { common.SysError("error marshalling stream response: " + err.Error())