mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
add airtable agent
This commit is contained in:
@@ -119,7 +119,7 @@ json.dumps(my_dict)`
|
||||
const code = `import pandas as pd\n${pythonCode}`
|
||||
finalResult = await pyodide.runPythonAsync(code)
|
||||
} catch (error) {
|
||||
throw new Error(pythonCode)
|
||||
throw new Error(`Sorry, I'm unable to find answer for question: "${input}" using follwoing code: "${pythonCode}"`)
|
||||
}
|
||||
}
|
||||
options.logger.debug('[components/CSVAgent] [3] Pyodide Result =>', finalResult)
|
||||
|
||||
@@ -9,13 +9,7 @@ export async function LoadPyodide(): Promise<PyodideInterface> {
|
||||
const { loadPyodide } = await import('pyodide')
|
||||
const obj: any = { packageCacheDir: path.join(getUserHome(), '.flowise', 'pyodideCacheDir') }
|
||||
pyodideInstance = await loadPyodide(obj)
|
||||
await pyodideInstance.loadPackage('micropip')
|
||||
const micropip = pyodideInstance.pyimport('micropip')
|
||||
await micropip.install('pandas')
|
||||
await micropip.install('numpy')
|
||||
//let mountDir = "/mnt";
|
||||
//pyodideInstance.FS.mkdir(mountDir);
|
||||
//pyodideInstance.FS.mount(pyodideInstance.FS.filesystems.NODEFS, { root: path.join(getUserHome(), '.flowise', 'pyodideFS') }, mountDir);
|
||||
await pyodideInstance.loadPackage(['pandas', 'numpy'])
|
||||
}
|
||||
|
||||
return pyodideInstance
|
||||
|
||||
Reference in New Issue
Block a user