Commit d77ca5b1 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 123c324c
...@@ -66,6 +66,7 @@ public class BaseChatService extends AbstractFlowChatTemplate { ...@@ -66,6 +66,7 @@ public class BaseChatService extends AbstractFlowChatTemplate {
JSONObject rspJson = new JSONObject(); JSONObject rspJson = new JSONObject();
rspJson.put("id", context.getMsgId()); rspJson.put("id", context.getMsgId());
rspJson.put("created", new Date().getTime()); rspJson.put("created", new Date().getTime());
rspJson.put("model", "");
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
JSONObject obj = new JSONObject(); JSONObject obj = new JSONObject();
...@@ -74,13 +75,16 @@ public class BaseChatService extends AbstractFlowChatTemplate { ...@@ -74,13 +75,16 @@ public class BaseChatService extends AbstractFlowChatTemplate {
delta.put("role", "assistant"); delta.put("role", "assistant");
delta.put("content", ""); delta.put("content", "");
obj.put("delta", delta); obj.put("delta", delta);
obj.put("index", 0);
obj.put("finish_reason", "null");
jsonArray.add(obj); jsonArray.add(obj);
rspJson.put("delta", jsonArray); rspJson.put("choices", jsonArray);
rspJson.put("index", 0); rspJson.put("object", "");
rspJson.put("finish_reason", null);
num++; num++;
context.getEmitter().next(rspJson.toJSONString()); context.getEmitter().next(rspJson.toJSONString());
} }
/* String status = bodyJson.getString("status"); /* String status = bodyJson.getString("status");
if ("running".equals(status)) { if ("running".equals(status)) {
...@@ -122,7 +126,7 @@ public class BaseChatService extends AbstractFlowChatTemplate { ...@@ -122,7 +126,7 @@ public class BaseChatService extends AbstractFlowChatTemplate {
delta.put("content", ""); delta.put("content", "");
this.num = 0; this.num = 0;
}else{ }else{
delta.put("finish_reason", null); jsonObject.put("finish_reason", "null");
} }
} }
......
...@@ -50,8 +50,8 @@ public class TestRot { ...@@ -50,8 +50,8 @@ public class TestRot {
.build(); .build();
Request request = new Request.Builder() Request request = new Request.Builder()
// .url("http://localhost:18006/chat/base") .url("http://localhost:18006/chat/base")
.url("http://robot.scsmile.cn/chat/base") // .url("http://robot.scsmile.cn/chat/base")
.headers(headers) .headers(headers)
.post(requestBody) .post(requestBody)
.build(); .build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment