fix response BUG

This commit is contained in:
Yanyutin753
2024-04-26 11:59:08 +08:00
parent 337547c677
commit 2bf67ab985
6 changed files with 2 additions and 2 deletions

View File

@@ -1416,7 +1416,7 @@ public class ChatController {
String chat_message_id = resJson.getString("id"); String chat_message_id = resJson.getString("id");
long timestamp = resJson.getLong("created"); long timestamp = resJson.getLong("created");
streamResponse.Choice choice = new streamResponse.Choice(0, new streamResponse.Delta(content), null); streamResponse.Choice choice = new streamResponse.Choice(0, new streamResponse.Delta(content), null);
streamResponse streamResponse = new streamResponse(chat_message_id, "chat.completion.chunk", model, choice, timestamp); streamResponse streamResponse = new streamResponse(chat_message_id, model,"chat.completion.chunk", choice, timestamp);
String tmpRes = "data: " + com.alibaba.fastjson.JSONObject.toJSONString(streamResponse) + "\n\n"; String tmpRes = "data: " + com.alibaba.fastjson.JSONObject.toJSONString(streamResponse) + "\n\n";
out.print(tmpRes); out.print(tmpRes);
out.flush(); out.flush();

View File

@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@JSONType(orders={"id","model","object","choices","created"}) @JSONType(orders={"id","model","object","choice","created"})
public class streamResponse { public class streamResponse {
private String id; private String id;
private String model; private String model;

Binary file not shown.