From a1a299cb4254ddcc45969ee9909f15929473e1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5?= <184172133@qq.com> Date: Tue, 10 Oct 2023 22:02:56 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=AE=9A=E4=B9=89=20OpenAi=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/bugstack/chatglm/IOpenAiApi.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/java/cn/bugstack/chatglm/IOpenAiApi.java diff --git a/src/main/java/cn/bugstack/chatglm/IOpenAiApi.java b/src/main/java/cn/bugstack/chatglm/IOpenAiApi.java new file mode 100644 index 0000000..53058ce --- /dev/null +++ b/src/main/java/cn/bugstack/chatglm/IOpenAiApi.java @@ -0,0 +1,23 @@ +package cn.bugstack.chatglm; + +import cn.bugstack.chatglm.model.ChatCompletionRequest; +import cn.bugstack.chatglm.model.ChatCompletionResponse; +import io.reactivex.Single; +import retrofit2.http.Body; +import retrofit2.http.POST; +import retrofit2.http.Path; + +/** + * @author 小傅哥,微信:fustack + * @description OpenAi 接口,用于扩展通用类服务 + * @github https://github.com/fuzhengwei + * @Copyright 公众号:bugstack虫洞栈 | 博客:https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获! + */ +public interface IOpenAiApi { + + String v3_completions = "api/paas/v3/model-api/{model}/sse-invoke"; + + @POST(v3_completions) + Single completions(@Path("model") String model, @Body ChatCompletionRequest chatCompletionRequest); + +} -- GitLab