@n8n/n8n-nodes-langchain 1.114.1 → 1.115.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js +1 -1
- package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js.map +1 -1
- package/dist/known/credentials.json +1 -0
- package/dist/known/nodes.json +8 -0
- package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js +339 -0
- package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreRedis/redis.dark.svg +37 -0
- package/dist/nodes/vector_store/VectorStoreRedis/redis.svg +37 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +15 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +3 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js +98 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js.map +1 -0
- package/dist/nodes/vendors/Ollama/Ollama.node.js +42 -0
- package/dist/nodes/vendors/Ollama/Ollama.node.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/Ollama/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js +412 -0
- package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/image/index.js +64 -0
- package/dist/nodes/vendors/Ollama/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/node.type.js +17 -0
- package/dist/nodes/vendors/Ollama/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/router.js +78 -0
- package/dist/nodes/vendors/Ollama/actions/router.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/text/index.js +64 -0
- package/dist/nodes/vendors/Ollama/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/text/message.operation.js +440 -0
- package/dist/nodes/vendors/Ollama/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/versionDescription.js +107 -0
- package/dist/nodes/vendors/Ollama/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/Ollama/helpers/index.js +17 -0
- package/dist/nodes/vendors/Ollama/helpers/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/Ollama/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/Ollama/methods/index.js +39 -0
- package/dist/nodes/vendors/Ollama/methods/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/methods/listSearch.js +39 -0
- package/dist/nodes/vendors/Ollama/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/Ollama/ollama.svg +1 -0
- package/dist/nodes/vendors/Ollama/transport/index.js +56 -0
- package/dist/nodes/vendors/Ollama/transport/index.js.map +1 -0
- package/dist/types/credentials.json +2 -2
- package/dist/types/nodes.json +2 -0
- package/package.json +11 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/Ollama/actions/image/analyze.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport type { OllamaChatResponse, OllamaMessage } from '../../helpers';\nimport { apiRequest } from '../../transport';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC,\n\t{\n\t\tdisplayName: 'Text Input',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\tplaceholder: \"e.g. What's in this image?\",\n\t\tdefault: \"What's in this image?\",\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Input Type',\n\t\tname: 'inputType',\n\t\ttype: 'options',\n\t\tdefault: 'binary',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Binary File(s)',\n\t\t\t\tvalue: 'binary',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Image URL(s)',\n\t\t\t\tvalue: 'url',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Input Data Field Name(s)',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\tplaceholder: 'e.g. data',\n\t\thint: 'The name of the input field containing the binary file data to be processed',\n\t\tdescription:\n\t\t\t'Name of the binary field(s) which contains the image(s), separate multiple field names with commas',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tinputType: ['binary'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'URL(s)',\n\t\tname: 'imageUrls',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. https://example.com/image.png',\n\t\tdescription: 'URL(s) of the image(s) to analyze, multiple URLs can be added separated by comma',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tinputType: ['url'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription: 'Whether to simplify the response or not',\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\tplaceholder: 'Add Option',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'System Message',\n\t\t\t\tname: 'system',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. You are a helpful assistant.',\n\t\t\t\tdescription: 'System message to set the context for the conversation',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Temperature',\n\t\t\t\tname: 'temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0.8,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 2,\n\t\t\t\t},\n\t\t\t\tdescription: 'Controls randomness in responses. Lower values make output more focused.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top P)',\n\t\t\t\tname: 'top_p',\n\t\t\t\tdefault: 0.7,\n\t\t\t\tdescription: 'The maximum cumulative probability of tokens to consider when sampling',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 1,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Top K',\n\t\t\t\tname: 'top_k',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 40,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t},\n\t\t\t\tdescription: 'Controls diversity by limiting the number of top tokens to consider',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Tokens',\n\t\t\t\tname: 'num_predict',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1024,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription: 'Maximum number of tokens to generate in the completion',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Frequency Penalty',\n\t\t\t\tname: 'frequency_penalty',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0.0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 2,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Presence Penalty',\n\t\t\t\tname: 'presence_penalty',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0.0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tnumberPrecision: 2,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Repetition Penalty',\n\t\t\t\tname: 'repeat_penalty',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1.1,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 2,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Context Length',\n\t\t\t\tname: 'num_ctx',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 4096,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription: 'Sets the size of the context window used to generate the next token',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Repeat Last N',\n\t\t\t\tname: 'repeat_last_n',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 64,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: -1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Sets how far back for the model to look back to prevent repetition. (0 = disabled, -1 = num_ctx).',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Min P',\n\t\t\t\tname: 'min_p',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0.0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 1,\n\t\t\t\t\tnumberPrecision: 3,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Alternative to the top_p, and aims to ensure a balance of quality and variety. The parameter p represents the minimum probability for a token to be considered, relative to the probability of the most likely token.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Seed',\n\t\t\t\tname: 'seed',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Stop Sequences',\n\t\t\t\tname: 'stop',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Sets the stop sequences to use. When this pattern is encountered the LLM will stop generating text and return. Separate multiple patterns with commas',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Keep Alive',\n\t\t\t\tname: 'keep_alive',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '5m',\n\t\t\t\tdescription:\n\t\t\t\t\t'Specifies the duration to keep the loaded model in memory after use. Format: 1h30m (1 hour 30 minutes).',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Low VRAM Mode',\n\t\t\t\tname: 'low_vram',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Main GPU ID',\n\t\t\t\tname: 'main_gpu',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Context Batch Size',\n\t\t\t\tname: 'num_batch',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 512,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of GPUs',\n\t\t\t\tname: 'num_gpu',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: -1,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: -1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of CPU Threads',\n\t\t\t\tname: 'num_thread',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t\tdescription:\n\t\t\t\t\t'Specifies the number of CPU threads to use for processing. Set to 0 for auto-detection.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Penalize Newlines',\n\t\t\t\tname: 'penalize_newline',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Use Memory Locking',\n\t\t\t\tname: 'use_mlock',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Use Memory Mapping',\n\t\t\t\tname: 'use_mmap',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Load Vocabulary Only',\n\t\t\t\tname: 'vocab_only',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Format',\n\t\t\t\tname: 'format',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Default', value: '' },\n\t\t\t\t\t{ name: 'JSON', value: 'json' },\n\t\t\t\t],\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Specifies the format of the API response',\n\t\t\t},\n\t\t],\n\t},\n];\n\ninterface MessageOptions {\n\tsystem?: string;\n\ttemperature?: number;\n\ttop_p?: number;\n\ttop_k?: number;\n\tnum_predict?: number;\n\tfrequency_penalty?: number;\n\tpresence_penalty?: number;\n\trepeat_penalty?: number;\n\tnum_ctx?: number;\n\trepeat_last_n?: number;\n\tmin_p?: number;\n\tseed?: number;\n\tstop?: string | string[];\n\tlow_vram?: boolean;\n\tmain_gpu?: number;\n\tnum_batch?: number;\n\tnum_gpu?: number;\n\tnum_thread?: number;\n\tpenalize_newline?: boolean;\n\tuse_mlock?: boolean;\n\tuse_mmap?: boolean;\n\tvocab_only?: boolean;\n\tformat?: string;\n\tkeep_alive?: string;\n}\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['analyze'],\n\t\tresource: ['image'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst inputType = this.getNodeParameter('inputType', i, 'binary') as string;\n\tconst text = this.getNodeParameter('text', i, '') as string;\n\tconst simplify = this.getNodeParameter('simplify', i, true) as boolean;\n\tconst options = this.getNodeParameter('options', i, {}) as MessageOptions;\n\n\tlet images: string[];\n\n\tif (inputType === 'url') {\n\t\tconst urls = this.getNodeParameter('imageUrls', i, '') as string;\n\t\tconst urlList = urls\n\t\t\t.split(',')\n\t\t\t.map((url) => url.trim())\n\t\t\t.filter((url) => url);\n\n\t\t// For URL inputs, we need to download and convert to base64\n\t\tconst imagePromises = urlList.map(async (url) => {\n\t\t\tconst response = (await this.helpers.httpRequest({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl,\n\t\t\t\tencoding: 'arraybuffer',\n\t\t\t})) as Buffer;\n\t\t\treturn response.toString('base64');\n\t\t});\n\n\t\timages = await Promise.all(imagePromises);\n\t} else {\n\t\tconst binaryPropertyNames = this.getNodeParameter('binaryPropertyName', i, 'data');\n\t\tconst propertyNames = binaryPropertyNames\n\t\t\t.split(',')\n\t\t\t.map((name: string) => name.trim())\n\t\t\t.filter((name: string) => name);\n\n\t\tconst imagePromises = propertyNames.map(async (binaryPropertyName: string) => {\n\t\t\tconst buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);\n\t\t\treturn buffer.toString('base64');\n\t\t});\n\n\t\timages = await Promise.all(imagePromises);\n\t}\n\n\tconst messages: OllamaMessage[] = [\n\t\t{\n\t\t\trole: 'user',\n\t\t\tcontent: text,\n\t\t\timages,\n\t\t},\n\t];\n\n\tconst processedOptions = { ...options };\n\tif (processedOptions.stop && typeof processedOptions.stop === 'string') {\n\t\tprocessedOptions.stop = processedOptions.stop\n\t\t\t.split(',')\n\t\t\t.map((s: string) => s.trim())\n\t\t\t.filter(Boolean);\n\t}\n\n\tconst body = {\n\t\tmodel,\n\t\tmessages,\n\t\tstream: false,\n\t\toptions: processedOptions,\n\t};\n\n\tconst response: OllamaChatResponse = await apiRequest.call(this, 'POST', '/api/chat', {\n\t\tbody,\n\t});\n\n\tif (simplify) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: { content: response.message.content },\n\t\t\t\tpairedItem: { item: i },\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [\n\t\t{\n\t\t\tjson: { ...response },\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqC;AAGrC,uBAA2B;AAC3B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,EACrC;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,IACT,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,Q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;AAAA,EACD;AAEA,SAAO;AAAA,IACN;AAAA,MACC,MAAM,EAAE,GAAG,SAAS;AAAA,MACpB,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":["response"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var image_exports = {};
|
|
30
|
+
__export(image_exports, {
|
|
31
|
+
analyze: () => analyze,
|
|
32
|
+
description: () => description
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(image_exports);
|
|
35
|
+
var analyze = __toESM(require("./analyze.operation"));
|
|
36
|
+
const description = [
|
|
37
|
+
{
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: true,
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: "Analyze Image",
|
|
45
|
+
value: "analyze",
|
|
46
|
+
action: "Analyze image",
|
|
47
|
+
description: "Take in images and answer questions about them"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
default: "analyze",
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: {
|
|
53
|
+
resource: ["image"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
...analyze.description
|
|
58
|
+
];
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
analyze,
|
|
62
|
+
description
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/Ollama/actions/image/index.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as analyze from './analyze.operation';\n\nexport { analyze };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Analyze Image',\n\t\t\t\tvalue: 'analyze',\n\t\t\t\taction: 'Analyze image',\n\t\t\t\tdescription: 'Take in images and answer questions about them',\n\t\t\t},\n\t\t],\n\t\tdefault: 'analyze',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['image'],\n\t\t\t},\n\t\t},\n\t},\n\t...analyze.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,cAAyB;AAIlB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,aAAa;AAAA,MACd;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,OAAO;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,QAAQ;AACZ;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var node_type_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(node_type_exports);
|
|
17
|
+
//# sourceMappingURL=node.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vendors/Ollama/actions/node.type.ts"],"sourcesContent":["import type { AllEntities } from 'n8n-workflow';\n\ntype NodeMap = {\n\ttext: 'message';\n\timage: 'analyze';\n};\n\nexport type OllamaType = AllEntities<NodeMap>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var router_exports = {};
|
|
30
|
+
__export(router_exports, {
|
|
31
|
+
router: () => router
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(router_exports);
|
|
34
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
35
|
+
var image = __toESM(require("./image"));
|
|
36
|
+
var text = __toESM(require("./text"));
|
|
37
|
+
async function router() {
|
|
38
|
+
const returnData = [];
|
|
39
|
+
const items = this.getInputData();
|
|
40
|
+
const resource = this.getNodeParameter("resource", 0);
|
|
41
|
+
const operation = this.getNodeParameter("operation", 0);
|
|
42
|
+
const ollamaTypeData = {
|
|
43
|
+
resource,
|
|
44
|
+
operation
|
|
45
|
+
};
|
|
46
|
+
let execute;
|
|
47
|
+
switch (ollamaTypeData.resource) {
|
|
48
|
+
case "image":
|
|
49
|
+
execute = image[ollamaTypeData.operation].execute;
|
|
50
|
+
break;
|
|
51
|
+
case "text":
|
|
52
|
+
execute = text[ollamaTypeData.operation].execute;
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), `The resource "${resource}" is not supported!`);
|
|
56
|
+
}
|
|
57
|
+
for (let i = 0; i < items.length; i++) {
|
|
58
|
+
try {
|
|
59
|
+
const responseData = await execute.call(this, i);
|
|
60
|
+
returnData.push.apply(returnData, responseData);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (this.continueOnFail()) {
|
|
63
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), error, {
|
|
67
|
+
itemIndex: i,
|
|
68
|
+
description: error.description
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return [returnData];
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
router
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vendors/Ollama/actions/router.ts"],"sourcesContent":["import { NodeOperationError, type IExecuteFunctions, type INodeExecutionData } from 'n8n-workflow';\n\nimport * as image from './image';\nimport type { OllamaType } from './node.type';\nimport * as text from './text';\n\nexport async function router(this: IExecuteFunctions) {\n\tconst returnData: INodeExecutionData[] = [];\n\n\tconst items = this.getInputData();\n\tconst resource = this.getNodeParameter('resource', 0);\n\tconst operation = this.getNodeParameter('operation', 0);\n\n\tconst ollamaTypeData = {\n\t\tresource,\n\t\toperation,\n\t} as OllamaType;\n\n\tlet execute;\n\tswitch (ollamaTypeData.resource) {\n\t\tcase 'image':\n\t\t\texecute = image[ollamaTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'text':\n\t\t\texecute = text[ollamaTypeData.operation].execute;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(this.getNode(), `The resource \"${resource}\" is not supported!`);\n\t}\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\ttry {\n\t\t\tconst responseData = await execute.call(this, i);\n\t\t\treturnData.push.apply(returnData, responseData);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: i } });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(this.getNode(), error, {\n\t\t\t\titemIndex: i,\n\t\t\t\tdescription: error.description,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn [returnData];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoF;AAEpF,YAAuB;AAEvB,WAAsB;AAEtB,eAAsB,SAAgC;AACrD,QAAM,aAAmC,CAAC;AAE1C,QAAM,QAAQ,KAAK,aAAa;AAChC,QAAM,WAAW,KAAK,iBAAiB,YAAY,CAAC;AACpD,QAAM,YAAY,KAAK,iBAAiB,aAAa,CAAC;AAEtD,QAAM,iBAAiB;AAAA,IACtB;AAAA,IACA;AAAA,EACD;AAEA,MAAI;AACJ,UAAQ,eAAe,UAAU;AAAA,IAChC,KAAK;AACJ,gBAAU,MAAM,eAAe,SAAS,EAAE;AAC1C;AAAA,IACD,KAAK;AACJ,gBAAU,KAAK,eAAe,SAAS,EAAE;AACzC;AAAA,IACD;AACC,YAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,iBAAiB,QAAQ,qBAAqB;AAAA,EAC7F;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACtC,QAAI;AACH,YAAM,eAAe,MAAM,QAAQ,KAAK,MAAM,CAAC;AAC/C,iBAAW,KAAK,MAAM,YAAY,YAAY;AAAA,IAC/C,SAAS,OAAO;AACf,UAAI,KAAK,eAAe,GAAG;AAC1B,mBAAW,KAAK,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,GAAG,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;AAC3E;AAAA,MACD;AAEA,YAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,OAAO;AAAA,QACnD,WAAW;AAAA,QACX,aAAa,MAAM;AAAA,MACpB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,SAAO,CAAC,UAAU;AACnB;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var text_exports = {};
|
|
30
|
+
__export(text_exports, {
|
|
31
|
+
description: () => description,
|
|
32
|
+
message: () => message
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(text_exports);
|
|
35
|
+
var message = __toESM(require("./message.operation"));
|
|
36
|
+
const description = [
|
|
37
|
+
{
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: true,
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: "Message a Model",
|
|
45
|
+
value: "message",
|
|
46
|
+
action: "Message a model",
|
|
47
|
+
description: "Send a message to Ollama model"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
default: "message",
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: {
|
|
53
|
+
resource: ["text"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
...message.description
|
|
58
|
+
];
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
description,
|
|
62
|
+
message
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/Ollama/actions/text/index.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as message from './message.operation';\n\nexport { message };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Message a Model',\n\t\t\t\tvalue: 'message',\n\t\t\t\taction: 'Message a model',\n\t\t\t\tdescription: 'Send a message to Ollama model',\n\t\t\t},\n\t\t],\n\t\tdefault: 'message',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['text'],\n\t\t\t},\n\t\t},\n\t},\n\t...message.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,cAAyB;AAIlB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,aAAa;AAAA,MACd;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,QAAQ;AACZ;","names":[]}
|