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

3
import cn.bugstack.chatglm.model.*;
小傅哥's avatar
小傅哥 已提交
4 5 6 7 8 9 10 11
import io.reactivex.Single;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Path;

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

    String v3_completions = "api/paas/v3/model-api/{model}/sse-invoke";
M
maxuan 已提交
18
    String v3_completions_sync = "api/paas/v3/model-api/{model}/invoke";
小傅哥's avatar
小傅哥 已提交
19 20 21 22

    @POST(v3_completions)
    Single<ChatCompletionResponse> completions(@Path("model") String model, @Body ChatCompletionRequest chatCompletionRequest);

M
maxuan 已提交
23 24 25
    @POST(v3_completions_sync)
    Single<ChatCompletionSyncResponse> completions(@Body ChatCompletionRequest chatCompletionRequest);

26 27 28 29 30 31 32
    String v4 = "api/paas/v4/chat/completions";

    String cogview3 = "api/paas/v4/images/generations";

    @POST(cogview3)
    Single<ImageCompletionResponse> genImages(@Body ImageCompletionRequest imageCompletionRequest);

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