MCPcopy
hub / github.com/TanStack/ai / getResult

Method getResult

packages/ai/src/activities/chat/stream/processor.ts:2125–2143  ·  view source on GitHub ↗

* Get current result (aggregated across all messages)

()

Source from the content-addressed store, hash-verified

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)

Callers 1

processMethod · 0.95

Calls 3

getCompletedToolCallsMethod · 0.95
valuesMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected