mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
Improve OpenClaw SSE transcript parsing and stream readability
This commit is contained in:
parent
5134cac993
commit
81bc8c7313
5 changed files with 206 additions and 4 deletions
|
|
@ -3,9 +3,9 @@ import type { TranscriptEntry, StdoutLineParser } from "./types";
|
|||
type RunLogChunk = { ts: string; stream: "stdout" | "stderr" | "system"; chunk: string };
|
||||
|
||||
function appendTranscriptEntry(entries: TranscriptEntry[], entry: TranscriptEntry) {
|
||||
if (entry.kind === "thinking" && entry.delta) {
|
||||
if ((entry.kind === "thinking" || entry.kind === "assistant") && entry.delta) {
|
||||
const last = entries[entries.length - 1];
|
||||
if (last && last.kind === "thinking" && last.delta) {
|
||||
if (last && last.kind === entry.kind && last.delta) {
|
||||
last.text += entry.text;
|
||||
last.ts = entry.ts;
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue