graphrag
graphrag copied to clipboard
Expose http_client for httpx client customization with custom root certificates
Description
Exposed http_client to the consumer, to allow httpx client customization in case of execution within a corporate environment with custom root certs.
Related Issues
N/A
Proposed Changes
- Exposed
http_clientin thegraphrag.query.llm.oai.chat_openai.ChatOpenAImodule.
Detailed Changes
- Added
http_clientandhttp_client_asyncparameters to the__init__method ingraphrag/query/llm/oai/base.pyandgraphrag/query/llm/oai/chat_openai.py. - Modified the
_create_openai_clientmethod ingraphrag/query/llm/oai/base.pyto utilize thehttp_clientandhttp_client_asyncparameters for both synchronous and asynchronous clients. - Documentation Update: Added a new page
docsite/posts/config/corporate_ssl.mddetailing how to configurehttpxclients with custom SSL certificates.
Checklist
- [x] I have tested these changes locally.
- [x] I have reviewed the code changes.
- [x] I have updated the documentation (if necessary).
- [x] I have added appropriate unit tests (if applicable).
Additional Notes
Using custom root certs is a fairly uncommon scenario, but this change is critical to allow secure communication under those conditions.