Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme say folder2knowledge si available at npmjs - which it is not #9

Open
vpavlin opened this issue Dec 19, 2024 · 16 comments
Open

Comments

@vpavlin
Copy link

vpavlin commented Dec 19, 2024

The readme says you can just do npx folder2knowledge but the package does not exist on npmjs. Would be great if you could release it, or fix the readme:)

@bsnappy
Copy link

bsnappy commented Dec 20, 2024

+1

error:
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/folder2knowledge - Not found
npm error 404
npm error 404 'folder2knowledge@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.

@abcfy2
Copy link

abcfy2 commented Dec 24, 2024

Same

@unicornlaunching
Copy link

same - is there a workaround for adding a knowledge base?

@bsnappy
Copy link

bsnappy commented Dec 24, 2024

same - is there a workaround for adding a knowledge base?

Yes.

you can install as described in the readme:

npm install node scripts/folder2knowledge.js path/to/folder # path to your folder

@Doolitt
Copy link

Doolitt commented Dec 26, 2024

same - is there a workaround for adding a knowledge base?

Yes.

you can install as described in the readme:

npm install node scripts/folder2knowledge.js path/to/folder # path to your folder

gitpod /workspace/eliza ((v0.1.7-alpha.1)) $ npm install node characterfile/scripts/folder2knowledge.js "C:\Users\XXX\Documents
YYYY"
npm error code ENOTDIR
npm error syscall open
npm error path /workspace/eliza/characterfile/scripts/folder2knowledge.js/package.json
npm error errno -20
npm error Could not read package.json: Error: ENOTDIR: not a directory, open '/workspace/eliza/characterfile/scripts/folder2knowledge.js/package.json

Could you help with this error?

@MadeWithCodeXYZ
Copy link

Try to execute npm install after you cloned the repo and before you try running npx folder2knowledge <path/to/folder> :)

@trojanMcAfee
Copy link

trojanMcAfee commented Dec 28, 2024

+1

None of the workarounds written here worked for me. I'm trying to parse a PDF file into knowledge.

@trojanMcAfee
Copy link

As another workaround that worked for me:

1.- Put folder2knowledge.js into the scripts dir.
2.- Added this to my package.json:

{
  "type": "module",
  "dependencies": {
    "@opendocsg/pdf2md": "latest",
    "pdfjs-dist": "latest",
    "dotenv": "latest"
  }
}

3.- Ran pnpm install @opendocsg/pdf2md pdfjs-dist dotenv.
4- Ran node scripts/folder2knowledge.js <path-to-folder> (without the trailing / at the end).

@tombueng
Copy link

You need to clone the characterfile-repo and install from there.

git clone https://github.com/elizaos/characterfile.git
cd characterfile
npm install -g
npx folder2knowledge ./folder

@divydovy
Copy link

Hmm I followed those steps exactly @tombueng and get:

(node:10889) ExperimentalWarning: CommonJS module /Users/davidlockie/.nvm/versions/node/v23.3.0/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /Users/davidlockie/.nvm/versions/node/v23.3.0/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
node:internal/modules/cjs/loader:1239
const err = new Error(message);
^

Error: Cannot find module 'pdfjs-dist/legacy/build/pdf'
Require stack:

  • /Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
  • /Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/pdf2md.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1239:15)
    at Function._load (node:internal/modules/cjs/loader:1064:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1325:12)
    at require (node:internal/modules/helpers:136:16)
    at Object. (/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js:2:15)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object..js (node:internal/modules/cjs/loader:1698:10)
    at Module.load (node:internal/modules/cjs/loader:1303:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js',
    '/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/pdf2md.js'
    ]
    }

Node.js v23.3.0

1 similar comment
@divydovy
Copy link

Hmm I followed those steps exactly @tombueng and get:

(node:10889) ExperimentalWarning: CommonJS module /Users/davidlockie/.nvm/versions/node/v23.3.0/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /Users/davidlockie/.nvm/versions/node/v23.3.0/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
node:internal/modules/cjs/loader:1239
const err = new Error(message);
^

Error: Cannot find module 'pdfjs-dist/legacy/build/pdf'
Require stack:

  • /Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js
  • /Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/pdf2md.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1239:15)
    at Function._load (node:internal/modules/cjs/loader:1064:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1325:12)
    at require (node:internal/modules/helpers:136:16)
    at Object. (/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js:2:15)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object..js (node:internal/modules/cjs/loader:1698:10)
    at Module.load (node:internal/modules/cjs/loader:1303:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/util/pdf.js',
    '/Users/davidlockie/Documents/Projects/Eliza Characterfile/characterfile/node_modules/@opendocsg/pdf2md/lib/pdf2md.js'
    ]
    }

Node.js v23.3.0

@PioBOR
Copy link

PioBOR commented Jan 31, 2025

guys, were you able to figure this out? nothing works for me

@PioBOR
Copy link

PioBOR commented Jan 31, 2025

For anyone interested. I found this solution...
Had to first install this: npm install @opendocsg/[email protected] [email protected] [email protected]
and then run: node characterfile/scripts/folder2knowledge.js </path/to/your/documents>

@suryanshkushwaha
Copy link

@PioBOR I tried your solution but it didn't work out for me

@cruxdevvoor
Copy link

cruxdevvoor commented Feb 4, 2025

For anyone interested. I found this solution... Had to first install this: npm install @opendocsg/[email protected] [email protected] [email protected] and then run: node characterfile/scripts/folder2knowledge.js </path/to/your/documents>

Trying this at first I got an error "No matching version found for @opendocsg/[email protected]", but after running it without the version number install went thru and was able to run scripts/folder2knowledge.js.

on node v23.5.0

@PioBOR
Copy link

PioBOR commented Feb 5, 2025

so I was able to run both scripts finally but when knowledge2character adds the knowledge to the character the format is wrong and I am getting this error, over and over again. Tried modifying the script but nothing seems to work. Is it even needed to run this script and have this parsed into the character? Won't it just read directly from knowledge.json?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests