>
}
- contentClassName="text-md relative flex flex-col gap-2 p-2 leading-relaxed"
>
Get your own OpenAI API key{" "}
@@ -213,56 +212,58 @@ export const SettingsDialog: React.FC<{
)}
-
-
-
{`${t("API_KEY", {
- ns: "settings",
- })}`}
- >
- }
- placeholder={"sk-..."}
- type="password"
- value={settings.customApiKey}
- onChange={(e) => updateSettings("customApiKey", e.target.value)}
- />
-
-
-
-
{`${t("LABEL_MODEL", {
- ns: "settings",
- })}`}
- >
- }
- type="combobox"
- value={settings.customModelName}
- onChange={() => null}
- setValue={(e) => updateSettings("customModelName", e)}
- attributes={{ options: GPT_MODEL_NAMES }}
- disabled={disabled}
- />
-
-
-
Mode:
- >
- }
- value={agentMode}
- disabled={agent !== null}
- onChange={() => null}
- setValue={updateAgentMode as (agentMode: string) => void}
- type="combobox"
- toolTipProperties={{
- message: `${AUTOMATIC_MODE} (Default): Agent automatically executes every task. \n\n${PAUSE_MODE}: Agent pauses after every set of task(s)`,
- disabled: false,
- }}
- attributes={{ options: [AUTOMATIC_MODE, PAUSE_MODE] }}
- />
-
+
+
+
+
{`${t("API_KEY", {
+ ns: "settings",
+ })}`}
+ >
+ }
+ placeholder={"sk-..."}
+ type="password"
+ value={settings.customApiKey}
+ onChange={(e) => updateSettings("customApiKey", e.target.value)}
+ />
+
+
+
+
{`${t("LABEL_MODEL", {
+ ns: "settings",
+ })}`}
+ >
+ }
+ type="combobox"
+ value={settings.customModelName}
+ onChange={() => null}
+ setValue={(e) => updateSettings("customModelName", e)}
+ attributes={{ options: GPT_MODEL_NAMES }}
+ disabled={disabled}
+ />
+
+
+
Mode:
+ >
+ }
+ value={agentMode}
+ disabled={agent !== null}
+ onChange={() => null}
+ setValue={updateAgentMode as (agentMode: string) => void}
+ type="combobox"
+ toolTipProperties={{
+ message: `${AUTOMATIC_MODE} (Default): Agent automatically executes every task. \n\n${PAUSE_MODE}: Agent pauses after every set of task(s)`,
+ disabled: false,
+ }}
+ attributes={{ options: [AUTOMATIC_MODE, PAUSE_MODE] }}
+ />
+
+
);
};
diff --git a/src/components/SignInDialog.tsx b/src/components/SignInDialog.tsx
new file mode 100644
index 0000000000..01c8df4040
--- /dev/null
+++ b/src/components/SignInDialog.tsx
@@ -0,0 +1,30 @@
+import React from "react";
+import Dialog from "./Dialog";
+import Button from "./Button";
+import { useAuth } from "../hooks/useAuth";
+
+export interface SignInDialogProps {
+ show: boolean;
+ close: () => void;
+}
+
+export const SignInDialog = ({ show, close }: SignInDialogProps) => {
+ const { signIn } = useAuth();
+
+ return (
+
+ );
+};
diff --git a/src/components/SorryDialog.tsx b/src/components/SorryDialog.tsx
new file mode 100644
index 0000000000..979676780d
--- /dev/null
+++ b/src/components/SorryDialog.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import Dialog from "./Dialog";
+
+export interface WebSearchDialogProps {
+ show: boolean;
+ close: () => void;
+}
+
+export const SorryDialog = ({ show, close }: WebSearchDialogProps) => {
+ return (
+
+ );
+};
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 479187a80f..b60a31fd7a 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -29,6 +29,8 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useSettings } from "../hooks/useSettings";
import { languages } from "../utils/languages";
import nextI18NextConfig from "../../next-i18next.config.js";
+import { SorryDialog } from "../components/SorryDialog";
+import { SignInDialog } from "../components/SignInDialog";
const Home: NextPage = () => {
const { i18n } = useTranslation();
@@ -53,6 +55,8 @@ const Home: NextPage = () => {
const [showHelpDialog, setShowHelpDialog] = React.useState(false);
const [showSettingsDialog, setShowSettingsDialog] = React.useState(false);
+ const [showSorryDialog, setShowSorryDialog] = React.useState(false);
+ const [showSignInDialog, setShowSignInDialog] = React.useState(false);
const [hasSaved, setHasSaved] = React.useState(false);
const agentUtils = useAgent();
@@ -98,6 +102,12 @@ const Home: NextPage = () => {
agent != null || isEmptyOrBlank(name) || isEmptyOrBlank(goalInput);
const handleNewGoal = () => {
+ // Do not force login locally for people that don't have auth setup
+ if (session === null && process.env.NODE_ENV === "production") {
+ setShowSignInDialog(true);
+ return;
+ }
+
const newAgent = new AutonomousAgent(
name.trim(),
goalInput.trim(),
@@ -187,6 +197,14 @@ const Home: NextPage = () => {
show={showSettingsDialog}
close={() => setShowSettingsDialog(false)}
/>
+
setShowSorryDialog(false)}
+ />
+ setShowSignInDialog(false)}
+ />
setShowHelpDialog(true)}
@@ -247,7 +265,8 @@ const Home: NextPage = () => {
: undefined
}
scrollToBottom
- // displaySettings (Disable web search)
+ displaySettings
+ openSorryDialog={() => setShowSorryDialog(true)}
/>
{tasks.length > 0 && }