Skip to content

Commit

Permalink
dangerouslyAllowBrowser: enable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vunb committed Dec 20, 2023
1 parent b8e31cb commit 1a40cc2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/chatgpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ export async function chatgpt(req: Request, ctx: Context) {
const apiKey = ctx.definitions.get('api-key')?.value as string;
const apiModel = ctx.definitions.get('api-model')?.value as string;
const apiStream = ctx.definitions.get('api-stream')?.value as string === 'true';
const dangerouslyAllowBrowser = ctx.definitions.get('api-browser')?.value as string !== 'false';
const messages = req.variables.messages as any[] || [];
const openai = new OpenAI({
apiKey,
dangerouslyAllowBrowser,
baseURL: baseURL || 'https://api.openai.vn/v1',
});

Expand Down

0 comments on commit 1a40cc2

Please sign in to comment.