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.userId === userId) {
|
||||
activeSession.lastActive = Date.now();
|
||||
return activeSession;
|
||||
}
|
||||
if (!e?.isMaster) {
|
||||
logger.info(`[crystelf-ai] 群${groupId}存在活跃session(${activeSession.userId}),拒绝${userId}创建新会话`);
|
||||
return null;
|
||||
|
||||
@ -43,10 +43,10 @@ class OpenaiChat {
|
||||
];
|
||||
|
||||
try {
|
||||
logger.info("[DEBUG] 请求体:", {
|
||||
model: model,
|
||||
messages,
|
||||
});
|
||||
//logger.info("[DEBUG] 请求体:", {
|
||||
//model: model,
|
||||
//messages,
|
||||
//});
|
||||
|
||||
const completion = await this.openai.chat.completions.create({
|
||||
messages: messages,
|
||||
@ -59,7 +59,7 @@ class OpenaiChat {
|
||||
});
|
||||
|
||||
const aiResponse = completion.choices[0].message.content;
|
||||
logger.info(aiResponse);
|
||||
//logger.info(aiResponse);
|
||||
return {
|
||||
success: true,
|
||||
aiResponse: aiResponse,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user