Skip to content

Commit

Permalink
Disable agent mode, add hack to strip api key
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpelt committed May 25, 2024
1 parent 336c46f commit a810066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions frontend/src/api/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@ export default function Settings({ trigger }: { trigger: JSX.Element }) {
<Switch
className='-zoom-1 col-span-1'
name='beast'
disabled
checked={beastMode}
onCheckedChange={checked => setBeastMode(checked)}
/>
<div className='-ml-15 col-span-5 text-xs italic'>
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.
</div>
</div>
<div className='mt-3 grid grid-cols-4 items-center gap-4'>
Expand Down

0 comments on commit a810066

Please sign in to comment.