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

knowledge2character produces output file with wrong format. #14

Open
trojanMcAfee opened this issue Dec 28, 2024 · 7 comments
Open

knowledge2character produces output file with wrong format. #14

trojanMcAfee opened this issue Dec 28, 2024 · 7 comments

Comments

@trojanMcAfee
Copy link

trojanMcAfee commented Dec 28, 2024

Due to the workaround mentioned here, I had to convert a PDF file to knowledge using node.

That created a file which holds an object (from folder2knowledge.js):

const output = {
  documents: docs,
  chunks: chks
};

When running knowledge2character.js, it creates a new character.json file holding that object as knowledge, but when running the agent with pnpm start --character="characters/<character>.character.json", it fails with a parsing error since it's expecting an array for knowledge instead of an object.

@mintcloud
Copy link

mintcloud commented Jan 3, 2025

--EDIT: I just kept the chunks content, removed documents, formatted it as an array, it worked

Running into the same issue. Not sure whether I should keep either one of the two (documents or chunks) or whether it should be formatted differently

@saiSunkari19
Copy link

saiSunkari19 commented Jan 3, 2025

-- I don't think so, When I used some doc like bitcoin doc converted to Markdown.
I can see some data in documents section and chunks section. Do I need to remove any one of these and use for knowledge in the character file .

Any help??

@mintcloud
Copy link

I removed the documents data altogether and kept the chunks content (removing the key part, and copying the content so that knowledge is an array)

@benreichman
Copy link

+1. @mintcloud 's solution worked, but is this the proper way to do it ?

@edgarleal
Copy link

the same issue.

@Ansh1902396
Copy link

same issue

@rodrigolopezguerra
Copy link

Apparently, the way the file is parsed is either incorrect or deprecated. It creates "documents" and "chunks," generating an object with two arrays. According to the current official documentation, "knowledge" is an array.

I am unsure if it is correct to delete "documents," as I do not know its purpose, although it seems to maintain the knowledge map. Placing "chunks" in "knowledge" will probably work, as the knowledge is presumably there.

https://elizaos.github.io/eliza/docs/core/characterfile/

Oficial example template
...
"knowledge": [ "Understands border issues, Secret Service dynamics, and financial impacts on families." ],
...

Oficial documentation

knowledge
Array used for Retrieval Augmented Generation (RAG), containing facts or references to ground the character's responses.
Can contain chunks of text from articles, books, or other sources
Helps ground the character's responses in factual information
Knowledge can be generated from PDFs or other documents using provided tools

Workaround

  • Open the character generated file
  • Locate knowledge array {}
  • Inside you will have documents and chunks as arrays []
  • delete documents array
  • delete chunks and leave knowledge with chunks content as an array []

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

7 participants