在function_call为空时不计费
This commit is contained in:
parent
64217d1f50
commit
bcd46f0cf7
@ -52,9 +52,11 @@ func openaiStreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*O
|
|||||||
}
|
}
|
||||||
for _, choice := range streamResponse.Choices {
|
for _, choice := range streamResponse.Choices {
|
||||||
responseText += choice.Delta.Content
|
responseText += choice.Delta.Content
|
||||||
|
if choice.Delta.FunctionCall != nil {
|
||||||
responseFunctionCallName += choice.Delta.FunctionCall.Name
|
responseFunctionCallName += choice.Delta.FunctionCall.Name
|
||||||
responseFunctionCallArguments += choice.Delta.FunctionCall.Arguments
|
responseFunctionCallArguments += choice.Delta.FunctionCall.Arguments
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case RelayModeCompletions:
|
case RelayModeCompletions:
|
||||||
var streamResponse CompletionsStreamResponse
|
var streamResponse CompletionsStreamResponse
|
||||||
err := json.Unmarshal([]byte(data), &streamResponse)
|
err := json.Unmarshal([]byte(data), &streamResponse)
|
||||||
|
Loading…
Reference in New Issue
Block a user