public abstract class StreamChatCompletionListener
extends java.lang.Object
| Constructor and Description |
|---|
StreamChatCompletionListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
cancel eventSource
|
void |
onClosed(java.lang.String requestId)
No further calls to this listener will be made.
|
void |
onEvent(java.lang.String requestId,
ChatCompletion chatCompletion)
event line
|
void |
onEventDone(java.lang.String requestId)
event message finished
|
void |
onFailure(java.lang.String requestId,
java.lang.Throwable t,
okhttp3.Response response)
Invoked when an event source has been closed due to an error reading from or writing to the
network.
|
void |
onOpen(java.lang.String requestId,
okhttp3.Response response)
Invoked when an event source has been accepted by the remote peer and may begin transmitting
events.
|
void |
setEventSource(okhttp3.sse.EventSource eventSource) |
public void setEventSource(okhttp3.sse.EventSource eventSource)
public void onOpen(java.lang.String requestId,
okhttp3.Response response)
requestId - request IDresponse - OK http responsepublic void onEvent(java.lang.String requestId,
ChatCompletion chatCompletion)
requestId - request IDchatCompletion - return chat completionpublic void onEventDone(java.lang.String requestId)
requestId - request IDpublic void onClosed(java.lang.String requestId)
No further calls to this listener will be made.
requestId - request IDpublic void onFailure(java.lang.String requestId,
java.lang.Throwable t,
okhttp3.Response response)
requestId - request IDt - throwableresponse - responsepublic void close()
Copyright © 2023. All Rights Reserved.