Added jina block

This commit is contained in:
Waleed Latif
2025-01-30 17:47:13 -08:00
parent c7ee96df35
commit 49a9dcaa06
8 changed files with 206 additions and 6 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { CrewAIIcon } from '@/components/icons'
import { VisionResponse } from '@/tools/crewai/vision'
export const CrewAIVisionBlock: BlockConfig<VisionResponse> = {
type: 'crewaivision',
type: 'crewai_vision',
toolbar: {
title: 'CrewAI Vision Tool',
description: 'Analyze images using vision models',
+1 -1
View File
@@ -3,7 +3,7 @@ import { FirecrawlIcon } from '@/components/icons'
import { ScrapeResponse } from '@/tools/firecrawl/scrape'
export const FirecrawlScrapeBlock: BlockConfig<ScrapeResponse> = {
type: 'firecrawlscrape',
type: 'firecrawl_scrape',
toolbar: {
title: 'Firecrawl Scraper',
description: 'Extract clean content from any webpage',
+1
View File
@@ -32,6 +32,7 @@ export const FunctionBlock: BlockConfig<CodeExecutionOutput> = {
title: 'Code',
type: 'code',
layout: 'full',
placeholder: 'Enter your code here...'
}
],
},
+74
View File
@@ -0,0 +1,74 @@
import { JinaAIIcon } from '@/components/icons'
import { BlockConfig } from '../types'
import { ReadUrlResponse } from '@/tools/jina/reader'
export const JinaBlock: BlockConfig<ReadUrlResponse> = {
type: 'jina_reader',
toolbar: {
title: 'Jina Reader',
description: 'Convert any URL to LLM-friendly text',
bgColor: '#ffffff',
icon: JinaAIIcon,
category: 'advanced',
},
tools: {
access: ['jina.readurl']
},
workflow: {
inputs: {
url: { type: 'string', required: true },
useReaderLMv2: { type: 'boolean', required: false },
removeImages: { type: 'boolean', required: false },
gatherLinks: { type: 'boolean', required: false },
jsonResponse: { type: 'boolean', required: false }
},
outputs: {
response: {
type: {
content: 'string'
}
}
},
subBlocks: [
{
id: 'url',
title: 'URL',
type: 'short-input',
layout: 'full',
placeholder: 'Enter URL to read',
},
{
id: 'useReaderLMv2',
title: 'Use ReaderLM v2',
type: 'switch',
layout: 'half',
},
{
id: 'removeImages',
title: 'Remove Images',
type: 'switch',
layout: 'half',
},
{
id: 'gatherLinks',
title: 'Gather Links',
type: 'switch',
layout: 'half',
},
{
id: 'jsonResponse',
title: 'JSON Response',
type: 'switch',
layout: 'half',
},
{
id: 'apiKey',
title: 'API Key',
type: 'short-input',
layout: 'full',
placeholder: 'Enter API Key (optional)',
password: true
}
],
},
}
+12 -3
View File
@@ -6,17 +6,26 @@ import { ApiBlock } from './blocks/api'
import { FunctionBlock } from './blocks/function'
import { CrewAIVisionBlock } from './blocks/crewai'
import { FirecrawlScrapeBlock } from './blocks/firecrawl'
import { JinaBlock } from './blocks/jina'
// Export blocks for ease of use
export { AgentBlock, ApiBlock, FunctionBlock, CrewAIVisionBlock, FirecrawlScrapeBlock }
export {
AgentBlock,
ApiBlock,
FunctionBlock,
CrewAIVisionBlock,
FirecrawlScrapeBlock,
JinaBlock
}
// Registry of all block configurations
const blocks: Record<string, BlockConfig> = {
agent: AgentBlock,
api: ApiBlock,
function: FunctionBlock,
crewaivision: CrewAIVisionBlock,
firecrawlscrape: FirecrawlScrapeBlock
crewai_vision: CrewAIVisionBlock,
firecrawl_scrape: FirecrawlScrapeBlock,
jina_reader: JinaBlock
}
// Build a reverse mapping of tools to block types