graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

[Bug]: community report prompt JSON-formatted string invalid

Open lyiker opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues
  • [ ] I have checked #657 to validate if my issue is covered by community support

Describe the bug

the prompt file in graphrag/index/graph/extractors/community_reports/prompts.py describe json format has double '{'

Return output as a well-formed JSON-formatted string with the following format:
    {{
        "title": <report_title>,
        "summary": <executive_summary>,
        "rating": <impact_severity_rating>,
        "rating_explanation": <rating_explanation>,
        "findings": [
            {{
                "summary":<insight_1_summary>,
                "explanation": <insight_1_explanation>
            }},
            {{
                "summary":<insight_2_summary>,
                "explanation": <insight_2_explanation>
            }}
        ]
    }}

llm use the prompt to generate output with error json format

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
16:23:33,904 graphrag.llm.openai.openai_chat_llm WARNING error parsing llm json, retrying

Steps to reproduce

No response

Expected Behavior

No response

GraphRAG Config Used

# Paste your config here

Logs and screenshots

No response

Additional Information

  • GraphRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:

lyiker avatar Jul 26 '24 09:07 lyiker