Skip to content

Commit

Permalink
✨ Fix conversation will lost and account not log
Browse files Browse the repository at this point in the history
  • Loading branch information
fuergaosi233 committed Dec 8, 2022
1 parent 069c7a8 commit 89f5a31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chatgpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ export class ChatGPTPoole {
}
const chatGPT = this.chatGPTAPI;
const conversation = chatGPT.chatGpt.getConversation();
return {
const conversationItem = {
conversation,
account: chatGPT.account,
};
this.conversationsPool.set(talkid, conversationItem);
return conversationItem;
}
// send message with talkid
async sendMessage(message: string, talkid: string) {
Expand All @@ -98,7 +100,7 @@ export class ChatGPTPoole {
return response;
} catch (err: any) {
console.error(
`err is ${err.message}, account ${JSON.stringify(err.account)}`
`err is ${err.message}, account ${JSON.stringify(account)}`
);
// If send message failed, we will remove the conversation from pool
this.conversationsPool.delete(talkid);
Expand Down

0 comments on commit 89f5a31

Please sign in to comment.