eranet111 commited on
Commit ·
b99d1e9
1
Parent(s): 0a47b2f
Ensure all model response chunks are streamed without filtering
Browse filesRemove logic that filtered out streaming chunks, ensuring all content, including thinking tokens, is passed through to the client.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a225ab96-d6aa-42ce-a50b-aa844bc8db2b
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: d0de45b0-d639-4150-bca9-9b990b65bda9
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/cbd1ae84-d682-4025-b26d-c56df1ac13a1/a225ab96-d6aa-42ce-a50b-aa844bc8db2b/jm4hNZf
Replit-Helium-Checkpoint-Created: true
main.go
CHANGED
|
@@ -209,7 +209,6 @@ func streamUpstream(w http.ResponseWriter, modelID string, messages []Message, t
|
|
| 209 |
flusher, _ := w.(http.Flusher)
|
| 210 |
scanner := bufio.NewScanner(resp.Body)
|
| 211 |
accum := make(map[int]*AccumToolCall)
|
| 212 |
-
firstChunkSent := false
|
| 213 |
|
| 214 |
for scanner.Scan() {
|
| 215 |
line := scanner.Text()
|
|
@@ -296,15 +295,6 @@ func streamUpstream(w http.ResponseWriter, modelID string, messages []Message, t
|
|
| 296 |
continue
|
| 297 |
}
|
| 298 |
|
| 299 |
-
if !firstChunkSent && delta["content"] != nil {
|
| 300 |
-
delta["role"] = "assistant"
|
| 301 |
-
firstChunkSent = true
|
| 302 |
-
}
|
| 303 |
-
|
| 304 |
-
if delta["content"] == nil && delta["tool_calls"] == nil && finishReason == nil {
|
| 305 |
-
continue
|
| 306 |
-
}
|
| 307 |
-
|
| 308 |
// podmień model na alias klienta
|
| 309 |
chunk["model"] = clientModel
|
| 310 |
out, _ := json.Marshal(chunk)
|
|
|
|
| 209 |
flusher, _ := w.(http.Flusher)
|
| 210 |
scanner := bufio.NewScanner(resp.Body)
|
| 211 |
accum := make(map[int]*AccumToolCall)
|
|
|
|
| 212 |
|
| 213 |
for scanner.Scan() {
|
| 214 |
line := scanner.Text()
|
|
|
|
| 295 |
continue
|
| 296 |
}
|
| 297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
// podmień model na alias klienta
|
| 299 |
chunk["model"] = clientModel
|
| 300 |
out, _ := json.Marshal(chunk)
|