Skip to content

Commit

Permalink
Merge pull request #9 from bytemate/feat/add-user-data
Browse files Browse the repository at this point in the history
Feat/add user data
  • Loading branch information
fuergaosi233 authored Jan 21, 2023
2 parents b444dcd + bcab6b0 commit 347b6e1
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 11 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ CAPTCHA_TOKEN=
NOPECHA_KEY=
EXECUTABLE_PATH=
PROXY_SERVER=
USER_DATA_DIR=
142 changes: 132 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"async-retry": "^1.3.3",
"bcrypt": "5.0.1",
"cache-manager": "^5.1.4",
"chatgpt": "^3.4.2",
"chatgpt": "^3.5.0",
"class-transformer": "0.5.1",
"class-validator": "0.13.2",
"graphql": "16.5.0",
Expand Down
3 changes: 3 additions & 0 deletions src/chatgpt/chatgpt-pool/chatgpt-pool.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class ChatgptPoolService {
const chatgpt = new ChatGPTAPIBrowser({
...opts,
...this.chatgptConfig,
userDataDir: this.chatgptConfig.userDataDir
? `${this.chatgptConfig.userDataDir}/${opts.email}`
: undefined,
});
await retry(
async (_: any, num: number) => {
Expand Down
1 change: 1 addition & 0 deletions src/configs/config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export interface ChatgptConfig {
nopechaKey?: string;
executablePath?: string;
proxyServer?: string;
userDataDir?: string;
}
1 change: 1 addition & 0 deletions src/configs/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const config: Config = {
nopechaKey: process.env.NOPECHA_KEY,
executablePath: process.env.EXECUTABLE_PATH || undefined,
proxyServer: process.env.PROXY_SERVER || undefined,
userDataDir: process.env.USER_DATA_DIR || undefined,
},
};

Expand Down

0 comments on commit 347b6e1

Please sign in to comment.