(state: MakaPiTranscriptState, messageId: string, text: string)
| 1474 | } |
| 1475 | |
| 1476 | function appendAssistantText(state: MakaPiTranscriptState, messageId: string, text: string): void { |
| 1477 | const last = state.entries[state.entries.length - 1]; |
| 1478 | if (last?.kind === 'assistant' && last.messageId === messageId) { |
| 1479 | last.text += text; |
| 1480 | return; |
| 1481 | } |
| 1482 | state.entries.push({ kind: 'assistant', messageId, text }); |
| 1483 | } |
| 1484 | |
| 1485 | function setAssistantText(state: MakaPiTranscriptState, messageId: string, text: string): boolean { |
| 1486 | for (let index = state.entries.length - 1; index >= 0; index -= 1) { |
no test coverage detected