Unverified Commit 365431d4 authored by royjhan's avatar royjhan Committed by GitHub
Browse files

return tool calls finish reason for openai (#5995)

* hot fix

* backend stream support

* clean up

* finish reason

* move to openai
parent 161e12ce
......@@ -218,6 +218,9 @@ func toChatCompletion(id string, r api.ChatResponse) ChatCompletion {
Index: 0,
Message: Message{Role: r.Message.Role, Content: r.Message.Content, ToolCalls: toolCalls},
FinishReason: func(reason string) *string {
if len(toolCalls) > 0 {
reason = "tool_calls"
}
if len(reason) > 0 {
return &reason
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment