Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

return tool calls finish reason for openai (#5995)

royjhan365431d40617
diff --git a/openai/openai.go b/openai/openai.go
index de6f4bd59..5bd806604 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
}