Commit a359a861 by 潘诗林

fix:获取大模型返回的错误信息

1 parent 78ed5c19
......@@ -69,7 +69,7 @@ public class PreLearnBigModelService {
@SuppressWarnings("unchecked")
public String submitAsyncTask(String recordingText) {
try {
String url = env.getProperty("big.model.base.prelearn.url", "http://192.168.1.191:8000/api/v1/calls/by-template");
String url = env.getProperty("big.model.base.prelearn.url", "http://192.168.1.191:8011/api/v1/calls/by-template");
String template_id = env.getProperty("big.model.base.prelearn.template", "CPPE-BENCH-001");
String account_id = env.getProperty("big.model.base.prelearn.account", "LEGACY-eb0333776935");
......@@ -236,7 +236,7 @@ public class PreLearnBigModelService {
@SuppressWarnings("unchecked")
public TaskQueryResult queryTaskResult(String modelTaskId) {
try {
String baseUrl = env.getProperty("big.model.base.prelearn.query.url", "http://192.168.1.191:8000/api/v1/calls/orchestrate/async?task_id=");
String baseUrl = env.getProperty("big.model.base.prelearn.query.url", "http://192.168.1.191:8011/api/v1/calls/orchestrate/async?task_id=");
String url = baseUrl + modelTaskId;
log.info("queryTaskResult: 查询任务结果, taskId={}", modelTaskId);
......@@ -309,13 +309,13 @@ public class PreLearnBigModelService {
if (result.isCompleted()) {
// 检查 scriptJson 外层的 is_legal 字段
boolean isLegal = false;
boolean isLegal = true;
String legalMsg = null;
if (StringUtils.hasText(result.getScriptJson())) {
try {
JSONObject outerJson = JSONObject.parseObject(result.getScriptJson());
if (outerJson.containsKey("is_legal") && outerJson.getBooleanValue("is_legal")) {
isLegal = true;
if (outerJson.containsKey("is_legal") && !outerJson.getBooleanValue("is_legal")) {
isLegal = false;
legalMsg = outerJson.getString("msg");
}
} catch (Exception e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!