diff --git a/blocks/blocks/agent.ts b/blocks/blocks/agent.ts index 2ac3be3dad..6c747ce8a6 100644 --- a/blocks/blocks/agent.ts +++ b/blocks/blocks/agent.ts @@ -35,13 +35,17 @@ export const AgentBlock: BlockConfig = { config: { tool: (params: Record) => { const model = params.model || 'gpt-4o'; + if (!model) { throw new Error('No model selected'); } + const tool = MODEL_TOOLS[model as keyof typeof MODEL_TOOLS]; + if (!tool) { throw new Error(`Invalid model selected: ${model}`); } + return tool; } } diff --git a/executor/index.ts b/executor/index.ts index 47e0923163..97b695a982 100644 --- a/executor/index.ts +++ b/executor/index.ts @@ -1,6 +1,6 @@ import { SerializedWorkflow, SerializedBlock, BlockConfig } from '@/serializer/types'; import { ExecutionContext, ExecutionResult, Tool } from './types'; -import { tools } from '@/tools/registry'; +import { tools } from '@/tools'; export class Executor { private workflow: SerializedWorkflow; diff --git a/tools/registry.ts b/tools/index.ts similarity index 100% rename from tools/registry.ts rename to tools/index.ts