mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Merge branch 'redesigning-block-menu' into kpczerwinski/secrt-1320-backend-update
This commit is contained in:
@@ -26,7 +26,6 @@ export type DefaultStateType =
|
||||
export type CategoryKey =
|
||||
| "blocks"
|
||||
| "integrations"
|
||||
| "providers"
|
||||
| "marketplace_agents"
|
||||
| "my_agents";
|
||||
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -134,7 +134,25 @@ const SearchList: React.FC<SearchListProps> = ({
|
||||
}}
|
||||
/>
|
||||
);
|
||||
// currently our backend does not support ai blocks
|
||||
case "ai_agent":
|
||||
return (
|
||||
<AiBlock
|
||||
key={index}
|
||||
title={item.name}
|
||||
description={item.description}
|
||||
ai_name={item.inputSchema.properties.model.enum.find(
|
||||
(model: string) =>
|
||||
model
|
||||
.toLowerCase()
|
||||
.includes(searchQuery.toLowerCase().trim()),
|
||||
)}
|
||||
onClick={() => {
|
||||
const block = convertLibraryAgentIntoBlock(item);
|
||||
addNode(block);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user