修改json包
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
package com.volvo.ai.analytic.center.service.impl;
|
package com.volvo.ai.analytic.center.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONException;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
import org.springframework.boot.configurationprocessor.json.JSONException;
|
|
||||||
import org.springframework.boot.configurationprocessor.json.JSONObject;
|
|
||||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ public class DeepSeekServiceImpl {
|
|||||||
String responseBodyString = response.body().string();
|
String responseBodyString = response.body().string();
|
||||||
System.out.println("模型出参:" + responseBodyString);
|
System.out.println("模型出参:" + responseBodyString);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject(responseBodyString);
|
JSONObject jsonObject = JSONObject.parseObject(responseBodyString);
|
||||||
String split = jsonObject.getJSONArray("choices")
|
String split = jsonObject.getJSONArray("choices")
|
||||||
.getJSONObject(0)
|
.getJSONObject(0)
|
||||||
.getJSONObject("message")
|
.getJSONObject("message")
|
||||||
|
|||||||
Reference in New Issue
Block a user