Interrupts ongoing inference generation. Sends a brake signal to the engine to forcibly terminate the current token generation loop.
This operation is thread-safe. It sets an internal flag that the inference engine checks before generating the next token to decide whether to exit gracefully.
void LiteRtLm_StopMessage(void* conv_ptr);
| Parameter | Description |
|---|---|
conv_ptr |
The session handle to interrupt. |
// When user clicks the "Stop Generation" button
void UMyChatWidget::OnStopClicked() {
if (CurrentConvPtr) {
LiteRtLm_StopMessage(CurrentConvPtr);
}
}