Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
10470084
提交
10470084
authored
9月 23, 2025
作者:
刘凯歌
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'event_fusion_dev' 到 'event_fusion'
【事件分析】-企业案例增加标记功能以及其他联动修改 查看合并请求
!22
上级
e2cfff9a
bdf7c420
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
153 行增加
和
31 行删除
+153
-31
EventAnalysisController.java
...va/com/zzsn/event/controller/EventAnalysisController.java
+4
-3
LLmConfigController.java
...com/zzsn/event/controller/common/LLmConfigController.java
+11
-1
EventHomeController.java
...a/com/zzsn/event/controller/yjzx/EventHomeController.java
+1
-1
ExternalController.java
...om/zzsn/event/external/controller/ExternalController.java
+2
-2
LlmService.java
src/main/java/com/zzsn/event/llm/LlmService.java
+2
-1
LlmServiceImpl.java
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
+8
-8
AnalysisService.java
src/main/java/com/zzsn/event/service/AnalysisService.java
+16
-2
AnalysisServiceImpl.java
...java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
+107
-10
NetWorkEventTask.java
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
+2
-2
PythonUtil.java
src/main/java/com/zzsn/event/util/PythonUtil.java
+0
-1
没有找到文件。
src/main/java/com/zzsn/event/controller/EventAnalysisController.java
浏览文件 @
10470084
...
...
@@ -599,7 +599,6 @@ public class EventAnalysisController {
}
}
String
versionData
=
eventAnalysisVersionRecordService
.
getVersionData
(
versionId
,
AnalysisColumnEnum
.
ENTERPRISE_CASE
.
getCode
());
//String result = analysisService.llmResult(eventId, startTime, endTime, AnalysisColumnEnum.ENTERPRISE_CASE.getCode());
List
<
JSONObject
>
data
=
null
;
try
{
if
(
versionData
!=
null
&&
(!
versionData
.
endsWith
(
"]"
)
&&
versionData
.
contains
(
"]"
)))
{
...
...
@@ -621,7 +620,8 @@ public class EventAnalysisController {
* @author lkg
* @date 2024/4/12
*/
/*@GetMapping("/countryPolicy")
@Deprecated
@GetMapping
(
"/countryPolicy"
)
public
Result
<?>
countryPolicy
(
@RequestParam
String
eventId
,
@RequestParam
(
required
=
false
)
String
startTime
,
@RequestParam
(
required
=
false
)
String
endTime
,
...
...
@@ -635,7 +635,7 @@ public class EventAnalysisController {
String
versionData
=
eventAnalysisVersionRecordService
.
getVersionData
(
versionId
,
AnalysisColumnEnum
.
COUNTRY_POLICY
.
getCode
());
//String result = analysisService.llmResult(eventId, startTime, endTime, AnalysisColumnEnum.COUNTRY_POLICY.getCode());
return
Result
.
OK
(
JSON
.
parseArray
(
versionData
,
JSONObject
.
class
));
}
*/
}
/**
...
...
@@ -699,6 +699,7 @@ public class EventAnalysisController {
* @author lkg
* @date 2024/4/12
*/
@Deprecated
@GetMapping
(
"/similarEvent"
)
public
Result
<?>
similarEvent
(
@RequestParam
String
eventId
,
@RequestParam
(
required
=
false
)
String
startTime
,
...
...
src/main/java/com/zzsn/event/controller/common/LLmConfigController.java
浏览文件 @
10470084
...
...
@@ -12,6 +12,7 @@ import com.zzsn.event.service.EventAnalysisVersionRecordService;
import
com.zzsn.event.service.EventLlmConfigService
;
import
com.zzsn.event.service.IEventService
;
import
com.zzsn.event.vo.EventLlmConfigModifyVO
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -98,7 +99,16 @@ public class LLmConfigController {
//调用大模型更细结果
//应对建议需要把 驱动因素和影响评估作为输入
specialProcess
(
content
,
versionId
,
columnCode
);
llmResult
=
analysisService
.
llmResult
(
eventId
,
content
.
toString
(),
null
,
null
,
columnCode
);
boolean
webSearch
=
true
;
if
(
Objects
.
equals
(
columnCode
,
AnalysisColumnEnum
.
ENTERPRISE_CASE
.
getCode
()))
{
//企业案例,需要传入资讯且补联网查询
webSearch
=
false
;
List
<
SpecialInformation
>
informationList
=
analysisService
.
modelAnalysisInformationList
(
eventId
,
eventName
);
if
(
CollectionUtils
.
isNotEmpty
(
informationList
))
{
content
.
append
(
"\n参考资讯:"
).
append
(
JSON
.
toJSONString
(
informationList
));
}
}
llmResult
=
analysisService
.
llmResult
(
eventId
,
content
.
toString
(),
webSearch
,
null
,
null
,
columnCode
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
analysisColumnEnum
.
getName
());
}
else
{
log
.
info
(
"未找到对应的事件栏目【{}】"
,
columnCode
);
...
...
src/main/java/com/zzsn/event/controller/yjzx/EventHomeController.java
浏览文件 @
10470084
...
...
@@ -186,7 +186,7 @@ public class EventHomeController {
"示例: \n"
+
"描述:苹果新款iPhone发布引发市场反响\n"
+
"输出:(苹果|iPhone)+(発売|価格|予約状況|市場シェア|消費者反応)"
;
String
result
=
llmService
.
model
(
null
,
null
,
prompt
,
networkName
);
String
result
=
llmService
.
model
(
null
,
null
,
true
,
prompt
,
networkName
);
if
(
result
.
startsWith
(
"```json"
))
{
result
=
result
.
substring
(
7
,
result
.
length
()
-
3
);
}
else
if
(
result
.
startsWith
(
"```"
))
{
...
...
src/main/java/com/zzsn/event/external/controller/ExternalController.java
浏览文件 @
10470084
...
...
@@ -247,7 +247,7 @@ public class ExternalController {
"示例:\n"
+
"输入: 特斯拉刹车失灵\n"
+
"输出: 该专题聚焦于特斯拉电动汽车系列车型涉及的刹车系统性能与安全问题。近年来,全球多地车主报告在驾驶过程中遭遇疑似刹车失灵或制动距离异常延长的案例,引发了消费者对车辆安全性的广泛担忧。事件导致了多起交通事故,并促使美国国家公路交通安全管理局等权威机构启动缺陷调查。专题将涵盖相关事故报告、技术分析、监管机构的调查进展、特斯拉官方的回应及后续软件更新措施,旨在全面审视此类事件的真实性与潜在技术根源。"
;
String
description
=
llmService
.
model
(
"qwen"
,
"qwen-max-latest"
,
prompt
,
remark
);
String
description
=
llmService
.
model
(
"qwen"
,
"qwen-max-latest"
,
true
,
prompt
,
remark
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"language"
,
language
);
resultMap
.
put
(
"model"
,
description
);
...
...
@@ -609,7 +609,7 @@ public class ExternalController {
"{\"subject\":\"机器学习可解释性\",\"summaryList\":[{\"summary\":\"提出梯度解释法...验证准确率提升15%\"},{\"summary\":\"对比LIME与SHAP...指出计算效率缺陷\"},{\"summary\":\"医疗领域应用研究...模型透明度不足影响临床采纳\"}]}\n"
+
"输出(示例段落):\n"
+
"多篇关于机器学习可解释性(XAI)的研究聚焦于提升复杂模型透明度。核心共识在于有效解释技术(如梯度解释法、LIME、SHAP)能增强用户信任并提升决策准确率。然而,在方法实用性上存在分歧,部分研究指出主流技术存在显著计算效率缺陷,尤其在资源受限场景;同时,医疗领域应用突显透明度不足是阻碍临床采纳的关键瓶颈。研究趋势显示从开发基础解释方法(如早期梯度法)转向评估实际场景效能及效率优化。当前主要知识缺口在于缺乏统一标准评估解释的可靠性与临床相关性,亟需开发兼顾高效性和领域适配性的XAI解决方案。"
;
String
model
=
llmService
.
model
(
"qwen"
,
"qwen-max-latest"
,
prompt
,
JSONObject
.
toJSONString
(
params
));
String
model
=
llmService
.
model
(
"qwen"
,
"qwen-max-latest"
,
true
,
prompt
,
JSONObject
.
toJSONString
(
params
));
if
(
StringUtils
.
isNotBlank
(
model
))
{
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"idList"
,
idList
);
...
...
src/main/java/com/zzsn/event/llm/LlmService.java
浏览文件 @
10470084
...
...
@@ -12,11 +12,12 @@ public interface LlmService {
*
* @param modelType 模型类型
* @param modelName 模型名称
* @param webSearch 是否联网搜索
* @param system 提示词
* @param content 引用内容
* @return 大模型响应结果
*/
String
model
(
String
modelType
,
String
modelName
,
String
system
,
String
content
);
String
model
(
String
modelType
,
String
modelName
,
Boolean
webSearch
,
String
system
,
String
content
);
/**
* 千问模型调用
...
...
src/main/java/com/zzsn/event/llm/LlmServiceImpl.java
浏览文件 @
10470084
...
...
@@ -45,7 +45,7 @@ public class LlmServiceImpl implements LlmService {
private
LlmProperties
llmProperties
;
@Override
public
String
model
(
String
modelType
,
String
modelName
,
String
system
,
String
content
)
{
public
String
model
(
String
modelType
,
String
modelName
,
Boolean
webSearch
,
String
system
,
String
content
)
{
if
(
StringUtils
.
isEmpty
(
modelType
))
{
modelType
=
llmProperties
.
getDefaultModelType
();
}
...
...
@@ -54,7 +54,7 @@ public class LlmServiceImpl implements LlmService {
modelConfig
.
setDefaultModel
(
modelName
);
}
if
(
modelType
.
equalsIgnoreCase
(
"zhipu"
))
{
return
glmModel
(
modelConfig
,
system
,
content
);
return
glmModel
(
modelConfig
,
webSearch
,
system
,
content
);
}
else
if
(
modelType
.
equalsIgnoreCase
(
"qwen"
))
{
return
qwenModel
(
modelConfig
,
system
,
content
);
}
else
if
(
modelType
.
equalsIgnoreCase
(
"deepseek"
))
{
...
...
@@ -68,12 +68,13 @@ public class LlmServiceImpl implements LlmService {
/**
* glm模型调用
*
* @param modelConfig 模型配置信息
* @param system 提示词
* @param content 引用内容
* @param modelConfig 模型配置信息
* @param webSearchFlag 是否联网搜索
* @param system 提示词
* @param content 引用内容
* @return 大模型响应结果
*/
public
String
glmModel
(
LlmProperties
.
ModelConfig
modelConfig
,
String
system
,
String
content
)
{
public
String
glmModel
(
LlmProperties
.
ModelConfig
modelConfig
,
Boolean
webSearchFlag
,
String
system
,
String
content
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"model"
,
modelConfig
.
getDefaultModel
());
List
<
Map
<
String
,
Object
>>
messageList
=
new
ArrayList
<>();
...
...
@@ -90,8 +91,7 @@ public class LlmServiceImpl implements LlmService {
params
.
put
(
"top_p"
,
0.7
);
//params.put("temperature", 0.75);\
//是否开启联网搜索
Boolean
webSearchFlag
=
modelConfig
.
getWebSearch
();
if
(
webSearchFlag
!=
null
&&
webSearchFlag
)
{
if
(
webSearchFlag
)
{
Map
<
String
,
Object
>
webSearch
=
new
HashMap
<>();
webSearch
.
put
(
"enable"
,
true
);
webSearch
.
put
(
"search_result"
,
true
);
...
...
src/main/java/com/zzsn/event/service/AnalysisService.java
浏览文件 @
10470084
...
...
@@ -7,6 +7,8 @@ import com.zzsn.event.entity.Event;
import
com.zzsn.event.entity.EventLlmConfig
;
import
com.zzsn.event.entity.SubjectAnalysis
;
import
com.zzsn.event.vo.*
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
io.swagger.models.auth.In
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.LinkedHashMap
;
...
...
@@ -84,6 +86,8 @@ public interface AnalysisService {
* 利用大模型生成的结果
*
* @param event 事件信息
* @param content 输入内容
* @param webSearch 是否联网搜索
* @param startTime 开始时间
* @param endTime 结束时间
* @param llmConfig 模型配置信息
...
...
@@ -91,9 +95,9 @@ public interface AnalysisService {
* @author lkg
* @date 2025/7/17
*/
String
llmResult
(
EventVO
event
,
String
content
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
,
Map
<
Integer
,
String
>
extraContentParams
);
String
llmResult
(
EventVO
event
,
String
content
,
Boolean
webSearch
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
,
Map
<
Integer
,
String
>
extraContentParams
);
String
llmResult
(
String
eventId
,
String
content
,
String
startTime
,
String
endTime
,
Integer
columnCode
);
String
llmResult
(
String
eventId
,
String
content
,
Boolean
webSearch
,
String
startTime
,
String
endTime
,
Integer
columnCode
);
/**
* 重新生成
...
...
@@ -114,4 +118,14 @@ public interface AnalysisService {
* @date 2025/7/19
*/
String
exportPPT
(
String
eventId
,
String
versionId
,
JSONArray
content
);
/**
* 大模型分析(企业案例)时,需要传入资讯列表
*
* @param eventId 事件id
* @param eventName 事件名称
* @author lkg
* @date 2025/7/19
*/
List
<
SpecialInformation
>
modelAnalysisInformationList
(
String
eventId
,
String
eventName
);
}
src/main/java/com/zzsn/event/service/impl/AnalysisServiceImpl.java
浏览文件 @
10470084
...
...
@@ -15,9 +15,7 @@ import com.zzsn.event.enums.AnalysisColumnEnum;
import
com.zzsn.event.es.EsService
;
import
com.zzsn.event.llm.LlmService
;
import
com.zzsn.event.service.*
;
import
com.zzsn.event.util.DateUtil
;
import
com.zzsn.event.util.HotWordUtil
;
import
com.zzsn.event.util.ObsUtil
;
import
com.zzsn.event.util.*
;
import
com.zzsn.event.util.ppt.ApiAuthAlgorithm
;
import
com.zzsn.event.util.ppt.CreateResponse
;
import
com.zzsn.event.util.ppt.PPTUtil
;
...
...
@@ -66,6 +64,8 @@ public class AnalysisServiceImpl implements AnalysisService {
private
ObsUtil
obsUtil
;
@Autowired
private
EventLlmConfigService
eventLlmConfigService
;
@Autowired
private
PythonUtil
pythonUtil
;
/*
* 优先级:事件脉络 > 伪事件脉络 > 资讯
...
...
@@ -308,11 +308,11 @@ public class AnalysisServiceImpl implements AnalysisService {
}
@Override
public
String
llmResult
(
EventVO
event
,
String
content
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
,
Map
<
Integer
,
String
>
extraContentParams
)
{
public
String
llmResult
(
EventVO
event
,
String
content
,
Boolean
webSearch
,
String
startTime
,
String
endTime
,
EventLlmConfig
llmConfig
,
Map
<
Integer
,
String
>
extraContentParams
)
{
if
(
llmConfig
==
null
)
{
return
null
;
}
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
null
,
llmConfig
.
getLlmPrompt
(),
content
);
String
result
=
llmService
.
model
(
llmConfig
.
getLlmName
(),
null
,
webSearch
,
llmConfig
.
getLlmPrompt
(),
content
);
AnalysisColumnEnum
analysisColumnEnum
=
AnalysisColumnEnum
.
getByCode
(
llmConfig
.
getColumnCode
());
String
startHeader
=
null
;
if
(
analysisColumnEnum
!=
null
)
{
...
...
@@ -350,7 +350,7 @@ public class AnalysisServiceImpl implements AnalysisService {
params
.
put
(
"keyIssue"
,
event
.
getKeyIssue
());
}
params
.
put
(
"impactOutline"
,
impact
);
String
impactDetail
=
llmService
.
model
(
detailConfig
.
getLlmName
(),
null
,
detailConfig
.
getLlmPrompt
(),
params
.
toJSONString
());
String
impactDetail
=
llmService
.
model
(
detailConfig
.
getLlmName
(),
null
,
false
,
detailConfig
.
getLlmPrompt
(),
params
.
toJSONString
());
impact
.
put
(
"impactDetail"
,
impactDetail
);
log
.
info
(
"{}-事件分析【{}-{}详情】重新生成逻辑完成。"
,
event
.
getEventName
(),
AnalysisColumnEnum
.
IMPACT_ASSESSMENT
.
getName
(),
impact
.
getString
(
"theme"
));
}
catch
(
Exception
e
)
{
...
...
@@ -367,10 +367,10 @@ public class AnalysisServiceImpl implements AnalysisService {
}
@Override
public
String
llmResult
(
String
eventId
,
String
content
,
String
startTime
,
String
endTime
,
Integer
columnCode
)
{
public
String
llmResult
(
String
eventId
,
String
content
,
Boolean
webSearch
,
String
startTime
,
String
endTime
,
Integer
columnCode
)
{
EventVO
event
=
eventService
.
queryInfo
(
eventId
);
EventLlmConfig
llmConfig
=
eventLlmConfigService
.
getConfig
(
eventId
,
columnCode
);
return
llmResult
(
event
,
content
,
startTime
,
endTime
,
llmConfig
,
null
);
return
llmResult
(
event
,
content
,
webSearch
,
startTime
,
endTime
,
llmConfig
,
null
);
}
@Override
...
...
@@ -432,7 +432,7 @@ public class AnalysisServiceImpl implements AnalysisService {
//历史核心摘要是否为空
boolean
empty
=
StringUtils
.
isEmpty
(
eventDescribe
);
EventLlmConfig
config
=
configList
.
stream
().
filter
(
e
->
e
.
getColumnCode
().
equals
(
AnalysisColumnEnum
.
CORE_SUMMARY
.
getCode
())).
findFirst
().
orElse
(
new
EventLlmConfig
());
eventDescribe
=
this
.
llmResult
(
event
,
content
,
null
,
null
,
config
,
null
);
eventDescribe
=
this
.
llmResult
(
event
,
content
,
false
,
null
,
null
,
config
,
null
);
if
(
empty
)
{
event
.
setEventDescribe
(
eventDescribe
);
LambdaUpdateWrapper
<
Event
>
update
=
Wrappers
.
lambdaUpdate
();
...
...
@@ -469,7 +469,15 @@ public class AnalysisServiceImpl implements AnalysisService {
content
+=
"\n驱动因素:"
+
extraContentParams
.
get
(
AnalysisColumnEnum
.
DRIVING_FACTORS
.
getCode
());
}
}
String
llmResult
=
this
.
llmResult
(
event
,
content
,
null
,
null
,
config
,
extraContentParams
);
boolean
webSearch
=
true
;
if
(
Objects
.
equals
(
columnCode
,
AnalysisColumnEnum
.
ENTERPRISE_CASE
.
getCode
()))
{
webSearch
=
false
;
List
<
SpecialInformation
>
informationList
=
modelAnalysisInformationList
(
eventId
,
eventName
);
if
(
CollectionUtils
.
isNotEmpty
(
informationList
))
{
content
+=
"\n参考资讯:"
+
JSON
.
toJSONString
(
informationList
);
}
}
String
llmResult
=
this
.
llmResult
(
event
,
content
,
webSearch
,
null
,
null
,
config
,
extraContentParams
);
eventAnalysisVersionRecordService
.
modify
(
versionId
,
analysisColumnEnum
,
llmResult
);
log
.
info
(
"{}-事件分析【{}】重新生成逻辑完成。"
,
eventName
,
config
.
getColumnName
());
}
catch
(
Exception
e
)
{
...
...
@@ -478,6 +486,95 @@ public class AnalysisServiceImpl implements AnalysisService {
}
}
@Override
public
List
<
SpecialInformation
>
modelAnalysisInformationList
(
String
eventId
,
String
eventName
)
{
List
<
SpecialInformation
>
informationList
=
enterpriseCaseDataList
(
eventId
);
if
(
CollectionUtils
.
isEmpty
(
informationList
))
{
informationList
=
webSearchCaseDataList
(
eventName
);
}
return
informationList
;
}
/**
* 事件下企业资讯列表
*
* @param eventId 事件id
* @author lkg
* @date 2025/9/19
*/
private
List
<
SpecialInformation
>
enterpriseCaseDataList
(
String
eventId
)
{
List
<
SpecialInformation
>
infoList
=
new
ArrayList
<>();
InfoDataSearchCondition
searchCondition
=
new
InfoDataSearchCondition
();
String
[]
fetchFields
=
new
String
[]{
"id"
,
"title"
,
"content"
,
"origin"
};
searchCondition
.
setFetchFields
(
fetchFields
);
searchCondition
.
setSubjectId
(
eventId
);
searchCondition
.
setCategory
(
2
);
searchCondition
.
setComposeSearchLabelIds
(
"1947596156752150530"
);
searchCondition
.
setPageSize
(
50
);
for
(
int
i
=
1
;
;
i
++)
{
searchCondition
.
setPageNo
(
i
);
List
<
SpecialInformation
>
informationList
=
esService
.
informationList
(
searchCondition
);
log
.
info
(
"事件分析-企业案例获取资讯:本次循环-{},数据量为-{}"
,
i
,
informationList
.
size
());
if
(
CollectionUtils
.
isNotEmpty
(
informationList
))
{
List
<
SpecialInformation
>
caseFilterList
=
pythonUtil
.
enterpriseCaseFilter
(
informationList
);
if
(
CollectionUtils
.
isEmpty
(
caseFilterList
))
{
continue
;
}
infoList
.
addAll
(
caseFilterList
);
if
(
infoList
.
size
()
>=
20
)
{
log
.
info
(
"事件分析-企业案例获取资讯:企业案例资讯数据量为-{}"
,
infoList
.
size
());
break
;
}
if
(
informationList
.
size
()
<
50
)
{
break
;
}
}
else
{
break
;
}
}
return
infoList
;
}
/**
* 智谱接口-联网获取资讯
*
* 事件下企业资讯为空时,使用此接口获取数据
*
*
* @param eventName 事件标题
* @author lkg
* @date 2025/9/19
*/
private
List
<
SpecialInformation
>
webSearchCaseDataList
(
String
eventName
)
{
List
<
SpecialInformation
>
infoList
=
new
ArrayList
<>();
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Authorization"
,
"c5a53bd5f95a4e37a8997deb5d0c6031.orXyRRPNvZiqRaxF"
);
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"search_query"
,
eventName
);
params
.
put
(
"search_engine"
,
"search_std"
);
params
.
put
(
"search_intent"
,
true
);
try
{
String
response
=
HttpUtil
.
doPostWithHeader
(
"https://open.bigmodel.cn/api/paas/v4/web_search"
,
params
,
30000
,
headers
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
String
dataListStr
=
jsonObject
.
getString
(
"search_result"
);
List
<
JSONObject
>
jsonObjects
=
JSON
.
parseArray
(
dataListStr
,
JSONObject
.
class
);
for
(
JSONObject
data
:
jsonObjects
)
{
SpecialInformation
info
=
new
SpecialInformation
();
info
.
setId
(
data
.
getString
(
"refer"
));
info
.
setTitle
(
data
.
getString
(
"title"
));
info
.
setContent
(
data
.
getString
(
"content"
));
info
.
setOrigin
(
data
.
getString
(
"media"
));
info
.
setSourceAddress
(
data
.
getString
(
"link"
));
info
.
setPublishDate
(
data
.
getString
(
"publish_date"
));
infoList
.
add
(
info
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
infoList
;
}
@Override
public
String
exportPPT
(
String
eventId
,
String
versionId
,
JSONArray
content
)
{
...
...
src/main/java/com/zzsn/event/task/NetWorkEventTask.java
浏览文件 @
10470084
...
...
@@ -70,7 +70,7 @@ public class NetWorkEventTask {
public
void
test
(
Integer
type
)
{
List
<
EventNetwork
>
networkList
=
getNetWordEventList
(
type
);
String
response
=
llmService
.
model
(
null
,
null
,
PROMPT
,
JSONObject
.
toJSONString
(
networkList
));
String
response
=
llmService
.
model
(
null
,
null
,
true
,
PROMPT
,
JSONObject
.
toJSONString
(
networkList
));
if
(
response
.
contains
(
"```json"
))
{
response
=
response
.
substring
(
response
.
indexOf
(
"```json"
)
+
7
,
response
.
lastIndexOf
(
"```"
));
}
...
...
@@ -108,7 +108,7 @@ public class NetWorkEventTask {
}
if
(
CollectionUtils
.
isNotEmpty
(
finalList
))
{
finalList
.
forEach
(
network
->
network
.
setLatest
(
1
));
String
response
=
llmService
.
model
(
null
,
null
,
PROMPT
,
JSONObject
.
toJSONString
(
finalList
));
String
response
=
llmService
.
model
(
null
,
null
,
true
,
PROMPT
,
JSONObject
.
toJSONString
(
finalList
));
if
(
StringUtils
.
isNotEmpty
(
response
))
{
try
{
if
(
response
.
contains
(
"```json"
))
{
...
...
src/main/java/com/zzsn/event/util/PythonUtil.java
浏览文件 @
10470084
...
...
@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSON;
import
com.alibaba.fastjson2.JSONArray
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.zzsn.event.vo.es.SpecialInformation
;
import
com.zzsn.event.vo.log.Source
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论