diff --git a/Sources/SwiftLM/Server.swift b/Sources/SwiftLM/Server.swift index 9acedd9..01ecb3b 100644 --- a/Sources/SwiftLM/Server.swift +++ b/Sources/SwiftLM/Server.swift @@ -3549,6 +3549,8 @@ func handleChatStreaming( reason = "length" case .cancelled, .stop: reason = hasToolCalls ? "tool_calls" : "stop" + @unknown default: + reason = "stop" } // A JSON-mode reply shorter than the flush threshold is still in the // buffer; it goes out before the finish chunk. @@ -4063,6 +4065,8 @@ func handleTextStreaming( reason = "length" case .cancelled, .stop: reason = "stop" + @unknown default: + reason = "stop" } if !heldStopTail.isEmpty { cont.yield(sseTextChunk(modelId: modelId, text: heldStopTail, finishReason: nil))