diff --git a/gui/pages/Content/APM/ApmDashboard.js b/gui/pages/Content/APM/ApmDashboard.js index 8da446ab0..939d7f3b0 100644 --- a/gui/pages/Content/APM/ApmDashboard.js +++ b/gui/pages/Content/APM/ApmDashboard.js @@ -221,8 +221,9 @@ export default function ApmDashboard(key) { {toolsUsed.map((tool, index) => ( - - tool-icon + + tool-icon {tool.tool_name} {tool.unique_agents} @@ -248,14 +249,37 @@ export default function ApmDashboard(key) { Agent Name - Model arrow_down - Tokens Consumed arrow_down - Runs arrow_down + Model arrow_down + + Tokens Consumed arrow_down + + Runs arrow_down + Avg tokens per run arrow_down - Tools arrow_down - Calls arrow_down - Avg Run Time arrow_down + Tools arrow_down + + Calls arrow_down + + Avg Run Time arrow_down + diff --git a/gui/pages/Content/Agents/ActivityFeed.js b/gui/pages/Content/Agents/ActivityFeed.js index 8c8d83cc5..25258c7db 100644 --- a/gui/pages/Content/Agents/ActivityFeed.js +++ b/gui/pages/Content/Agents/ActivityFeed.js @@ -4,7 +4,7 @@ import {getExecutionFeeds, getDateTime} from "@/pages/api/DashboardService"; import Image from "next/image"; import {loadingTextEffect, formatTimeDifference} from "@/utils/utils"; import {EventBus} from "@/utils/eventBus"; -import { ClipLoader } from 'react-spinners'; +import {ClipLoader} from 'react-spinners'; export default function ActivityFeed({selectedRunId, selectedView, setFetchedData, agent}) { const [loadingText, setLoadingText] = useState("Thinking"); @@ -121,7 +121,8 @@ export default function ActivityFeed({selectedRunId, selectedView, setFetchedDat This agent is scheduled to start on {scheduleDate}, at {scheduleTime} :
- {feeds && feeds.map((f, index) => (
+ {feeds && feeds.map((f, index) => (
{f.role === 'user' &&
💁
} {f.role === 'system' &&
🛠️
} @@ -165,11 +166,19 @@ export default function ActivityFeed({selectedRunId, selectedView, setFetchedDat
} {feeds.length < 1 && !agent?.is_running && !agent?.is_scheduled ? - (isLoading ? + (isLoading ?
- -
- :
The Agent is not scheduled
): null + +
+ :
The Agent is not scheduled
) : null }
{feedContainerRef.current && feedContainerRef.current.scrollTop >= 1200 && diff --git a/gui/pages/Content/Agents/AgentCreate.js b/gui/pages/Content/Agents/AgentCreate.js index fa7d0d4fe..7913c9ce7 100644 --- a/gui/pages/Content/Agents/AgentCreate.js +++ b/gui/pages/Content/Agents/AgentCreate.js @@ -16,7 +16,7 @@ import { openNewTab, removeTab, setLocalStorageValue, - setLocalStorageArray, returnResourceIcon, getUserTimezone, createInternalId,preventDefault,excludedToolkits + setLocalStorageArray, returnResourceIcon, getUserTimezone, createInternalId, preventDefault, excludedToolkits } from "@/utils/utils"; import {EventBus} from "@/utils/eventBus"; import styles from "@/pages/Content/Agents/Agents.module.css"; @@ -146,7 +146,7 @@ export default function AgentCreate({ const models = response.data || []; const selected_model = localStorage.getItem("agent_model_" + String(internalId)) || ''; setModelsArray(models); - if(models.length > 0 && !selected_model) { + if (models.length > 0 && !selected_model) { setLocalStorageValue("agent_model_" + String(internalId), models[0], setModel); } else { setModel(selected_model); @@ -424,7 +424,7 @@ export default function AgentCreate({ return false; } - if(!modelsArray.includes(model)) { + if (!modelsArray.includes(model)) { toast.error("Your key does not have access to the selected model", {autoClose: 1800}); return false; } @@ -466,7 +466,7 @@ export default function AgentCreate({ "permission_type": permission_type, "LTM_DB": longTermMemory ? database : null, "user_timezone": getUserTimezone(), - "knowledge" : toolNames.includes('Knowledge Search') ? selectedKnowledgeId : null, + "knowledge": toolNames.includes('Knowledge Search') ? selectedKnowledgeId : null, }; const scheduleAgentData = { @@ -859,16 +859,23 @@ export default function AgentCreate({ style={{width: '100%', alignItems: 'flex-start'}}>
{toolNames && toolNames.length > 0 && toolNames.map((tool, index) => ( -
-
{tool}
-
close-icon removeTool(index)}/>
-
+
+
{tool}
+
close-icon removeTool(index)}/>
+
))} - setSearchValue(e.target.value)} - onFocus={() => {setToolkitDropdown(true);setShowPlaceholder(false);}} onBlur={() => {setShowPlaceholder(true);}} - onClick={(e) => e.stopPropagation()}/> - {toolNames && toolNames.length === 0 && showPlaceholder && searchValue.length ===0 &&
Select Tools
} + setSearchValue(e.target.value)} + onFocus={() => { + setToolkitDropdown(true); + setShowPlaceholder(false); + }} onBlur={() => { + setShowPlaceholder(true); + }} + onClick={(e) => e.stopPropagation()}/> + {toolNames && toolNames.length === 0 && showPlaceholder && searchValue.length === 0 && +
Select Tools
}
clearTools(e)} src='/images/clear_input.svg' @@ -1202,7 +1209,10 @@ export default function AgentCreate({ )}
- {createDropdown && (
{setCreateModal(true);setCreateDropdown(false);}}>Create & Schedule Run + {createDropdown && (
{ + setCreateModal(true); + setCreateDropdown(false); + }}>Create & Schedule Run
)}
diff --git a/gui/pages/Content/Agents/AgentSchedule.js b/gui/pages/Content/Agents/AgentSchedule.js index 574c0e6c7..e815ac3c2 100644 --- a/gui/pages/Content/Agents/AgentSchedule.js +++ b/gui/pages/Content/Agents/AgentSchedule.js @@ -9,7 +9,15 @@ import {agentScheduleComponent, createAndScheduleRun, updateSchedule} from "@/pa import {EventBus} from "@/utils/eventBus"; import moment from 'moment'; -export default function AgentSchedule({internalId, closeCreateModal, type, agentId, setCreateModal, setCreateEditModal, env}) { +export default function AgentSchedule({ + internalId, + closeCreateModal, + type, + agentId, + setCreateModal, + setCreateEditModal, + env + }) { const [isRecurring, setIsRecurring] = useState(false); const [timeDropdown, setTimeDropdown] = useState(false); const [expiryDropdown, setExpiryDropdown] = useState(false); diff --git a/gui/pages/Content/Agents/AgentTemplatesList.js b/gui/pages/Content/Agents/AgentTemplatesList.js index 905f28dff..0dedde4b2 100644 --- a/gui/pages/Content/Agents/AgentTemplatesList.js +++ b/gui/pages/Content/Agents/AgentTemplatesList.js @@ -116,7 +116,7 @@ export default function AgentTemplatesList({
: } + template={sendTemplate} env={env}/>}
) }; diff --git a/gui/pages/Content/Agents/AgentWorkspace.js b/gui/pages/Content/Agents/AgentWorkspace.js index 02016580c..ff2db7c12 100644 --- a/gui/pages/Content/Agents/AgentWorkspace.js +++ b/gui/pages/Content/Agents/AgentWorkspace.js @@ -374,9 +374,16 @@ export default function AgentWorkspace({env, agentId, agentName, selectedView, a
  • Stop Schedule
  • ) : (
    {agent && !agent?.is_running && !agent?.is_scheduled && -
  • {setDropdown(false);setCreateModal(true)}}>Schedule Run
  • } +
  • { + setDropdown(false); + setCreateModal(true) + }}>Schedule Run
  • }
    )} -
  • {setDropdown(false);setDeleteModal(true)}}>Delete Agent
  • +
  • { + setDropdown(false); + setDeleteModal(true) + }}>Delete Agent +
  • } @@ -384,7 +391,8 @@ export default function AgentWorkspace({env, agentId, agentName, selectedView, a setCreateModal(false)}/>} {createEditModal && - setCreateEditModal(false)}/>} {createStopModal && (
    diff --git a/gui/pages/Content/Agents/Details.js b/gui/pages/Content/Agents/Details.js index 0bbdb5db3..4ac348f79 100644 --- a/gui/pages/Content/Agents/Details.js +++ b/gui/pages/Content/Agents/Details.js @@ -11,6 +11,22 @@ export default function Details({agentDetails, runCount, goals, instructions, ag const [filteredInstructions, setFilteredInstructions] = useState(false); const [scheduleText, setScheduleText] = useState('Agent is not Scheduled'); + const info_text = { + marginLeft: '7px', + }; + + const info_text_secondary = { + marginLeft: '3px', + marginTop: '2px', + color: '#888888', + lineHeight: '13px', + fontSize: '11px' + }; + + const openToolkitTab = (toolId) => { + EventBus.emit('openToolkitTab', {toolId: toolId}); + } + useEffect(() => { setFilteredInstructions(instructions?.filter(instruction => instruction.trim() !== '')); }, [instructions]); @@ -46,22 +62,6 @@ export default function Details({agentDetails, runCount, goals, instructions, ag } }, [agentScheduleDetails]); - const info_text = { - marginLeft: '7px', - }; - - const info_text_secondary = { - marginLeft: '3px', - marginTop: '2px', - color: '#888888', - lineHeight: '13px', - fontSize: '11px' - }; - - const openToolkitTab = (toolId) => { - EventBus.emit('openToolkitTab', {toolId: toolId}); - } - return (<>
    {agentDetails?.name || ''}
    diff --git a/gui/pages/Content/Agents/ResourceList.js b/gui/pages/Content/Agents/ResourceList.js index 0207211ce..45e65f8e9 100644 --- a/gui/pages/Content/Agents/ResourceList.js +++ b/gui/pages/Content/Agents/ResourceList.js @@ -34,8 +34,8 @@ export default function ResourceList({files, channel, runs}) { ) return ( -
    - {channel === 'output' && (!isAnyFileWithAgentId || files.length <= 0 ? +
    + {channel === 'output' && (!isAnyFileWithAgentId || files.length <= 0 ?
    no-permissions No Output files! @@ -43,30 +43,30 @@ export default function ResourceList({files, channel, runs}) { :
    {filesByRun.map((filesRun, index) => ( -
    -
    setSelectedRunId(filesRun.run.id === selectedRunId ? null : filesRun.run.id)}> -
    - arrow - {filesRun.run.name} -
    bolt Run {filesByRun.length - index}
    -
    - download_icon downloadRunFiles(filesRun.run.id, filesRun.run.name)}/> -
    +
    +
    setSelectedRunId(filesRun.run.id === selectedRunId ? null : filesRun.run.id)}> +
    + arrow + {filesRun.run.name} +
    bolt Run {filesByRun.length - index}
    +
    + download_icon downloadRunFiles(filesRun.run.id, filesRun.run.name)}/> +
    - {selectedRunId === filesRun.run.id && ( -
    - {filesRun.files.map((file, index) => )} + {selectedRunId === filesRun.run.id && ( +
    + {filesRun.files.map((file, index) => )} +
    + )}
    - )} + ))}
    - ))} -
    )} {channel === 'input' && diff --git a/gui/pages/Content/Agents/ResourceManager.js b/gui/pages/Content/Agents/ResourceManager.js index f3acd2743..af60a61a7 100644 --- a/gui/pages/Content/Agents/ResourceManager.js +++ b/gui/pages/Content/Agents/ResourceManager.js @@ -16,7 +16,7 @@ export default function ResourceManager({agentId, runs}) { function handleFile(files) { if (files.length > 0) { - const sizeInMB = files[0].size / (1024*1024); + const sizeInMB = files[0].size / (1024 * 1024); if (sizeInMB > 5) { toast.error('File size should not exceed 5MB', {autoClose: 1800}); } else { diff --git a/gui/pages/Content/Knowledge/KnowledgeDetails.js b/gui/pages/Content/Knowledge/KnowledgeDetails.js index 1d45b5fb3..39d104c6f 100644 --- a/gui/pages/Content/Knowledge/KnowledgeDetails.js +++ b/gui/pages/Content/Knowledge/KnowledgeDetails.js @@ -32,12 +32,11 @@ export default function KnowledgeDetails({internalId, knowledgeId}) { deleteMarketplaceKnowledge(knowledgeName) .then((response) => { console.log(response) - if(response.data.success){ + if (response.data.success) { toast.success("Knowledge uninstalled successfully", {autoClose: 1800}); removeTab(knowledgeId, knowledgeName, "Knowledge", internalId); EventBus.emit('reFetchKnowledge', {}); - } - else{ + } else { toast.error("Unable to uninstall knowledge", {autoClose: 1800}); } }) @@ -49,12 +48,11 @@ export default function KnowledgeDetails({internalId, knowledgeId}) { deleteCustomKnowledge(knowledgeId) .then((response) => { console.log(response) - if(response.data.success) { + if (response.data.success) { toast.success("Knowledge uninstalled successfully", {autoClose: 1800}); removeTab(knowledgeId, knowledgeName, "Knowledge", internalId); EventBus.emit('reFetchKnowledge', {}); - } - else { + } else { toast.error("Unable to uninstall knowledge", {autoClose: 1800}); } }) diff --git a/gui/pages/Content/Marketplace/KnowledgeTemplate.js b/gui/pages/Content/Marketplace/KnowledgeTemplate.js index f0b9cf5c4..4f9fd2998 100644 --- a/gui/pages/Content/Marketplace/KnowledgeTemplate.js +++ b/gui/pages/Content/Marketplace/KnowledgeTemplate.js @@ -110,12 +110,11 @@ export default function KnowledgeTemplate({template, env}) { installKnowledgeTemplate(template.name, indexId) .then((response) => { - if(response.data.success) { + if (response.data.success) { toast.success("Knowledge installed", {autoClose: 1800}); setInstalled('Installed'); EventBus.emit('reFetchKnowledge', {}); - } - else { + } else { toast.error("Error installing Knowledge: ", {autoClose: 1800}); setInstalled('Install'); } @@ -133,11 +132,10 @@ export default function KnowledgeTemplate({template, env}) { const uninstallKnowledge = () => { deleteMarketplaceKnowledge(template.name) .then((response) => { - if(response.data.success) { + if (response.data.success) { toast.success("Knowledge uninstalled successfully", {autoClose: 1800}); handleBackClick() - } - else { + } else { toast.error("Unable to uninstall knowledge", {autoClose: 1800}); } }) @@ -177,12 +175,14 @@ export default function KnowledgeTemplate({template, env}) { by {templateData?.contributed_by} {'\u00B7'} upload-icon {'\u00B7'} {templateData?.install_number || 0} + alt="upload-icon" + style={{marginBottom: '1px'}}/> {'\u00B7'} {templateData?.install_number || 0} {!template?.is_installed &&
    setIndexDropdown(!indexDropdown)} style={{marginTop: '15px', cursor: 'pointer', width: '100%'}}> - upload-icon {installed}{installed === 'Installing' && } + upload-icon  + {installed}{installed === 'Installing' && }
    {indexDropdown && installed === 'Install' && diff --git a/gui/pages/Content/Marketplace/MarketKnowledge.js b/gui/pages/Content/Marketplace/MarketKnowledge.js index a1cf2c9d3..31ba5cc51 100644 --- a/gui/pages/Content/Marketplace/MarketKnowledge.js +++ b/gui/pages/Content/Marketplace/MarketKnowledge.js @@ -50,16 +50,24 @@ export default function MarketKnowledge() {
    {!isLoading ?
    {knowledgeTemplates.length > 0 ?
    {knowledgeTemplates.map((item, index) => ( -
    handleTemplateClick(item)}>
    {/*tool-icon*/} -
    +
    {item.name} - {item.is_installed &&
    {'\u2713'} Installed
    } + {item.is_installed && +
    {'\u2713'} Installed
    } +
    +
    by {item.contributed_by} {'\u00B7'} upload-icon {item.install_number}
    -
    by {item.contributed_by} {'\u00B7'} upload-icon {item.install_number}
    {item.description}
    diff --git a/gui/pages/Content/Toolkits/ToolkitWorkspace.js b/gui/pages/Content/Toolkits/ToolkitWorkspace.js index 47cbcbaf2..048b6b331 100644 --- a/gui/pages/Content/Toolkits/ToolkitWorkspace.js +++ b/gui/pages/Content/Toolkits/ToolkitWorkspace.js @@ -26,10 +26,9 @@ export default function ToolkitWorkspace({env, toolkitDetails, internalId}) { function getGoogleToken(client_data) { var redirect_uri = ""; - if (env == "PROD"){ + if (env == "PROD") { redirect_uri = 'https://app.superagi.com/api/google/oauth-tokens'; - } - else { + } else { redirect_uri = "http://localhost:3000/api/google/oauth-tokens"; } const client_id = client_data.client_id diff --git a/gui/pages/Dashboard/Content.js b/gui/pages/Dashboard/Content.js index 403550ebe..633e3889b 100644 --- a/gui/pages/Dashboard/Content.js +++ b/gui/pages/Dashboard/Content.js @@ -56,7 +56,7 @@ export default function Content({env, selectedView, selectedProjectId, organisat const response = await getAgents(selectedProjectId); const data = response.data || []; const updatedData = data.map(item => { - return { ...item, contentType: "Agents" }; + return {...item, contentType: "Agents"}; }); setAgents(updatedData); } catch (error) { @@ -79,7 +79,7 @@ export default function Content({env, selectedView, selectedProjectId, organisat const response = await getToolKit(); const data = response.data || []; const updatedData = data.map(item => { - return { ...item, contentType: "Toolkits", isOpen: false, internalId: createInternalId() }; + return {...item, contentType: "Toolkits", isOpen: false, internalId: createInternalId()}; }); setToolkits(updatedData); } catch (error) { @@ -102,7 +102,7 @@ export default function Content({env, selectedView, selectedProjectId, organisat const response = await getKnowledge(); const data = response.data || []; const updatedData = data.map(item => { - return { ...item, contentType: "Knowledge", internalId: createInternalId() }; + return {...item, contentType: "Knowledge", internalId: createInternalId()}; }); setKnowledge(updatedData); } catch (error) { @@ -414,10 +414,12 @@ export default function Content({env, selectedView, selectedProjectId, organisat
    {selectedTab === index &&
    {tab.contentType === 'Agents' && - } {tab.contentType === 'Toolkits' && - } + } {tab.contentType === 'Knowledge' && } {tab.contentType === 'Database' && diff --git a/gui/pages/Dashboard/Settings/AddDatabase.js b/gui/pages/Dashboard/Settings/AddDatabase.js index 4d21c272f..6ba9f1519 100644 --- a/gui/pages/Dashboard/Settings/AddDatabase.js +++ b/gui/pages/Dashboard/Settings/AddDatabase.js @@ -168,7 +168,7 @@ export default function AddDatabase({internalId, sendDatabaseDetailsData}) { connectPinecone(pineconeData) .then((response) => { - connectResponse(response.data); + connectResponse(response.data); }) .catch((error) => { toast.error("Unable to connect database", {autoClose: 1800}); @@ -205,8 +205,8 @@ export default function AddDatabase({internalId, sendDatabaseDetailsData}) { connectQdrant(qdrantData) .then((response) => { - connectResponse(response.data); - }) + connectResponse(response.data); + }) .catch((error) => { toast.error("Unable to connect database", {autoClose: 1800}); console.error('Error fetching vector databases:', error); diff --git a/gui/pages/Dashboard/Settings/Database.js b/gui/pages/Dashboard/Settings/Database.js index d0f4b8b71..e3e4cae3f 100644 --- a/gui/pages/Dashboard/Settings/Database.js +++ b/gui/pages/Dashboard/Settings/Database.js @@ -2,7 +2,7 @@ import React, {useState, useEffect} from 'react'; import {ToastContainer, toast} from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import agentStyles from "@/pages/Content/Agents/Agents.module.css"; -import {createInternalId, formatTimeDifference, loadingTextEffect} from "@/utils/utils"; +import {createInternalId, formatTimeDifference, loadingTextEffect, preventDefault} from "@/utils/utils"; import styles from "@/pages/Content/Marketplace/Market.module.css"; import knowledgeStyles from "@/pages/Content/Knowledge/Knowledge.module.css"; import Image from "next/image"; @@ -16,10 +16,6 @@ export default function Database({sendDatabaseData}) { const [deleteModal, setDeleteModal] = useState(false); const [selectedDatabase, setSelectedDatabase] = useState(null); - const preventDefault = (e) => { - e.stopPropagation(); - }; - function fetchDatabases() { setIsLoading(true); @@ -168,7 +164,8 @@ export default function Database({sendDatabaseData}) {
    Delete {selectedDatabase.name}
    - +