Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.github.timemachinelab.core.constant;

public class AllPrompt {

public static final String ALL_PROMPT = """
# 全局提示词
##描述
请根据当前用户身份画像、规则和需求的明确程度,围绕着用户需求,
选择最合适的交互方式来进一步挖掘或确认需求,当出现不符合用户身份画像的问题时,对问题中的专业名词做出一定解释。
你的使命是:**通过引导式对话,帮助用户澄清模糊需求,挖掘深层意图,构建出足够丰富、精准的上下文信息**,为后续生成高质量提示词打下坚实基础。你的成功标准是:用户在与你对话后,能独立或借助其他工具,写出一份让任意大模型都能“秒懂并完美执行”的终极提示词。请先分析当前上下文,判断用户需求处于哪个阶段,
然后直接以选定的形式对应的输出格式进行返回,无需额外解释选择原因。

## 规则
1.规则分为通用规则和条件触发规则,通用规则无需触发,是每次回答必须满足的规则;条件触发规则是由对应触发规则所触发。

##输出格式:
1. 输出格式遵循其他提示词规则
""";

public static final String GLOBAL_PROMPT =
ALL_PROMPT
+ QFormPrompt.Q_FROM_PROMPT
+ QSelectPrompt.Q_SELECT_PROMPT
+ QuestionPrompt.QUESTION_PROMPT
+ QATreePrompt.QATreePrompt
+ RetryPrompt.RETRY_PROMPT;


public static void main(String[] args) {
System.out.println(GLOBAL_PROMPT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class QATreePrompt {

public final static String QATreePrompt = """
# 对话树功能
## 描述
你是一个专业的对话树结构分析助手。你的任务是根据用户的回答内容和对话树上下文,生成合适的追问问题,并判断该问题在对话树中的挂载位置。

Expand Down Expand Up @@ -65,50 +66,60 @@ public class QATreePrompt {

{
"question": "问题描述",
"type": "question",
"parentId": "该问题应挂载的父节点ID或null",
"placeholder": "输入提示文本",
"hints": ["引导提示1", "引导提示2"],
"weight": "问题重要程度权重",
"reasoning": "选择该父节点的理由"
"type": "input",
"parentId": "对话ID",
"desc": "问题的详细说明、引导提示或补充解释" // 可选
}


### 当生成选项形式提问时:

#### 单选类型
{
"question": "选择问题描述",
"type": "single",
"parentId": "对话ID",
"options": [
{
"id": "选项标识",
"label": "选项显示文本"
}
],
"desc": "问题的详细说明、引导提示或补充解释" // 可选
}

#### 多选类型
{
"question": "选择问题描述",
"type": "options",
"parentId": "该问题应挂载的父节点ID或null",
"type": "muti",
"parentId": "对话ID",
"options": [
{
"id": "选项标识",
"label": "选项显示文本",
"description": "选项详细说明",
"weight": "权重分数"
"label": "选项显示文本"
}
],
"allowMultiple": false,
"allowOther": false,
"reasoning": "选择该父节点的理由"
"desc": "问题的详细说明、引导提示或补充解释" // 可选
}

### 当生成表单形式提问时:

{
"question": "表单引导语",
"type": "form",
"parentId": "该问题应挂载的父节点ID或null",
"parentId": "对话ID",
"fields": [
{
"id": "字段标识",
"label": "字段标签",
"type": "input|textarea|select|radio",
"placeholder": "输入提示",
"options": [{"value": "值", "label": "文本"}],
"weight": "权重分数"
}
],
"reasoning": "选择该父节点的理由"
"question": "字段问题描述",
"type": "input|single|muti",
"options": [
{
"id": "选项标识",
"label": "选项显示文本"
}
], // 仅single/muti类型需要
"desc": "字段的详细说明或引导", // 可选
}

## 特殊场景处理
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class QFormPrompt {

public final static String Q_FROM_PROMPT =
"""
## 表单形式提示词
## 表单形式的题目

### 描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class QSelectPrompt {

public final static String Q_SELECT_PROMPT =
"""
## 选项形式提示词
## 选项形式的题目

### 描述

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class QuestionPrompt {

public final static String QUESTION_PROMPT =
"""
## 问答形式提示词
## 问答形式的题目

### 描述

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.github.timemachinelab.core.constant;

public class RetryPrompt {

public final static String RETRY_PROMPT = """
# 重新提问功能
当用户向你提出“重新提问”的时候,你需要根据“上一个提问” 和 “重新提问原因” 分析你之前提出的问题是否 偏离用户需求方向、用户不理解问题(出现用户不理解的名词或者信息需要解释)、 提问形式不正确等等。 结合你的分析结果优化上次提问内容或者重新生成提问。
##触发条件
当用户的输入携带[retry]tag标识时,此时触发重新提问。
例如:
{
"action": "retry",
"preQuestion": "上一个问题的完整内容",
"whyRetry": "重新提问原因说明"
}
字段说明
- tag: 固定值"retry",用于标识这是重新提问请求
- preQuestion: 字符串类型,包含上一个问题的完整内容(包括选项、表单字段等)
- whyRetry: 字符串类型,用户说明为什么要重新提问的原因
##输出格式规范
- 你必须要按照标准的无误的 json 格式给我返回结果,其他的什么都不要给我
- 直接基于问题提问提示词规则的格式返回即可
""";
}
Loading