(reasoning: string, content: string)
| 33 | import { replayStream } from "./stream-replay"; |
| 34 | |
| 35 | function formatRawStream(reasoning: string, content: string): string { |
| 36 | if (reasoning && content) { |
| 37 | return `[thinking]\n${reasoning}\n\n[content]\n${content}`; |
| 38 | } |
| 39 | if (reasoning) { |
| 40 | return `[thinking]\n${reasoning}`; |
| 41 | } |
| 42 | return content; |
| 43 | } |
| 44 | |
| 45 | async function streamChat( |
| 46 | messages: { role: string; content: string }[], |