Package com.chatmotorapi.api.listener
Interface MotorResponseListener
- All Known Implementing Classes:
ConsoleResponseListener
,MotorFileResponseListener
,QueueResponseListener
,SwingResponseListener
public interface MotorResponseListener
Listener interface for handling streamed responses from the ChatMotor.
-
Method Summary
Modifier and Type Method Description void
onChunkReceived(MotorResponse motorResponse)
Called when a new chunk of response is received.void
onError(Throwable throwable)
Called when an error occurs during the response streaming.void
onResponseCompleted()
Called when the response streaming is successfully completed.
-
Method Details
-
onChunkReceived
Called when a new chunk of response is received.- Parameters:
motorResponse
- the ChatMotor response.
-
onResponseCompleted
void onResponseCompleted()Called when the response streaming is successfully completed. This method is only invoked if the entire process completes without encountering any errors. -
onError
Called when an error occurs during the response streaming.- Parameters:
throwable
- the exception that occurred during streaming.
-