Open b10902118 opened 3 days ago
Thank you very much! We took this approach because some models do not support JSON responses directly, so we opted for a method that, while clumsy, is more universal. However, we would greatly welcome a pull request to add support for models that do provide JSON responses directly.
Currently, the json response for keyword extraction is done by: https://github.com/HKUDS/LightRAG/blob/186cd34a033d13c13317cba356e0076cffc113fe/lightrag/operate.py#L406-L407
But today, most language models already support response in json format. Manual parsing is clumsy and can be unstable. https://github.com/ollama/ollama-python/blob/dc38fe467585037e02a4bc27a100cf6cb10202ff/ollama/_client.py#L277 https://github.com/openai/openai-python?tab=readme-ov-file#nested-params
If this is desired, I can create a pull request. Thanks.