1574
this._response.clear();
1575
}
1576
>
this._response.finalizeReasoningDuration();
chatModel.ts
1577
>
1578
>
// Compute elapsed generation time before setting terminal state
1579
>
this._elapsedMs ??= Math.max(0, completedAt - this.confirmationAdjustedTimestamp.get());
1580
>
1581
>
// Canceled sessions can be considered 'Complete'
1582
const state = !!this._result?.errorDetails && this._result.errorDetails.code !== 'canceled' ? ResponseModelState.Failed : ResponseModelState.Complete;
1583
this._completionTimestamp = completionTimestamp;