Find answers from the community

Updated 7 months ago

@Logan M

@Logan M
Hi, Is there any examples of using JsonQueryEngine with open source llms?
I tried a few of them and all generate ''wrong json path'' errors as they're not compatible with generating JSONs
L
a
2 comments
Its not that they aren't "compatible" but that they aren't smart enough to generate something thats parsable and correct.

I have no idea though πŸ€·β€β™‚οΈ Llama3 maybe?
@Logan M
Thanks for the reply,
I've tried Llama3 and doesn't work!
Another question, I have the following JSON reader, however, it cannot index my JSON file!
You know what's the reason? (I tried different files)

from llama_index.readers.json import JSONReader # Initialize JSONReader reader = JSONReader( # The number of levels to go back in the JSON tree. Set to 0 to traverse all levels. Default is None. # levels_back="None", # # The maximum number of characters a JSON fragment would be collapsed in the output. Default is None. collapse_length="20", # # If True, ensures that the output is ASCII-encoded. Default is False. ensure_ascii="True", # # If True, indicates that the file is in JSONL (JSON Lines) format. Default is False. # is_jsonl="False", # # If True, removes lines containing only formatting from the output. Default is True. clean_json="False", ) documents = reader.load_data(input_file="./xxx.json", extra_info={}) vector_index = VectorStoreIndex.from_documents(documents, show_progress=True)

I also tried levels_back="0", however, getting this error:
TypeError: '<=' not supported between instances of 'int' and 'str'
Add a reply
Sign up and join the conversation on Discord