mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-12-05 15:41:56 +00:00
Compare commits
No commits in common. "fa0f3ceb4e0f6c03b6f88d5d663784a6e55ad392" and "e2255e69013beeb486304a31c4dad94877918ea0" have entirely different histories.
fa0f3ceb4e
...
e2255e6901
@ -104,7 +104,6 @@ async function index(e) {
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`[crystelf-ai] 处理消息失败: ${error.message}`);
|
||||
const adapter = await YunzaiUtils.getAdapter(e);
|
||||
await Message.emojiLike(e, e.message_id, 10060, e.group_id, adapter);
|
||||
const config = await ConfigControl.get();
|
||||
const aiConfig = config?.ai;
|
||||
@ -259,7 +258,6 @@ async function callAiForResponse(userMessage, e, aiConfig) {
|
||||
logger.info(
|
||||
`[crystelf-ai] 群${e.group_id} , 用户${e.user_id}无法创建session,请检查是否聊天频繁`
|
||||
);
|
||||
const adapter = await YunzaiUtils.getAdapter(e);
|
||||
await Message.emojiLike(e, e.message_id, 128166, e.group_id, adapter);
|
||||
return null;
|
||||
}
|
||||
@ -296,7 +294,6 @@ async function callAiForResponse(userMessage, e, aiConfig) {
|
||||
SessionManager.deactivateSession(e.group_id, e.user_id);
|
||||
return processedResponse;
|
||||
} catch (error) {
|
||||
const adapter = await YunzaiUtils.getAdapter(e);
|
||||
await Message.emojiLike(e, e.message_id, 10060, e.group_id, adapter);
|
||||
logger.error(`[crystelf-ai] AI调用失败: ${error.message}`);
|
||||
SessionManager.deactivateSession(e.group_id, e.user_id);
|
||||
|
||||
@ -48,7 +48,7 @@ export const RESPONSE_FORMAT = `请严格按照以下格式按顺序返回你的
|
||||
- file: 发送文件(需要提供data和filename),如果你需要发一个很长的文本,请使用file发送
|
||||
|
||||
重要规则:
|
||||
1. 必须返回JSON数组格式,一定要是数组!无论有多少条消息,一条消息也要是数组!
|
||||
1. 必须返回JSON数组格式
|
||||
2. 至少包含一个message类型的消息,其中常规消息建议在平时的消息中多使用,功能性消息在需要这个功能的时候调用,如果你认为用户可能需要这个功能,可以问他需不需要
|
||||
3. 如果需要存储记忆,请使用memory类型
|
||||
4. recall参数最大为120秒
|
||||
|
||||
@ -53,8 +53,8 @@ class ResponseHandler {
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: true,
|
||||
messages: [parsed]//处理模型降智返回对象的情况
|
||||
success: false,
|
||||
error: '响应格式不是数组'
|
||||
};
|
||||
}
|
||||
} 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user