Merge branch 'redesigning-block-menu' into kpczerwinski/secrt-1320-backend-update

This commit is contained in:
Krzysztof Czerwinski
2025-06-03 11:45:34 +02:00
4 changed files with 24 additions and 3 deletions

View File

@@ -26,7 +26,6 @@ export type DefaultStateType =
export type CategoryKey =
| "blocks"
| "integrations"
| "providers"
| "marketplace_agents"
| "my_agents";

View File

@@ -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) => {

View File

@@ -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;
}

View File

@@ -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;
};