(context: StreamingContext)
| 5 | * Build a ToolCallSummary array from the streaming context. |
| 6 | */ |
| 7 | export function buildToolCallSummaries(context: StreamingContext): ToolCallSummary[] { |
| 8 | return Array.from(context.toolCalls.values()).map((toolCall) => ({ |
| 9 | id: toolCall.id, |
| 10 | name: toolCall.name, |
| 11 | status: toolCall.status, |
| 12 | params: toolCall.params, |
| 13 | result: getToolCallStateOutput(toolCall), |
| 14 | error: toolCall.error, |
| 15 | durationMs: |
| 16 | toolCall.endTime && toolCall.startTime ? toolCall.endTime - toolCall.startTime : undefined, |
| 17 | })) |
| 18 | } |
no test coverage detected