update pointer attribute and logic
This commit is contained in:
parent
7ce0f71e2f
commit
7646e973e3
|
|
@ -37,9 +37,8 @@ class Jsonlines_DocumentLoaders implements INode {
|
||||||
label: 'Pointer Extraction',
|
label: 'Pointer Extraction',
|
||||||
name: 'pointerName',
|
name: 'pointerName',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'Extracting the pointer',
|
|
||||||
placeholder: 'Enter pointer name',
|
placeholder: 'Enter pointer name',
|
||||||
optional: true
|
optional: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Metadata',
|
label: 'Metadata',
|
||||||
|
|
@ -60,6 +59,8 @@ class Jsonlines_DocumentLoaders implements INode {
|
||||||
let alldocs = []
|
let alldocs = []
|
||||||
let files: string[] = []
|
let files: string[] = []
|
||||||
|
|
||||||
|
let pointer = '/' + pointerName.trim()
|
||||||
|
|
||||||
if (jsonLinesFileBase64.startsWith('[') && jsonLinesFileBase64.endsWith(']')) {
|
if (jsonLinesFileBase64.startsWith('[') && jsonLinesFileBase64.endsWith(']')) {
|
||||||
files = JSON.parse(jsonLinesFileBase64)
|
files = JSON.parse(jsonLinesFileBase64)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -71,7 +72,7 @@ class Jsonlines_DocumentLoaders implements INode {
|
||||||
splitDataURI.pop()
|
splitDataURI.pop()
|
||||||
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
|
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
|
||||||
const blob = new Blob([bf])
|
const blob = new Blob([bf])
|
||||||
const loader = new JSONLinesLoader(blob, pointerName)
|
const loader = new JSONLinesLoader(blob, pointer)
|
||||||
|
|
||||||
if (textSplitter) {
|
if (textSplitter) {
|
||||||
const docs = await loader.loadAndSplit(textSplitter)
|
const docs = await loader.loadAndSplit(textSplitter)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue