|
@@ -124,7 +124,7 @@ public class MirrorController {
|
|
|
* 会话限制
|
|
* 会话限制
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping("/gpt/conversation/limit")
|
|
@RequestMapping("/gpt/conversation/limit")
|
|
|
- public void conversationLimit(@RequestBody ConversationRequest conversationRequest) {
|
|
|
|
|
|
|
+ public void conversationLimit(@RequestParam(value = "isCar", defaultValue = "false") Boolean isCar, @RequestBody ConversationRequest conversationRequest) {
|
|
|
//1.从request获取请求头Authorization 并取 值内 'Bearer ' 后的值为usertoken
|
|
//1.从request获取请求头Authorization 并取 值内 'Bearer ' 后的值为usertoken
|
|
|
String authorization = request.getHeader("Authorization");
|
|
String authorization = request.getHeader("Authorization");
|
|
|
String carid = request.getHeader("Carid");
|
|
String carid = request.getHeader("Carid");
|
|
@@ -139,7 +139,7 @@ public class MirrorController {
|
|
|
if(StringUtils.isNotBlank(conversationRequest.getCarId())){
|
|
if(StringUtils.isNotBlank(conversationRequest.getCarId())){
|
|
|
//4.获取gpt-4 的规则限制
|
|
//4.获取gpt-4 的规则限制
|
|
|
//text-davinci-002-render-sha 3.5
|
|
//text-davinci-002-render-sha 3.5
|
|
|
- ConversationLimitResponse conversationLimitResponse = chatGptAccountService.conversationLimit(userToken, conversationRequest.getModel(), conversationRequest.getCarId(), user);
|
|
|
|
|
|
|
+ ConversationLimitResponse conversationLimitResponse = chatGptAccountService.conversationLimit(userToken, conversationRequest.getModel(), conversationRequest.getCarId(), user, isCar);
|
|
|
|
|
|
|
|
OutputStream out = null;
|
|
OutputStream out = null;
|
|
|
String messgae = "";
|
|
String messgae = "";
|
|
@@ -163,6 +163,7 @@ public class MirrorController {
|
|
|
IoKit.close(out);
|
|
IoKit.close(out);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//记录提问时间,车次,标题和模型
|
|
//记录提问时间,车次,标题和模型
|
|
|
TASK_EXECUTOR.execute(() -> {
|
|
TASK_EXECUTOR.execute(() -> {
|
|
|
chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
|
|
chatGptAccountService.saveConversationRecord(userToken, conversationRequest);
|