(state: State, events: LLMEvent[])
| 72 | } |
| 73 | |
| 74 | const closeOpenBlocks = (state: State, events: LLMEvent[]): State => { |
| 75 | for (const id of state.reasoning) events.push(LLMEvent.reasoningEnd({ id })) |
| 76 | for (const id of state.text) events.push(LLMEvent.textEnd({ id })) |
| 77 | return { ...state, text: new Set(), reasoning: new Set() } |
| 78 | } |
| 79 | |
| 80 | export const finish = ( |
| 81 | state: State, |