mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-12-05 15:41:56 +00:00
feat:细节优化
This commit is contained in:
parent
e955f8499b
commit
7b5508b331
@ -40,10 +40,6 @@ class SessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (activeSession) {
|
if (activeSession) {
|
||||||
if (activeSession.userId === userId) {
|
|
||||||
activeSession.lastActive = Date.now();
|
|
||||||
return activeSession;
|
|
||||||
}
|
|
||||||
if (!e?.isMaster) {
|
if (!e?.isMaster) {
|
||||||
logger.info(`[crystelf-ai] 群${groupId}存在活跃session(${activeSession.userId}),拒绝${userId}创建新会话`);
|
logger.info(`[crystelf-ai] 群${groupId}存在活跃session(${activeSession.userId}),拒绝${userId}创建新会话`);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -43,10 +43,10 @@ class OpenaiChat {
|
|||||||
];
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info("[DEBUG] 请求体:", {
|
//logger.info("[DEBUG] 请求体:", {
|
||||||
model: model,
|
//model: model,
|
||||||
messages,
|
//messages,
|
||||||
});
|
//});
|
||||||
|
|
||||||
const completion = await this.openai.chat.completions.create({
|
const completion = await this.openai.chat.completions.create({
|
||||||
messages: messages,
|
messages: messages,
|
||||||
@ -59,7 +59,7 @@ class OpenaiChat {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const aiResponse = completion.choices[0].message.content;
|
const aiResponse = completion.choices[0].message.content;
|
||||||
logger.info(aiResponse);
|
//logger.info(aiResponse);
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
aiResponse: aiResponse,
|
aiResponse: aiResponse,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user