diff --git a/frontend/index.html b/frontend/index.html index c7b86f2..ca96426 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -23,13 +23,14 @@ + - + OpenUI by W&B diff --git a/frontend/package.json b/frontend/package.json index a6a741d..0091550 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,6 +35,7 @@ "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-slot": "^1.0.2", + "@radix-ui/react-switch": "^1.0.3", "@radix-ui/react-tooltip": "^1.0.7", "@tailwindcss/typography": "^0.5.13", "@tanstack/react-query": "^5.36.0", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index b2e812e..435782b 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: '@radix-ui/react-slot': specifier: ^1.0.2 version: 1.0.2(@types/react@18.3.2)(react@18.3.1) + '@radix-ui/react-switch': + specifier: ^1.0.3 + version: 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-tooltip': specifier: ^1.0.7 version: 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1709,6 +1712,19 @@ packages: '@types/react': optional: true + '@radix-ui/react-switch@1.0.3': + resolution: {integrity: sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@radix-ui/react-tooltip@1.0.7': resolution: {integrity: sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw==} peerDependencies: @@ -7946,6 +7962,22 @@ snapshots: optionalDependencies: '@types/react': 18.3.2 + '@radix-ui/react-switch@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@babel/runtime': 7.24.5 + '@radix-ui/primitive': 1.0.1 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.2)(react@18.3.1) + '@radix-ui/react-context': 1.0.1(@types/react@18.3.2)(react@18.3.1) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.2)(react@18.3.1) + '@radix-ui/react-use-previous': 1.0.1(@types/react@18.3.2)(react@18.3.1) + '@radix-ui/react-use-size': 1.0.1(@types/react@18.3.2)(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.2 + '@types/react-dom': 18.3.0 + '@radix-ui/react-tooltip@1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.24.5 diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json new file mode 100644 index 0000000..a6b9843 --- /dev/null +++ b/frontend/public/manifest.json @@ -0,0 +1,20 @@ +{ + "name": "OpenUI by Weights & Biases", + "short_name": "OpenUI", + "display": "standalone", + "background_color": "#000000", + "theme_color": "#12B5C7", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": "/ai?app=pwa" +} 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/FileUpload.tsx b/frontend/src/components/FileUpload.tsx index 3993ef1..26bfa89 100644 --- a/frontend/src/components/FileUpload.tsx +++ b/frontend/src/components/FileUpload.tsx @@ -86,7 +86,7 @@ export default function FileUpload({ htmlFor='file-input' className='relative mx-auto h-64 w-64 cursor-pointer rounded-lg bg-white p-4 text-center text-zinc-600 shadow-lg dark:bg-zinc-800' > -
+
Settings - Make changes to your settings or logout + Choose a different model, adjust settings, or logout
-
-