refactor(yudao-module-llm): 调整模型服务日志输出顺序

- 将行数初始化移至循环开始前
This commit is contained in:
sunxiqing 2025-03-06 10:29:52 +08:00
parent 16338b56d6
commit a3944bdf77

View File

@ -279,13 +279,13 @@ public class ModelService {
try (InputStream inputStream = responseEntity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String line;
int i = 0;
while ((line = reader.readLine()) != null) {
if (StringUtils.isBlank(line)) {
continue;
}
log.info("接收到的响应行数据: {}", line);
int i = 0;
if (!"data: [DONE]".equals(line)) {
String jsonData = line.substring(line.indexOf("{"));
JSONObject jsonObject = JSON.parseObject(jsonData);