diff --git a/src/components/modals/agent_modal.tsx b/src/components/modals/agent_modal.tsx
index 9363780..543055a 100644
--- a/src/components/modals/agent_modal.tsx
+++ b/src/components/modals/agent_modal.tsx
@@ -12,13 +12,11 @@ import {
TEModalHeader,
TEModalBody,
TEModalFooter,
- TEInput,
- TETextarea,
TESelect,
} from "tw-elements-react";
import TWFileInput from "../inputs/file";
import { selectTheme } from "@/data/consts";
-import { Button, Switch } from "@material-tailwind/react";
+import { Button, Input, Switch, Textarea } from "@material-tailwind/react";
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { DELETE_AGENT, UPDATE_AGENT } from "@/utils/graphql_queries";
@@ -174,9 +172,10 @@ export default function AgentModal(props: {
{isEdit && (
- {
setTempAgent((prevState) => ({
@@ -184,15 +183,17 @@ export default function AgentModal(props: {
role: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
)}
{isEdit ? (
-
{
setTempAgent((prevState) => ({
@@ -200,6 +201,7 @@ export default function AgentModal(props: {
goal: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
) : (
{agent?.goal}
@@ -208,8 +210,9 @@ export default function AgentModal(props: {
{isEdit ? (
- {
setTempAgent((prevState) => ({
@@ -296,6 +299,29 @@ export default function AgentModal(props: {
/>
)}
+
+
+ {isEdit ? (
+ {
+ setTempAgent((prevState) => ({
+ ...prevState!,
+ memory: !!event.target.value,
+ }));
+ }}
+ />
+ ) : (
+
+ )}
+
@@ -411,6 +437,7 @@ export default function AgentModal(props: {
handleUpdateAgent(tempAgent)
.then(() => {
setShowModal(false);
+ setEdit(false);
ReactSwal.fire({
title: "Updated",
text: "Agent updated successfully",
diff --git a/src/components/modals/mission_modal.tsx b/src/components/modals/mission_modal.tsx
index 43f89e7..7486bfc 100644
--- a/src/components/modals/mission_modal.tsx
+++ b/src/components/modals/mission_modal.tsx
@@ -10,14 +10,13 @@ import {
TEModalHeader,
TEModalBody,
TEModalFooter,
- TEInput,
TESelect,
} from "tw-elements-react";
import { Mission } from "@/types/mission";
import MissionTaskEditor from "../inputs/mission_tasks_editor";
import { TasksAccordion } from "../ui/tasks_accordions";
import { Process, selectTheme } from "@/data/consts";
-import { Alert, Button, Switch } from "@material-tailwind/react";
+import { Alert, Button, Input, Switch } from "@material-tailwind/react";
import { useMutation, useQuery } from "@apollo/client";
import {
DELETE_MISSION,
@@ -139,9 +138,10 @@ export default function MissionModal(props: {
{isEdit && (
- {
setTempMission((prevState) => ({
@@ -149,6 +149,7 @@ export default function MissionModal(props: {
name: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
)}
diff --git a/src/components/modals/new_agent_modal.tsx b/src/components/modals/new_agent_modal.tsx
index 0a4325f..d351bc2 100644
--- a/src/components/modals/new_agent_modal.tsx
+++ b/src/components/modals/new_agent_modal.tsx
@@ -4,7 +4,6 @@ import { Agent } from "@/types/agent";
import { Icon } from "@iconify/react/dist/iconify.js";
import React, { useState } from "react";
import {
- TEInput,
TEModal,
TEModalBody,
TEModalContent,
@@ -13,9 +12,8 @@ import {
TEModalHeader,
TERipple,
TESelect,
- TETextarea,
} from "tw-elements-react";
-import { Button, Switch } from "@material-tailwind/react";
+import { Button, Input, Switch, Textarea } from "@material-tailwind/react";
import { useMutation } from "@apollo/client";
import { CREATE_AGENT } from "@/utils/graphql_queries";
import withReactContent from "sweetalert2-react-content";
@@ -41,23 +39,6 @@ function NewAgentModal(props: {
verbose: false,
});
- const [selectedImage, setSelectedImage] = useState<
- string | ArrayBuffer | null
- >(null);
-
- const handleImageChange = (event: React.ChangeEvent
) => {
- const file = event?.target?.files?.[0];
- const reader = new FileReader();
-
- reader.onloadend = () => {
- setSelectedImage(reader.result);
- };
-
- if (file) {
- reader.readAsDataURL(file);
- }
- };
-
const [createAgent] = useMutation(CREATE_AGENT);
const [createAgentLoading, setCreateAgentLoading] = useState(false);
@@ -95,9 +76,10 @@ function NewAgentModal(props: {
- {
setTempAgent((prevState) => ({
@@ -105,13 +87,15 @@ function NewAgentModal(props: {
role: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
- {
setTempAgent((prevState) => ({
@@ -119,12 +103,15 @@ function NewAgentModal(props: {
goal: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
- {
setTempAgent((prevState) => ({
@@ -179,6 +166,20 @@ function NewAgentModal(props: {
}}
/>
+
+
+ {
+ setTempAgent((prevState) => ({
+ ...prevState!,
+ memory: !!event.target.value,
+ }));
+ }}
+ />
+
diff --git a/src/components/modals/new_mission_modal.tsx b/src/components/modals/new_mission_modal.tsx
index 901ddf5..2c92ffc 100644
--- a/src/components/modals/new_mission_modal.tsx
+++ b/src/components/modals/new_mission_modal.tsx
@@ -1,10 +1,9 @@
import { Process, selectTheme } from "@/data/consts";
import { Mission } from "@/types/mission";
import { Icon } from "@iconify/react/dist/iconify.js";
-import { Alert, Button, Switch } from "@material-tailwind/react";
+import { Alert, Button, Input, Switch } from "@material-tailwind/react";
import React, { useState } from "react";
import {
- TEInput,
TEModal,
TEModalBody,
TEModalContent,
@@ -14,7 +13,6 @@ import {
TERipple,
TESelect,
} from "tw-elements-react";
-import MissionTaskEditor from "../inputs/mission_tasks_editor";
import { useMutation, useQuery } from "@apollo/client";
import { CREATE_MISSION, GET_AGENTS } from "@/utils/graphql_queries";
import { Agent } from "@/types/agent";
@@ -87,9 +85,10 @@ function NewMissionModal(props: {
- {
setTempMission((prevState) => ({
@@ -97,6 +96,7 @@ function NewMissionModal(props: {
name: event.target.value,
}));
}}
+ crossOrigin={undefined}
/>
diff --git a/src/components/ui/tasks_accordions.tsx b/src/components/ui/tasks_accordions.tsx
index 034a16a..0d61bf6 100644
--- a/src/components/ui/tasks_accordions.tsx
+++ b/src/components/ui/tasks_accordions.tsx
@@ -3,6 +3,7 @@ import {
Accordion,
AccordionHeader,
AccordionBody,
+ Typography,
} from "@material-tailwind/react";
import { Task } from "@/types/task";
@@ -33,7 +34,19 @@ export function TasksAccordion({ tasks }: { tasks: Array }) {
{task.agent?.role ?? "No Agent"}
-
{task.description}
+
+
+ {task.description}
+
+
+
+
+ Expected Output
+
+
+ {task.expected_output}
+
+
))}
diff --git a/src/data/data.ts b/src/data/data.ts
index 9131f31..074c437 100644
--- a/src/data/data.ts
+++ b/src/data/data.ts
@@ -53,6 +53,7 @@ export const tools = [
{ text: "WIKIPEDIA", value: "WIKIPEDIA" },
{ text: "YAHOO_FINANCE", value: "YAHOO_FINANCE" },
{ text: "YUOUTUBE_SEARCH", value: "YUOUTUBE_SEARCH" },
+ { text: "CodeDocsSearchTool", value: "CodeDocsSearchTool" },
];
const game = `
@@ -74,9 +75,9 @@ export const missions: Array
= [
Instructions
------------
${game}
-
- Your Final answer must be the full python code, only the python code and nothing else.
`,
+ expected_output:
+ "Your Final answer must be the full python code, only the python code and nothing else.",
agent: agents[0],
},
{
@@ -91,9 +92,9 @@ export const missions: Array = [
Using the code you got, check for errors. Check for logic errors,
syntax errors, missing imports, variable declarations, mismatched brackets,
and security vulnerabilities.
-
- Your Final answer must be the full python code, only the python code and nothing else.
`,
+ expected_output:
+ "Your Final answer must be the full python code, only the python code and nothing else.",
agent: agents[1],
},
{
@@ -107,9 +108,9 @@ export const missions: Array = [
You will look over the code to insure that it is complete and
does the job that it is supposed to do.
-
- Your Final answer must be the full python code, only the python code and nothing else.
`,
+ expected_output:
+ "Your Final answer must be the full python code, only the python code and nothing else.",
agent: agents[2],
},
],
@@ -124,11 +125,13 @@ export const missions: Array = [
{
name: "Task1",
description: "description description description description",
+ expected_output: "Expected Output",
agent: agents[0],
},
{
name: "Task2",
description: "description description description description",
+ expected_output: "Expected Output",
},
],
verbose: true,
@@ -142,11 +145,13 @@ export const missions: Array = [
{
name: "Task1",
description: "description description description description",
+ expected_output: "Expected Output",
agent: agents[0],
},
{
name: "Task2",
description: "description description description description",
+ expected_output: "Expected Output",
},
],
verbose: true,
diff --git a/src/types/agent.ts b/src/types/agent.ts
index d263782..7ea6cb9 100644
--- a/src/types/agent.ts
+++ b/src/types/agent.ts
@@ -14,5 +14,6 @@ export type Agent = {
tools: Array;
allowDelegation: boolean;
verbose: boolean;
+ memory?: boolean;
image?: string | null;
};
diff --git a/src/types/task.ts b/src/types/task.ts
index e935efc..c0d37d6 100644
--- a/src/types/task.ts
+++ b/src/types/task.ts
@@ -9,5 +9,6 @@ export type TaskInput = {
export type Task = {
name: string;
description: string;
+ expected_output: string;
agent?: Agent | null;
};
diff --git a/src/utils/graphql_queries.ts b/src/utils/graphql_queries.ts
index d4f9a2f..e7c7704 100644
--- a/src/utils/graphql_queries.ts
+++ b/src/utils/graphql_queries.ts
@@ -10,6 +10,7 @@ export const GET_AGENTS = gql`
tools
allowDelegation
verbose
+ memory
image
}
}
@@ -25,6 +26,7 @@ export const GET_AGENT_BY_ID = gql`
tools
allowDelegation
verbose
+ memory
image
missions {
id
@@ -42,6 +44,7 @@ export const CREATE_AGENT = gql`
$tools: [AgentTool!]
$allowDelegation: Boolean!
$verbose: Boolean!
+ $memory: Boolean
) {
createAgent(
role: $role
@@ -50,6 +53,7 @@ export const CREATE_AGENT = gql`
tools: $tools
allowDelegation: $allowDelegation
verbose: $verbose
+ memory: $memory
) {
id
role
@@ -72,6 +76,7 @@ export const UPDATE_AGENT = gql`
$tools: [AgentTool!]
$allowDelegation: Boolean
$verbose: Boolean
+ $memory: Boolean
) {
updateAgent(
id: $id
@@ -81,6 +86,7 @@ export const UPDATE_AGENT = gql`
tools: $tools
allowDelegation: $allowDelegation
verbose: $verbose
+ memory: $memory
) {
id
role
@@ -89,6 +95,7 @@ export const UPDATE_AGENT = gql`
tools
allowDelegation
verbose
+ memory
image
}
}
@@ -115,11 +122,13 @@ export const GET_MISSIONS = gql`
tools
allowDelegation
verbose
+ memory
image
}
tasks {
name
description
+ expected_output
agent {
id
role
@@ -145,11 +154,13 @@ export const GET_MISSION_BY_ID = gql`
tools
allowDelegation
verbose
+ memory
image
}
tasks {
name
description
+ expected_output
agent {
id
role
@@ -166,14 +177,12 @@ export const CREATE_MISSION = gql`
mutation CreateMission(
$name: String!
$crew: [Int!]
- $tasks: [TaskInput!]
$verbose: Boolean
$process: MissionProcess
) {
createMission(
name: $name
crew: $crew
- tasks: $tasks
verbose: $verbose
process: $process
) {
@@ -187,11 +196,13 @@ export const CREATE_MISSION = gql`
tools
allowDelegation
verbose
+ memory
image
}
tasks {
name
description
+ expected_output
agent {
id
role
@@ -209,7 +220,7 @@ export const UPDATE_MISSION = gql`
$id: Int!
$name: String
$crew: [Int!]
- $tasks: [TaskInput!]
+ $tasks: [Task!]
$verbose: Boolean
$process: MissionProcess
) {
@@ -231,11 +242,13 @@ export const UPDATE_MISSION = gql`
tools
allowDelegation
verbose
+ memory
image
}
tasks {
name
description
+ expected_output
agent {
id
role