From ce989b1bf785fc2d043c4f04750d747864877e44 Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav Date: Tue, 3 Jun 2025 10:46:25 +0530 Subject: [PATCH] remove providers from filter list and add support of ai blocks in search list] --- .../block-menu/block-menu-provider.tsx | 1 - .../search-and-filter/FiltersList.tsx | 1 - .../search-and-filter/SearchList.tsx | 20 ++++++++++++++++++- autogpt_platform/frontend/src/lib/utils.ts | 5 +++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/autogpt_platform/frontend/src/components/builder/block-menu/block-menu-provider.tsx b/autogpt_platform/frontend/src/components/builder/block-menu/block-menu-provider.tsx index 9f68159623..f103c3bde5 100644 --- a/autogpt_platform/frontend/src/components/builder/block-menu/block-menu-provider.tsx +++ b/autogpt_platform/frontend/src/components/builder/block-menu/block-menu-provider.tsx @@ -26,7 +26,6 @@ export type DefaultStateType = export type CategoryKey = | "blocks" | "integrations" - | "providers" | "marketplace_agents" | "my_agents"; diff --git a/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/FiltersList.tsx b/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/FiltersList.tsx index 17c9e3cbf1..bfba178340 100644 --- a/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/FiltersList.tsx +++ b/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/FiltersList.tsx @@ -13,7 +13,6 @@ const FiltersList = () => { { key: "integrations", name: "Integrations" }, { key: "marketplace_agents", name: "Marketplace agents" }, { key: "my_agents", name: "My agents" }, - { key: "providers", name: "Providers" }, ]; const handleCategoryFilter = (category: CategoryKey) => { diff --git a/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/SearchList.tsx b/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/SearchList.tsx index 8116bd1973..6318cf2269 100644 --- a/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/SearchList.tsx +++ b/autogpt_platform/frontend/src/components/builder/block-menu/search-and-filter/SearchList.tsx @@ -134,7 +134,25 @@ const SearchList: React.FC = ({ }} /> ); - // currently our backend does not support ai blocks + case "ai_agent": + return ( + + model + .toLowerCase() + .includes(searchQuery.toLowerCase().trim()), + )} + onClick={() => { + const block = convertLibraryAgentIntoBlock(item); + addNode(block); + }} + /> + ); + default: return null; } diff --git a/autogpt_platform/frontend/src/lib/utils.ts b/autogpt_platform/frontend/src/lib/utils.ts index 316691a62d..f3d718f051 100644 --- a/autogpt_platform/frontend/src/lib/utils.ts +++ b/autogpt_platform/frontend/src/lib/utils.ts @@ -431,6 +431,10 @@ export const convertLibraryAgentIntoBlock = (agent: LibraryAgent) => { // Need to change it once, we got provider blocks export const getBlockType = (item: any) => { + console.log(item); + if (item.inputSchema.properties?.model?.title === "LLM Model") { + return "ai_agent"; + } if (item.id && item.name && item.inputSchema && item.outputSchema) { return "block"; } @@ -443,5 +447,6 @@ export const getBlockType = (item: any) => { if (item.slug && item.agent_name && item.runs !== undefined) { return "store_agent"; } + return null; };