|
@@ -608,7 +608,7 @@ public class GRPCController extends BaseController {
|
|
|
// else
|
|
|
// tools = tools;
|
|
|
// }
|
|
|
- String dataJson = buildBigModelReqForChat(sessionId, historyDates, ipAddr, isStrong, chatReq.getTopP(), chatReq.getTemperature(), tools, useRag, extraStr);
|
|
|
+ String dataJson = buildBigModelReqForChat(sessionId, historyDates, ipAddr, isStrong, chatReq.getTopP(), chatReq.getTemperature(), tools, useRag, extraStr, chatReq.getPrompt());
|
|
|
log.info("******请求大模型的问答参数为{}", dataJson);
|
|
|
PredictionsRequest request = PredictionsRequest.newBuilder()
|
|
|
.setModelName("slibra_bot")
|
|
@@ -796,7 +796,7 @@ public class GRPCController extends BaseController {
|
|
|
return JSON.toJSONString(map);
|
|
|
}
|
|
|
|
|
|
- private String buildBigModelReqForChat(String sessionId, List<String> historyDates, String ipAddr, int isStrong, Double topP, Double temperature, String tools, boolean useRag, String extraStr) {
|
|
|
+ private String buildBigModelReqForChat(String sessionId, List<String> historyDates, String ipAddr, int isStrong, Double topP, Double temperature, String tools, boolean useRag, String extraStr, String prompt) {
|
|
|
ChatRequest chatRequest = new ChatRequest();
|
|
|
chatRequest.setSessionId(sessionId);
|
|
|
chatRequest.setHistoryDia(historyDates);
|
|
@@ -813,7 +813,8 @@ public class GRPCController extends BaseController {
|
|
|
chatRequest.setStrengthen(isStrong == 1);
|
|
|
chatRequest.setTools(tools);
|
|
|
chatRequest.setUseRag(useRag);
|
|
|
- chatRequest.setPrompt(ZJWD_PROMPT);
|
|
|
+ //2024年08月11日16:04:21 允许用户自定义prompt
|
|
|
+ chatRequest.setPrompt(StringUtils.isBlank(prompt) ? DEFAULT_PROMPT : prompt);
|
|
|
return JSON.toJSONString(chatRequest);
|
|
|
}
|
|
|
|