From a8100663b824d592fbc682aa738934805ae6594c Mon Sep 17 00:00:00 2001 From: Chris Van Pelt Date: Sat, 25 May 2024 12:23:16 -0700 Subject: [PATCH] Disable agent mode, add hack to strip api key --- frontend/src/api/openai.ts | 10 ++++++++-- frontend/src/components/Settings.tsx | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/api/openai.ts b/frontend/src/api/openai.ts index 0cb2a27..8d4bd53 100644 --- a/frontend/src/api/openai.ts +++ b/frontend/src/api/openai.ts @@ -5,8 +5,14 @@ function host() { const port = window.location.port ? `:${window.location.port}` : '' return `${protocol}//${hostname}${port}` } - -const openai = new OpenAI({ +/* I patched OpenAI here so that users can use basic auth behind a proxy if they want */ +class MyOpenAI extends OpenAI { + // eslint-disable-next-line class-methods-use-this, @typescript-eslint/class-methods-use-this, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars + protected override authHeaders(_opts: any) { + return {} + } +} +const openai = new MyOpenAI({ apiKey: 'sk-fake', baseURL: `${host()}/v1`, dangerouslyAllowBrowser: true diff --git a/frontend/src/components/Settings.tsx b/frontend/src/components/Settings.tsx index 1d4f2db..0bb3b11 100644 --- a/frontend/src/components/Settings.tsx +++ b/frontend/src/components/Settings.tsx @@ -158,12 +158,13 @@ export default function Settings({ trigger }: { trigger: JSX.Element }) { setBeastMode(checked)} />
- Agent mode makes multiple calls to an LLM with vision - capabilities. This will incur more usage / cost. + Coming soon! Agent mode will make multiple calls to an LLM with + vision capabilities to iterate on a design.