fix: 修正响应格式错误和默认错误消息

This commit is contained in:
Jerry 2025-10-28 21:26:34 +08:00
parent e2255e6901
commit 63b801730d
2 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@ export const RESPONSE_FORMAT = `请严格按照以下格式按顺序返回你的
- file: 发送文件需要提供data和filename,如果你需要发一个很长的文本,请使用file发送
重要规则
1. 必须返回JSON数组格式
1. 必须返回JSON数组格式,一定要是数组!无论有多少条消息,一条消息也要是数组!
2. 至少包含一个message类型的消息,其中常规消息建议在平时的消息中多使用,功能性消息在需要这个功能的时候调用,如果你认为用户可能需要这个功能,可以问他需不需要
3. 如果需要存储记忆,请使用memory类型
4. recall参数最大为120秒

View File

@ -53,8 +53,8 @@ class ResponseHandler {
};
} else {
return {
success: false,
error: '响应格式不是数组'
success: true,
messages: [parsed]//处理模型降智返回对象的情况
};
}
} catch (error) {
@ -173,7 +173,7 @@ class ResponseHandler {
createErrorResponse(error) {
return [{
type: 'message',
data: `抱歉,处理回复时出现了错误..`,
data: `真寻的服务器去火星开小差了..`,
at: false,
quote: true,
recall: 120
@ -183,7 +183,7 @@ class ResponseHandler {
createDefaultResponse() {
return [{
type: 'message',
data: '抱歉,我暂时无法理解你的意思,请重新表达一下~',
data: '真寻的服务器去火星开小差了..',
at: false,
quote: true,
recall: 120