OpenAiSession.java 1.1 KB
Newer Older
小傅哥's avatar
小傅哥 已提交
1 2
package cn.bugstack.chatglm.session;

3
import cn.bugstack.chatglm.model.*;
小傅哥's avatar
小傅哥 已提交
4 5 6 7
import com.fasterxml.jackson.core.JsonProcessingException;
import okhttp3.sse.EventSource;
import okhttp3.sse.EventSourceListener;

M
maxuan 已提交
8
import java.io.IOException;
9 10
import java.util.concurrent.CompletableFuture;

小傅哥's avatar
小傅哥 已提交
11 12 13
/**
 * @author 小傅哥,微信:fustack
 * @description 会话服务接口
14
 * @github https://github.com/fuzhengwei/chatglm-sdk-java
小傅哥's avatar
小傅哥 已提交
15 16 17 18
 * @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
 */
public interface OpenAiSession {

19
    EventSource completions(ChatCompletionRequest chatCompletionRequest, EventSourceListener eventSourceListener) throws Exception;
小傅哥's avatar
小傅哥 已提交
20

21
    CompletableFuture<String> completions(ChatCompletionRequest chatCompletionRequest) throws Exception;
22

23 24 25 26 27
    ChatCompletionSyncResponse completionsSync(ChatCompletionRequest chatCompletionRequest) throws Exception;

    ImageCompletionResponse genImages(ImageCompletionRequest imageCompletionRequest) throws Exception;

    Configuration configuration();
M
maxuan 已提交
28

小傅哥's avatar
小傅哥 已提交
29
}