* Get current result (aggregated across all messages)
()
| 2123 | * Get current result (aggregated across all messages) |
| 2124 | */ |
| 2125 | private getResult(): ProcessorResult { |
| 2126 | const toolCalls = this.getCompletedToolCalls() |
| 2127 | let content = '' |
| 2128 | let thinking = '' |
| 2129 | |
| 2130 | for (const state of this.messageStates.values()) { |
| 2131 | content += state.totalTextContent |
| 2132 | for (const stepId of state.thinkingStepOrder) { |
| 2133 | thinking += state.thinkingSteps.get(stepId) ?? '' |
| 2134 | } |
| 2135 | } |
| 2136 | |
| 2137 | return { |
| 2138 | content, |
| 2139 | thinking: thinking || undefined, |
| 2140 | toolCalls: toolCalls.length > 0 ? toolCalls : undefined, |
| 2141 | finishReason: this.finishReason, |
| 2142 | } |
| 2143 | } |
| 2144 | |
| 2145 | /** |
| 2146 | * Get current processor state (aggregated across all messages) |
no test coverage detected