Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sl-ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhouwei
sl-ai
Commits
7789b6b4
Commit
7789b6b4
authored
Jun 27, 2025
by
zhouwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周报新增标题prompt
parent
db01d74b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
35 deletions
+23
-35
AIServiceImpl.java
...a/com/nanyan/securitylink/service/impl/AIServiceImpl.java
+23
-35
No files found.
src/main/java/com/nanyan/securitylink/service/impl/AIServiceImpl.java
View file @
7789b6b4
...
@@ -444,46 +444,34 @@ public class AIServiceImpl implements AIService {
...
@@ -444,46 +444,34 @@ public class AIServiceImpl implements AIService {
@Override
@Override
public
AIResponse
<
JSONObject
>
extractUrgentNoticeWeekSummary
(
AIRequestDTO
aiRequestDTO
)
{
public
AIResponse
<
JSONObject
>
extractUrgentNoticeWeekSummary
(
AIRequestDTO
aiRequestDTO
)
{
ChatInputData
chatInputData
=
new
ChatInputData
();
ChatInputData
chatInputData
=
new
ChatInputData
();
String
systemPrompt
=
"\n"
+
String
systemPrompt
=
"```xml\n"
+
"\n"
+
"```xml\n"
+
"<instruction>\n"
+
"<instruction>\n"
+
" <instructions>\n"
+
" <instructions>\n"
+
" 根据文旅部或外交部发布的紧急通知信息,按以下步骤生成JSON格式输出:\n"
+
" 请严格遵循以下步骤处理文旅部/外交部发布的紧急通知信息并生成JSON格式输出:\n"
+
" 1. 标题生成:提取输入信息中的核心风险事件(如示威游行、自然灾害等),生成不超过15字的短语,字段命名为\"title\"\n"
+
" \n"
+
" 1. 标题生成:\n"
+
" - 提取输入信息中的核心风险事件(如示威游行、自然灾害等)\n"
+
" - 生成不超过20字的短语,多起同类事件需省略地域名称\n"
+
" - 使用\"title\"作为字段名称\n"
+
" \n"
+
" 2. 安全提示生成:\n"
+
" 2. 安全提示生成:\n"
+
" a. 以“Security Link在此提醒您”作为固定开头\n"
+
" a. 固定以\"Security Link在此提醒您\"开头\n"
+
" b. 识别风险事件在保险条款中的责任归属(如“除外责任”或“有限保障”)\n"
+
" b. 识别风险事件在保险条款中的责任类型:\n"
+
" c. 按句式组合:“[风险事件]常被列为[保险责任说明],因此[行动建议]”\n"
+
" - 社会动荡类事件标注\"除外责任\"\n"
+
" d. 行动建议需包含具体动词(如“避开”“携带”“联系”)\n"
+
" - 自然灾害类标注\"有限保障\"或具体条款名称\n"
+
" 3. 校验标准:\n"
+
" c. 按句式组合:\n"
+
" - 前半句结构:[风险事件]常被列为[保险责任说明]\n"
+
" - 后半句行动建议需包含具体动词,如\"避开\"\"携带\"\"联系\"\n"
+
" \n"
+
" 3. 内容校验:\n"
+
" - 全文字数严格控制在50-80字\n"
+
" - 全文字数严格控制在50-80字\n"
+
" - 禁止使用XML/HTML标签\n"
+
" - 禁止使用
任何
XML/HTML标签\n"
+
" - 风险描述必须与输入信息完全一致\n"
+
" - 风险描述必须与输入信息完全一致\n"
+
" - 必须包含“保险”关键词\n"
+
" - 必须包含\"保险\"关键词\n"
+
" - 语言风格正式且带警示语气\n"
+
" - 保持正式书面语体并带有警示语气\n"
+
" </instructions>\n"
+
" \n"
+
"\n"
+
" 最终输出应为标准JSON格式,不得包含注释或额外字段\n"
+
" <examples>\n"
+
" </instructions>"
;
" <example>\n"
+
" <input>外交部提醒:海地首都太子港发生武装暴乱,已造成30人死亡,当地保险公司暂停理赔服务</input>\n"
+
" <output>\n"
+
" {\n"
+
" \"title\": \"海地武装暴乱安全警示\",\n"
+
" \"summary\": \"Security Link在此提醒您,武装暴乱属于旅游保险除外责任,当地理赔服务已中断,请立即避开冲突区域并联系境外救援机构。\"\n"
+
" }\n"
+
" </output>\n"
+
" </example>\n"
+
"\n"
+
" <example>\n"
+
" <input>文旅部通告:冰岛雷克雅内斯半岛火山喷发预警,蓝色潟湖景区关闭,旅行险自然灾害条款生效</input>\n"
+
" <output>\n"
+
" {\n"
+
" \"title\": \"冰岛火山喷发预警\",\n"
+
" \"summary\": \"Security Link在此提醒您,火山喷发属保险自然灾害保障范围,请携带保单紧急撤离,避开熔岩流动区域并保持与保险公司24小时联络。\"\n"
+
" }\n"
+
" </output>\n"
+
" </example>"
;
buildChatInputData
(
chatInputData
,
aiRequestDTO
.
getInputs
().
getMsg_info
(),
systemPrompt
);
buildChatInputData
(
chatInputData
,
aiRequestDTO
.
getInputs
().
getMsg_info
(),
systemPrompt
);
String
apiKey
=
getModelApiKey
();
String
apiKey
=
getModelApiKey
();
ChatCompletionResponse
chatCompletionResponse
=
aiRequest
(
chatInputData
,
apiKey
);
ChatCompletionResponse
chatCompletionResponse
=
aiRequest
(
chatInputData
,
apiKey
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment