diff --git a/openai/openai.go b/openai/openai.go index de6f4bd5..5bd80660 100644 --- a/openai/openai.go +++ b/openai/openai.go @@ -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 }