fix the double {{ and }} when model_supports_json: false
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
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.
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.
we have a better version for the malfunction json fix here. I will close this PR. https://github.com/microsoft/graphrag/pull/551