diff --git a/src/components/ChatWindow.tsx b/src/components/ChatWindow.tsx
index 20ee176..00a610c 100644
--- a/src/components/ChatWindow.tsx
+++ b/src/components/ChatWindow.tsx
@@ -1,6 +1,5 @@
import cx from "classnames";
import type { ReactNode } from "react";
-import type { Message } from "../pages";
import React from "react";
interface ChatWindowProps {
@@ -46,5 +45,18 @@ const ChatMessage = ({ message }: { message: Message }) => {
);
};
+export interface Message {
+ type: "goal" | "thinking" | "task" | "action";
+ value: string;
+}
+
+export const CreateGoalMessage = (goal: string): Message => {
+ return { type: "goal", value: goal };
+};
+
+export const CreateTaskMessage = (task: string): Message => {
+ return { type: "task", value: task };
+};
+
export default ChatWindow;
export { ChatMessage };
diff --git a/src/layout/default.tsx b/src/layout/default.tsx
index 20fd747..4f5b17d 100644
--- a/src/layout/default.tsx
+++ b/src/layout/default.tsx
@@ -7,12 +7,23 @@ interface LayoutProps {
}
const DefaultLayout = (props: LayoutProps) => {
+ const description =
+ "Assemble, configure, and deploy autonomous AI Agents in your browser.";
return (
Agent-GPT
-
+
+
+
+
+
+
+
{props.children}
{/*
*/}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index b933962..c0c3dde 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -2,26 +2,18 @@ import { type NextPage } from "next";
import Badge from "../components/Badge";
import DefaultLayout from "../layout/default";
import React from "react";
-import ChatWindow, { ChatMessage } from "../components/ChatWindow";
+import type { Message } from "../components/ChatWindow";
+import ChatWindow, {
+ ChatMessage,
+ CreateGoalMessage,
+ CreateTaskMessage,
+} from "../components/ChatWindow";
import axios from "axios";
import Drawer from "../components/Drawer";
import Input from "../components/Input";
import Button from "../components/Button";
import { FaRobot, FaStar } from "react-icons/fa";
-export interface Message {
- type: "goal" | "thinking" | "task" | "action";
- value: string;
-}
-
-const GoalMessage = (goal: string) => {
- return { type: "goal", value: goal } as Message;
-};
-
-const TaskMessage = (task: string) => {
- return { type: "task", value: task } as Message;
-};
-
const Home: NextPage = () => {
const [loading, setLoading] = React.useState
(false);
const [name, setName] = React.useState("");
@@ -32,7 +24,7 @@ const Home: NextPage = () => {
const handleNewGoal = async () => {
setLoading(true);
setGoal(goalInput);
- setMessages([...messages, GoalMessage(goalInput)]);
+ setMessages([...messages, CreateGoalMessage(goalInput)]);
const res = await axios.post(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
@@ -42,7 +34,7 @@ const Home: NextPage = () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access
const tasks: string[] = JSON.parse(res.data.tasks);
- setMessages((prev) => [...prev, ...tasks.map(TaskMessage)]);
+ setMessages((prev) => [...prev, ...tasks.map(CreateTaskMessage)]);
setLoading(false);
};
@@ -62,13 +54,14 @@ const Home: NextPage = () => {
id="title"
className="flex flex-col items-center font-mono shadow-2xl"
>
-
+
Agent
GPT
Beta 🚀
-
- Autonomous AI Agents in your browser
+
+ Assemble, configure, and deploy autonomous AI Agents in your
+ browser.