first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Model',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'mistral-ocr-latest',
|
||||
value: 'mistral-ocr-latest',
|
||||
},
|
||||
],
|
||||
description: 'The OCR model to use',
|
||||
required: true,
|
||||
default: 'mistral-ocr-latest',
|
||||
},
|
||||
{
|
||||
displayName: 'Document Type',
|
||||
name: 'documentType',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Document',
|
||||
value: 'document_url',
|
||||
},
|
||||
{
|
||||
name: 'Image',
|
||||
value: 'image_url',
|
||||
},
|
||||
],
|
||||
description: 'The type of document to process',
|
||||
required: true,
|
||||
default: 'document_url',
|
||||
},
|
||||
{
|
||||
displayName: 'Input Type',
|
||||
name: 'inputType',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Binary Data',
|
||||
value: 'binary',
|
||||
},
|
||||
{
|
||||
name: 'URL',
|
||||
value: 'url',
|
||||
},
|
||||
],
|
||||
description: 'How the document will be provided',
|
||||
required: true,
|
||||
default: 'binary',
|
||||
disabledOptions: {
|
||||
show: {
|
||||
'options.batch': [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Input Binary Field',
|
||||
name: 'binaryProperty',
|
||||
type: 'string',
|
||||
description: 'Name of the input binary field that contains the file to process',
|
||||
placeholder: 'e.g. data',
|
||||
hint: 'Uploaded document files must not exceed 50 MB in size and should be no longer than 1,000 pages.',
|
||||
required: true,
|
||||
default: 'data',
|
||||
displayOptions: {
|
||||
show: {
|
||||
inputType: ['binary'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'URL',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
description: 'URL of the document or image to process',
|
||||
placeholder: 'e.g. https://example.com/document.pdf',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
inputType: ['url'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Enable Batch Processing',
|
||||
name: 'batch',
|
||||
type: 'boolean',
|
||||
description:
|
||||
'Whether to process multiple documents in a single API call (more cost-efficient)',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
displayName: 'Batch Size',
|
||||
name: 'batchSize',
|
||||
type: 'number',
|
||||
description: 'Maximum number of documents to process in a single batch',
|
||||
default: 50,
|
||||
typeOptions: { maxValue: 2048 },
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
batch: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Delete Files After Processing',
|
||||
name: 'deleteFiles',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether to delete the files on Mistral Cloud after processing',
|
||||
displayOptions: {
|
||||
show: {
|
||||
batch: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['document'],
|
||||
operation: ['extractText'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
Reference in New Issue
Block a user