ValueError: Could not extract json string from output #32

Closed
opened 2026-02-16 00:16:40 -05:00 by yindo · 5 comments
Owner

Originally created by @Dr-Anil-Shinde on GitHub (Mar 7, 2024).

from llama_index.core.node_parser import MarkdownElementNodeParser
node_parser = MarkdownElementNodeParser(llm=Settings.llm, num_workers=8)
nodes = node_parser.get_nodes_from_documents(documents)
llm = mistral

ValueError: Could not extract json string from output: {
"summary": "As of December 31, 2021 and March 31, 2022, the company's assets include cash and cash equivalents, restricted cash and cash equivalents, accounts receivable, prepaid expenses, investments, equity method investments, property and equipment, operating lease right-of-use assets, and intangible assets. Liabilities include accounts payable, short-term insurance reserves, operating lease liabilities (current and non-current), long-term insurance reserves, long-term debt, and other long-term liabilities. Non-controlling interests are also reported. As of the end of the periods, total assets were $38,774 and $32,812, and total equity was $15,145 and $9,613, respectively.",
"table_title": "Balance Sheet",
"table_id": "id_16",
"columns": [
{
"col_name": "Assets",
"col_type": "string",
"summary": "As of December 31, 202

Originally created by @Dr-Anil-Shinde on GitHub (Mar 7, 2024). from llama_index.core.node_parser import MarkdownElementNodeParser node_parser = MarkdownElementNodeParser(llm=Settings.llm, num_workers=8) nodes = node_parser.get_nodes_from_documents(documents) llm = mistral ValueError: Could not extract json string from output: { "summary": "As of December 31, 2021 and March 31, 2022, the company's assets include cash and cash equivalents, restricted cash and cash equivalents, accounts receivable, prepaid expenses, investments, equity method investments, property and equipment, operating lease right-of-use assets, and intangible assets. Liabilities include accounts payable, short-term insurance reserves, operating lease liabilities (current and non-current), long-term insurance reserves, long-term debt, and other long-term liabilities. Non-controlling interests are also reported. As of the end of the periods, total assets were $38,774 and $32,812, and total equity was $15,145 and $9,613, respectively.", "table_title": "Balance Sheet", "table_id": "id_16", "columns": [ { "col_name": "Assets", "col_type": "string", "summary": "As of December 31, 202
yindo closed this issue 2026-02-16 00:16:40 -05:00
Author
Owner

@frankbaele commented on GitHub (Mar 8, 2024):

update to the latest version, this resolved the error for me. I'm guessing an API change.

@frankbaele commented on GitHub (Mar 8, 2024): update to the latest version, this resolved the error for me. I'm guessing an API change.
Author
Owner

@jmiddleton commented on GitHub (Apr 1, 2024):

didn't work for me with llama-parse 0.4. Which library do we need to update?

@jmiddleton commented on GitHub (Apr 1, 2024): didn't work for me with llama-parse 0.4. Which library do we need to update?
Author
Owner

@dieharders commented on GitHub (Apr 29, 2024):

Same here, I'm on version 0.4.1 using a quantized Llama2-7B. Was following the tutorial for llama-parse from https://medium.com/@yu-joshua/using-llamaparse-for-knowledge-graph-creation-from-documents-3bd1e1849754 loading a quarterly report pdf from META.

*Edit: Its the MarkdownElementNodeParser that is the problem. Not sure why?

@dieharders commented on GitHub (Apr 29, 2024): Same here, I'm on version 0.4.1 using a quantized Llama2-7B. Was following the tutorial for llama-parse from https://medium.com/@yu-joshua/using-llamaparse-for-knowledge-graph-creation-from-documents-3bd1e1849754 loading a quarterly report pdf from META. *Edit: Its the `MarkdownElementNodeParser` that is the problem. Not sure why?
Author
Owner

@hamza233 commented on GitHub (May 1, 2024):

Facing the same issue:

ValueError: Could not extract json string from output: Please note that the table has no title, and the column names are not explicitly stated in the context.

@hamza233 commented on GitHub (May 1, 2024): Facing the same issue: `ValueError: Could not extract json string from output: Please note that the table has no title, and the column names are not explicitly stated in the context.`
Author
Owner

@BinaryBrain commented on GitHub (Jul 9, 2024):

It seems to be fixed now. I just ran this code successfully:

from llama_index.llms.mistralai import MistralAI
from llama_index.core.node_parser import MarkdownElementNodeParser
from llama_parse import LlamaParse

llm = MistralAI()
node_parser = MarkdownElementNodeParser(llm=llm, num_workers=8)
pdf_file_name = './insurance.pdf'
documents = LlamaParse(result_type="markdown").load_data(pdf_file_name)
nodes = node_parser.get_nodes_from_documents(documents)
print(nodes)
@BinaryBrain commented on GitHub (Jul 9, 2024): It seems to be fixed now. I just ran this code successfully: ```py from llama_index.llms.mistralai import MistralAI from llama_index.core.node_parser import MarkdownElementNodeParser from llama_parse import LlamaParse llm = MistralAI() node_parser = MarkdownElementNodeParser(llm=llm, num_workers=8) pdf_file_name = './insurance.pdf' documents = LlamaParse(result_type="markdown").load_data(pdf_file_name) nodes = node_parser.get_nodes_from_documents(documents) print(nodes) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#32