Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/SwiftLM/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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))
Expand Down
Loading