public abstract class PluginListener<R extends PluginParam,T>
extends okhttp3.sse.EventSourceListener
| Constructor and Description |
|---|
PluginListener(OpenAiStreamClient client,
okhttp3.sse.EventSourceListener eventSourceListener,
PluginAbstract<R,T> plugin,
ChatCompletion chatCompletion)
构造方法必备四个元素
|
| Modifier and Type | Method and Description |
|---|---|
void |
onClosed(okhttp3.sse.EventSource eventSource) |
void |
onClosedAfter()
sse关闭后处理,第二次请求方法
|
void |
onEvent(okhttp3.sse.EventSource eventSource,
String id,
String type,
String data) |
void |
onFailure(okhttp3.sse.EventSource eventSource,
Throwable t,
okhttp3.Response response) |
void |
onOpen(okhttp3.sse.EventSource eventSource,
okhttp3.Response response) |
public PluginListener(OpenAiStreamClient client, okhttp3.sse.EventSourceListener eventSourceListener, PluginAbstract<R,T> plugin, ChatCompletion chatCompletion)
client - OpenAiStreamClienteventSourceListener - 处理真实第二次sse请求的自定义监听plugin - 插件信息chatCompletion - 请求参数public void onClosedAfter()
public final void onEvent(okhttp3.sse.EventSource eventSource,
String id,
String type,
String data)
onEvent in class okhttp3.sse.EventSourceListenerpublic final void onClosed(okhttp3.sse.EventSource eventSource)
onClosed in class okhttp3.sse.EventSourceListenerpublic void onOpen(okhttp3.sse.EventSource eventSource,
okhttp3.Response response)
onOpen in class okhttp3.sse.EventSourceListenerpublic void onFailure(okhttp3.sse.EventSource eventSource,
Throwable t,
okhttp3.Response response)
onFailure in class okhttp3.sse.EventSourceListenerCopyright © 2023 grt1228. All rights reserved.