mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-17 16:43:54 +00:00
fix: fix PaLM2 not billed
This commit is contained in:
@@ -131,6 +131,9 @@ func palmStreamHandler(c *gin.Context, resp *http.Response) (*OpenAIErrorWithSta
|
|||||||
fullTextResponse := streamResponsePaLM2OpenAI(&palmResponse)
|
fullTextResponse := streamResponsePaLM2OpenAI(&palmResponse)
|
||||||
fullTextResponse.Id = responseId
|
fullTextResponse.Id = responseId
|
||||||
fullTextResponse.Created = createdTime
|
fullTextResponse.Created = createdTime
|
||||||
|
if len(palmResponse.Candidates) > 0 {
|
||||||
|
responseText = palmResponse.Candidates[0].Content
|
||||||
|
}
|
||||||
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())
|
||||||
|
Reference in New Issue
Block a user