KylinMountain / graphrag-server

添加🚀流式 Web 服务到 GraphRAG,兼容 OpenAI SDK,支持可访问的实体链接🔗,支持建议问题,兼容本地嵌入模型,修复诸多问题。Add streaming web server to GraphRAG, compatible with OpenAI SDK, support accessible entity link, support advice question, compatible with local embedding model, fix lots of issues.
https://microsoft.github.io/graphrag/
MIT License
200 stars 25 forks source link

Fix CORS error to support more LLM clients #13

Closed fluviusmagnus closed 3 months ago

fluviusmagnus commented 3 months ago

Description

Some LLM clients may not interact with the server flawlessly because of the CORS error. Wildcards are thus used to prevent this.

Related Issues

None.

Proposed Changes

No more CORS errors.

Checklist

Additional Notes

I am quite new to this. Not sure if this is done safely and correctly.

KylinMountain commented 3 months ago

Thanks very much, can you add such CORS config to webserver/configs/settings.py?

Then we can config this by env for different domain instead of modifying source code, what do you think

fluviusmagnus commented 3 months ago

I have exposed only the origins list to the server settings. Do you think this is enough?