@flatfile/ai-agents
Advanced tools
Comparing version 0.1.0-alpha.12 to 0.1.0-alpha.13
@@ -267,3 +267,3 @@ // src/agents/blueprint.agent.ts | ||
} | ||
var retry = async (fn, maxAttempts = 3, delay = 1e3) => { | ||
var retry = async (fn, maxAttempts = 5, delay = 1e3) => { | ||
for (let attempt = 1; attempt <= maxAttempts; attempt++) { | ||
@@ -468,3 +468,3 @@ try { | ||
// src/utils/parseFile.ts | ||
import { promises as fsp } from "fs"; | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
@@ -481,3 +481,3 @@ import Pdf from "pdf-parse/lib/pdf-parse.js"; | ||
case EXCELX: | ||
const buffer = await fsp.readFile(filepath); | ||
const buffer = await fs.readFile(filepath); | ||
const workbook = XLSX.read(buffer, { sheetRows: 20 }); | ||
@@ -496,8 +496,5 @@ const sheets = workbook.Sheets; | ||
output.push( | ||
`Sheet name: ${sheetName} | ||
Sheet data as CSV: | ||
`<sheet name="${sheetName}" format="csv"> | ||
${preserveEmptyCSVData(data)} | ||
` | ||
</sheet>` | ||
); | ||
@@ -507,3 +504,3 @@ } | ||
case PDF: | ||
const contents = await fsp.readFile(filepath); | ||
const contents = await fs.readFile(filepath); | ||
const pdf = await Pdf(contents); | ||
@@ -513,3 +510,3 @@ output.push(pdf.text); | ||
default: | ||
output.push(preserveEmptyCSVData(await fsp.readFile(filepath, "utf-8"))); | ||
output.push(preserveEmptyCSVData(await fs.readFile(filepath, "utf-8"))); | ||
break; | ||
@@ -516,0 +513,0 @@ } |
{ | ||
"name": "@flatfile/ai-agents", | ||
"version": "0.1.0-alpha.12", | ||
"version": "0.1.0-alpha.13", | ||
"description": "A collection of AI Agents for building in Flatfile", | ||
"publishConfig": { | ||
"access": "restricted" | ||
}, | ||
"packageManager": "npm@10.8.3", | ||
@@ -9,0 +6,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
56060
1279