graphrag icon indicating copy to clipboard operation
graphrag copied to clipboard

fix the double {{ and }} when model_supports_json: false

Open s106916 opened this issue 1 year ago • 2 comments

Description

When using azure openai gpt4 with text-embedding-ada-002, we have to setup model_supports_json: false in setting.yml. We will have invalid json format error with {{ }} in json string.

Related Issues

setting.yml ... type: azure_openai_chat model: gpt-4 model_supports_json: false ... type: openai_embedding # or azure_openai_embedding model: text-embedding-ada-002

Proposed Changes

replace '{{' and '}}' with '{' and '}'

Checklist

  • [x] I have tested these changes locally.
  • [x] I have reviewed the code changes.
  • [ ] I have updated the documentation (if necessary).
  • [ ] I have added appropriate unit tests (if applicable).

Additional Notes

s106916 avatar Jul 11 '24 05:07 s106916

This PR name suggests one fix, but introduces something very different. Please double check.

Yes, I can see a lot of places with JSON validation issues. I will work on a more generic solution.

s106916 avatar Jul 13 '24 07:07 s106916

This PR name suggests one fix, but introduces something very different. Please double check.

Yes, I can see a lot of places with JSON validation issues. I will work on a more generic solution.

There's a central method for json validation if parsing fails at first instance. Also, I think you commited your fork's readme by mistake.

AlonsoGuevara avatar Jul 13 '24 16:07 AlonsoGuevara

we have a better version for the malfunction json fix here. I will close this PR. https://github.com/microsoft/graphrag/pull/551

s106916 avatar Jul 15 '24 01:07 s106916