在function_call为空时不计费
This commit is contained in:
parent
64217d1f50
commit
bcd46f0cf7
@ -52,8 +52,10 @@ 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
|
||||||
responseFunctionCallName += choice.Delta.FunctionCall.Name
|
if choice.Delta.FunctionCall != nil {
|
||||||
responseFunctionCallArguments += choice.Delta.FunctionCall.Arguments
|
responseFunctionCallName += choice.Delta.FunctionCall.Name
|
||||||
|
responseFunctionCallArguments += choice.Delta.FunctionCall.Arguments
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case RelayModeCompletions:
|
case RelayModeCompletions:
|
||||||
var streamResponse CompletionsStreamResponse
|
var streamResponse CompletionsStreamResponse
|
||||||
|
Loading…
Reference in New Issue
Block a user