(result: ExecutionResult)
| 330 | } |
| 331 | |
| 332 | async function completeLoggingSession(result: ExecutionResult): Promise<void> { |
| 333 | if (!result._streamingMetadata?.loggingSession) { |
| 334 | return |
| 335 | } |
| 336 | |
| 337 | const { traceSpans, totalDuration } = buildTraceSpans(result) |
| 338 | |
| 339 | await result._streamingMetadata.loggingSession.safeComplete({ |
| 340 | endedAt: new Date().toISOString(), |
| 341 | totalDurationMs: totalDuration || 0, |
| 342 | finalOutput: result.output || {}, |
| 343 | traceSpans: (traceSpans || []) as any, |
| 344 | workflowInput: result._streamingMetadata.processedInput, |
| 345 | }) |
| 346 | |
| 347 | result._streamingMetadata = undefined |
| 348 | } |
| 349 | |
| 350 | export async function createStreamingResponse( |
| 351 | options: StreamingResponseOptions |
no test coverage detected