|
@@ -0,0 +1,47 @@
|
|
|
|
+package com.qmth.boot.core.ai.client;
|
|
|
|
+
|
|
|
|
+import com.qmth.boot.core.ai.config.LlmApiConfiguration;
|
|
|
|
+import com.qmth.boot.core.ai.model.AiConstants;
|
|
|
|
+import com.qmth.boot.core.ai.model.llm.ChatChoice;
|
|
|
|
+import com.qmth.boot.core.ai.model.llm.ChatRequest;
|
|
|
|
+import com.qmth.boot.core.ai.model.llm.LlmAppType;
|
|
|
|
+import com.qmth.boot.core.ai.model.llm.PromptTemplate;
|
|
|
|
+import com.qmth.boot.core.retrofit.annotatioin.RetrofitClient;
|
|
|
|
+import com.qmth.boot.core.retrofit.utils.SignatureInfo;
|
|
|
|
+import retrofit2.http.Body;
|
|
|
|
+import retrofit2.http.Header;
|
|
|
|
+import retrofit2.http.POST;
|
|
|
|
+import retrofit2.http.Tag;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 大模型应用服务接口
|
|
|
|
+ */
|
|
|
|
+@RetrofitClient(configuration = LlmApiConfiguration.class)
|
|
|
|
+public interface LlmApiClient {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 大模型chat类型请求
|
|
|
|
+ *
|
|
|
|
+ * @param signature 使用机构AK构造Secret类型签名
|
|
|
|
+ * @param type 大模型应用类型
|
|
|
|
+ * @param request 标准chat请求对象
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @POST(AiConstants.LLM_CHAT_PATH)
|
|
|
|
+ List<ChatChoice> chat(@Tag SignatureInfo signature, @Header(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type,
|
|
|
|
+ @Body ChatRequest request);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 大模型提示词模版获取
|
|
|
|
+ *
|
|
|
|
+ * @param signature 使用机构AK构造Secret类型签名
|
|
|
|
+ * @param type 大模型应用类型
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @POST(AiConstants.LLM_PROMPT_TEMPLATE_PATH)
|
|
|
|
+ PromptTemplate getPromptTemplate(@Tag SignatureInfo signature,
|
|
|
|
+ @Header(AiConstants.LLM_APP_TYPE_HEADER) LlmAppType type);
|
|
|
|
+
|
|
|
|
+}
|