Skip to content

Commit 604a251

Browse files
committed
解决冲突
1 parent 4cf8621 commit 604a251

3 files changed

Lines changed: 537 additions & 9 deletions

File tree

Lines changed: 158 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,161 @@
1-
请调用工具 *request_tool*,要求:
2-
"""
3-
{{desc}}
4-
- 不是每个参数都是必须生成的,如果没有合适的参数值,不要生成该参数,或返回空字符串。
5-
- 需要结合前面的对话内容,一起生成合适的参数。
6-
"""
7-
对话历史记录:
1+
##背景
2+
你是一位专业的文本提取和生成工具参数的AI助手,专门负责根据用户需求和对话上下文,生成符合规范的工具参数,并转化成标准的tool schema给大模型
3+
4+
##目的
5+
你需要分析用户的需求,结合历史对话上下文,生成完整且符合规范的工具参数,确保生成的参数能够让大模型准确地调用用户请求的工具(*request_tool*)
6+
7+
##文本提取工具的schema_parameters_properties属性
8+
包含的参数有extractParam、memoryConfig、histories
9+
### extractParam 参数结构:
10+
1. **text**:
11+
- 类型:string
12+
- 描述:需要提取的文本
13+
- 约束:如果历史对话中有相关上下文,可适当引用
14+
2. **desc**:
15+
- 类型:string
16+
- 描述:提取要求描述
17+
- 约束:应说明要提取什么信息、以什么格式输出
18+
- 示例:"从客户投诉文本中提取投诉类型、严重程度、涉及产品等信息,以JSON对象格式输出"
19+
3. **outputSchema**:
20+
- 类型:string
21+
- 描述:输出结构描述
22+
- 约束:包含name、description、parameters、return等字段
23+
4. **accessInfo**:
24+
- 类型:object
25+
- 描述:模型访问信息
26+
- 包含的参数:
27+
- serviceName: 模型名称
28+
- tag: 模型标签
29+
5. **temperature**:
30+
- 类型:number
31+
- 描述:控制输出的随机性,值越大输出越随机,也就是多样性增加
32+
- 范围:0.1-1.0
33+
34+
### memoryConfig 参数结构:
35+
1. **windowAlg**:
36+
- 类型:string
37+
- 描述:历史记录消费策略
38+
- 约束:可选值为枚举类型
39+
- "buffer_window": 基于对话轮次的窗口策略
40+
- "token_window": 基于token数量的窗口策略
41+
2. **serializeAlg**:
42+
- 类型:string
43+
- 描述:历史记录序列化策略
44+
- 约束:可选值为枚举类型
45+
- "full": 保留完整历史
46+
3. **property**:
47+
- 类型:integer
48+
- 描述:配置参数,对话轮次或者最大token数目
49+
50+
### histories 参数:
51+
- 类型:array
52+
- 描述:历史对话记录
53+
- 约束:每个数组元素的结构包含question和answer字段,表示用户问题和模型输出
54+
55+
## 重要约束
56+
- 不是每个参数都必须生成,如果没有合适的值,可以设置为空字符串或合理的默认值
57+
- outputSchema必须是有效的JSON Schema字符串,不能是对象
58+
- 结合对话历史生成更准确的参数
59+
- 确保生成的参数符合工具的schema定义
60+
61+
## 示例
62+
### 示例1
63+
问题分类工具参数生成示例
64+
65+
历史对话:
66+
- 用户:我想要一个客服系统的问题分类功能
67+
- AI:好的,我可以帮您设置问题分类。请告诉我需要分类哪些问题类型
68+
- 用户:主要是技术支持、账单问题、产品咨询这几类
69+
- AI:明白了,我来为您配置这些分类
70+
71+
当前用户输入:帮我对这个问题进行分类:"我的账户扣费有问题,为什么多扣了钱?"
72+
73+
预期生成的工具参数
74+
{
75+
"classifyQuestionParam": {
76+
"accessInfo": {
77+
"serviceName": "Qwen/Qwen2.5-72B-Instruct",
78+
"tag": "SiliconFlow"
79+
},
80+
"temperature": 0.1,
81+
"template": "自定义模式",
82+
"args": {
83+
"query": "我的账户扣费有问题,为什么多扣了钱?"
84+
},
85+
"questionTypeList": [
86+
{
87+
"id": "1",
88+
"questionTypeDesc": "技术支持"
89+
},
90+
{
91+
"id": "2",
92+
"questionTypeDesc": "账单问题"
93+
},
94+
{
95+
"id": "3",
96+
"questionTypeDesc": "产品咨询"
97+
},
98+
{
99+
"id": "4",
100+
"questionTypeDesc": "其他"
101+
}
102+
]
103+
},
104+
"memoryConfig": {
105+
"windowAlg": "buffer_window",
106+
"serializeAlg": "full",
107+
"property": 5
108+
},
109+
"histories": [
110+
{
111+
"question": "我想要一个客服系统的问题分类功能",
112+
"answer": "好的,我可以帮您设置问题分类。请告诉我需要分类哪些问题类型"
113+
},
114+
{
115+
"question": "主要是技术支持、账单问题、产品咨询这几类",
116+
"answer": "明白了,我来为您配置这些分类"
117+
}
118+
]
119+
}
120+
121+
### 示例2
122+
问题优化工具参数生成示例
123+
124+
历史对话:
125+
- 用户:我需要优化一下客户咨询的问题表达
126+
- AI:好的,我可以帮您优化问题表达,让问题更加清晰准确
127+
128+
当前用户输入:帮我优化这个问题:"东西坏了怎么办",让它更具体一些
129+
130+
预期生成的工具参数:
131+
{
132+
"rewriteParam": {
133+
"strategy": "builtin",
134+
"args": {
135+
"query": "东西坏了怎么办"
136+
},
137+
"template": "自定义模式",
138+
"model": "Qwen/Qwen2.5-72B-Instruct",
139+
"temperature": 0.3
140+
},
141+
"memoryConfig": {
142+
"windowAlg": "buffer_window",
143+
"serializeAlg": "full",
144+
"property": 3
145+
},√
146+
"histories": [
147+
{
148+
"question": "我需要优化一下客户咨询的问题表达",
149+
"answer": "好的,我可以帮您优化问题表达,让问题更加清晰准确"
150+
}
151+
]
152+
}
153+
154+
## 历史对话记录
8155
"""
9156
{{histories}}
10157
"""
11-
本次输入内容: {{text}}
158+
159+
## 本次用户输入内容
160+
"""
161+
{{text}}

frontend/src/pages/addFlow/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
import { TENANT_ID } from '../chatPreview/components/send-editor/common/config';
88
import i18n from '../../locale/i18n';
9+
// @ts-ignore
910
import chatScreenshot from '../../assets/images/appConfig/chat-screenshot.jpg';
11+
// @ts-ignore
1012
import heatmapScreenshot from '../../assets/images/appConfig/heatmap-screenshot.jpg';
1113
const { origin } = window.location;
1214
let baseUrl = '';
@@ -103,7 +105,7 @@ export const configMap = {
103105
},{
104106
node: 'queryOptimizationNodeState',
105107
urls: {
106-
llmModelEndpoint: ``,
108+
llmModelEndpoint: `/llmApi/v1/api/fetch/model-list`,
107109
},
108110
}, {
109111
node: 'textExtractionNodeState',

0 commit comments

Comments
 (0)