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");
long timestamp = resJson.getLong("created");
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";
out.print(tmpRes);
out.flush();

View File

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

Binary file not shown.