public class ChatGLMModelExecutor extends Object implements Executor, ParameterHandler<ChatGLMCompletionRequest>, ResultHandler
文档:https://open.bigmodel.cn/dev/api#chatglm_turbo ApiKey:https://open.bigmodel.cn/usercenter/apikeys
| 构造器和说明 |
|---|
ChatGLMModelExecutor(Configuration configuration) |
| 限定符和类型 | 方法和说明 |
|---|---|
okhttp3.sse.EventSource |
completions(CompletionRequest completionRequest,
okhttp3.sse.EventSourceListener eventSourceListener)
问答模式,流式反馈
|
okhttp3.sse.EventSource |
completions(String apiHostByUser,
String apiKeyByUser,
CompletionRequest completionRequest,
okhttp3.sse.EventSourceListener eventSourceListener)
问答模式,流式反馈 & 接收用户自定义 apiHost、apiKey - 适用于每个用户都有自己独立配置的场景
|
okhttp3.sse.EventSourceListener |
eventSourceListener(okhttp3.sse.EventSourceListener eventSourceListener) |
ImageResponse |
genImages(ImageRequest imageRequest)
生成图片
|
ImageResponse |
genImages(String apiHostByUser,
String apiKeyByUser,
ImageRequest imageRequest)
生成图片
|
ChatGLMCompletionRequest |
getParameterObject(CompletionRequest completionRequest) |
okhttp3.sse.EventSource |
pictureUnderstanding(PictureRequest pictureRequest,
okhttp3.sse.EventSourceListener eventSourceListener)
图片理解
|
okhttp3.sse.EventSource |
pictureUnderstanding(String apiHostByUser,
String apiKeyByUser,
PictureRequest pictureRequest,
okhttp3.sse.EventSourceListener eventSourceListener)
图片理解
|
public ChatGLMModelExecutor(Configuration configuration)
public okhttp3.sse.EventSource completions(CompletionRequest completionRequest, okhttp3.sse.EventSourceListener eventSourceListener) throws Exception
Executorcompletions 在接口中 ExecutorcompletionRequest - 请求信息eventSourceListener - 实现监听;通过监听的 onEvent 方法接收数据Exception - 异常public okhttp3.sse.EventSource completions(String apiHostByUser, String apiKeyByUser, CompletionRequest completionRequest, okhttp3.sse.EventSourceListener eventSourceListener) throws Exception
Executorcompletions 在接口中 ExecutorapiHostByUser - apiHostapiKeyByUser - apiKeycompletionRequest - 请求信息eventSourceListener - 实现监听;通过监听的 onEvent 方法接收数据Exception - 异常public ImageResponse genImages(ImageRequest imageRequest)
Executorpublic ImageResponse genImages(String apiHostByUser, String apiKeyByUser, ImageRequest imageRequest)
Executorpublic okhttp3.sse.EventSource pictureUnderstanding(PictureRequest pictureRequest, okhttp3.sse.EventSourceListener eventSourceListener) throws Exception
ExecutorpictureUnderstanding 在接口中 ExecutorpictureRequest - 图片和对图片的描述Exceptionpublic okhttp3.sse.EventSource pictureUnderstanding(String apiHostByUser, String apiKeyByUser, PictureRequest pictureRequest, okhttp3.sse.EventSourceListener eventSourceListener) throws Exception
ExecutorpictureUnderstanding 在接口中 ExecutorpictureRequest - 图片和对图片的描述Exceptionpublic ChatGLMCompletionRequest getParameterObject(CompletionRequest completionRequest)
public okhttp3.sse.EventSourceListener eventSourceListener(okhttp3.sse.EventSourceListener eventSourceListener)
eventSourceListener 在接口中 ResultHandlerCopyright © 2023. All rights reserved.