(ctx, info)
| 519 | }, |
| 520 | |
| 521 | onFinish(ctx, info) { |
| 522 | const now = Date.now() |
| 523 | |
| 524 | // Emit completed for the final iteration |
| 525 | if (currentIteration >= 0) { |
| 526 | safeEmit('text:iteration:completed', { |
| 527 | ...buildEventContext(ctx), |
| 528 | iteration: currentIteration, |
| 529 | messageId: localMessageId || undefined, |
| 530 | duration: now - iterationStartTime, |
| 531 | finishReason: info.finishReason || undefined, |
| 532 | usage: info.usage, |
| 533 | timestamp: now, |
| 534 | }) |
| 535 | } |
| 536 | |
| 537 | safeEmit('text:request:completed', { |
| 538 | ...buildEventContext(ctx), |
| 539 | content: info.content, |
| 540 | messageId: localMessageId || undefined, |
| 541 | finishReason: info.finishReason || undefined, |
| 542 | usage: info.usage, |
| 543 | duration: info.duration, |
| 544 | timestamp: now, |
| 545 | }) |
| 546 | }, |
| 547 | } |
| 548 | } |
nothing calls this directly
no test coverage detected