fix 舆情自动化图片分析代码
This commit is contained in:
@@ -50,16 +50,17 @@ public class TestController {
|
|||||||
@ApiOperation(value = "测试Dify")
|
@ApiOperation(value = "测试Dify")
|
||||||
public ResultMsg<Object> runWorkflows2(@RequestBody String contentStr) {
|
public ResultMsg<Object> runWorkflows2(@RequestBody String contentStr) {
|
||||||
//"(1)语音电话(2024-11-09 12:10:57)客服:哎,哎,姚先生,你好打扰到您了,蹦蹦沃沃赛练呢。客户:喂你好。客服:哎,对对,小明那个昨天看了车不要着急走,今天可有时间到店来接待您试驾感受一下呢。客户:我现在已经开工了,我现在没时间过去啊。客服:好的,那等你忙完这段时间好吧。客户:好的,好的,好的好,再见啊。客服:好,那这边先不打扰您,哎,好,再见。";
|
//"(1)语音电话(2024-11-09 12:10:57)客服:哎,哎,姚先生,你好打扰到您了,蹦蹦沃沃赛练呢。客户:喂你好。客服:哎,对对,小明那个昨天看了车不要着急走,今天可有时间到店来接待您试驾感受一下呢。客户:我现在已经开工了,我现在没时间过去啊。客服:好的,那等你忙完这段时间好吧。客户:好的,好的,好的好,再见啊。客服:好,那这边先不打扰您,哎,好,再见。";
|
||||||
//构建图片分析请求对象
|
JSONObject mbJsonp = new JSONObject();
|
||||||
DifyImageWorkFlow diFyImageWorkFlow = new DifyImageWorkFlow();
|
mbJsonp.put("type", "image");
|
||||||
diFyImageWorkFlow.setImageUrl("https://newbie-assets.digitalvolvo.com/images/2025/02/21/174011708518185205a49d2aead89b9aa8918c72fe5c08dcc66777df1f9df95535d991fbc8533.1740117074777.386.png");
|
mbJsonp.put("transfer_method", "remote_url");
|
||||||
|
mbJsonp.put("imageUrl", "https://newbie-assets.digitalvolvo.com/images/2025/02/21/174011708518185205a49d2aead89b9aa8918c72fe5c08dcc66777df1f9df95535d991fbc8533.1740117074777.386.png");
|
||||||
DiFyReq diFyImageReq = new DiFyReq();
|
DiFyReq diFyImageReq = new DiFyReq();
|
||||||
diFyImageReq.setUser("admin");
|
diFyImageReq.setUser("admin");
|
||||||
diFyImageReq.setFlowId("app-ZcRTduhbcyu9qzXs2GAnXo0v");
|
diFyImageReq.setFlowId("app-ZcRTduhbcyu9qzXs2GAnXo0v");
|
||||||
JSONObject imageInputs = new JSONObject();
|
JSONObject imageInputs = new JSONObject();
|
||||||
imageInputs.put("image", JSON.toJSONString(diFyImageWorkFlow));
|
imageInputs.put("image", mbJsonp);
|
||||||
diFyImageReq.setInputs(imageInputs.toJSONString());
|
diFyImageReq.setInputs(imageInputs.toJSONString());
|
||||||
|
log.info("difyImageReq:{}", JSON.toJSONString(diFyImageReq));
|
||||||
Object difyResult = diFyService.getDiFyObject(diFyImageReq);
|
Object difyResult = diFyService.getDiFyObject(diFyImageReq);
|
||||||
JSONObject dify = JSONObject.parseObject(difyResult.toString());
|
JSONObject dify = JSONObject.parseObject(difyResult.toString());
|
||||||
return ResultMsg.ok(dify);
|
return ResultMsg.ok(dify);
|
||||||
|
|||||||
Reference in New Issue
Block a user