Skip to content

Commit 5bcb17c

Browse files
committed
Support google login
1 parent ecb16ad commit 5bcb17c

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

config.yaml.example

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
chatGPTAccountPool:
22
- email: email
33
password: password
4+
isGoogleLogin: false
45
chatPrivateTiggerKeyword: ""
56
openAIProxy: ""

src/chatgpt.ts

+12-13
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,19 @@ export class ChatGPTPool {
6363
this.conversationsPool.delete(talkid);
6464
}
6565
async startPools() {
66-
const chatGPTPools = await Promise.all(
67-
config.chatGPTAccountPool.map(async (account) => {
68-
const chatGpt = new ChatGPTAPIBrowser({
69-
...account,
70-
proxyServer: config.openAIProxy,
71-
});
72-
await chatGpt.initSession();
73-
return {
74-
chatGpt: chatGpt,
75-
account: account,
76-
};
77-
})
66+
this.chatGPTPools = await Promise.all(
67+
config.chatGPTAccountPool.map(async (account) => {
68+
const chatGpt = new ChatGPTAPIBrowser({
69+
...account,
70+
proxyServer: config.openAIProxy,
71+
});
72+
await chatGpt.initSession();
73+
return {
74+
chatGpt: chatGpt,
75+
account: account,
76+
};
77+
})
7878
);
79-
this.chatGPTPools = chatGPTPools;
8079
if (this.chatGPTPools.length === 0) {
8180
throw new Error("⚠️ No chatgpt account in pool");
8281
}

src/interface.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ChatGPTAPIBrowser } from "chatgpt";
22
export interface AccountWithUserInfo {
33
password: string;
44
email: string;
5+
isGoogleLogin: boolean;
56
}
67

78
// Account will be one in the session token or email and password

0 commit comments

Comments
 (0)