You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(llm): Add custom HTTP headers support to ChatNVIDIA provider (#1461)
* feat(llm): Add custom HTTP headers support to ChatNVIDIA provider
Add custom HTTP headers support to the ChatNVIDIA class patch, enabling
users to pass custom headers
(authentication tokens, request IDs, billing information, etc.) with all
requests to NVIDIA AI
endpoints.
Implementation Approach
- Added custom_headers optional field to ChatNVIDIA class with Pydantic
v2 compatibility
- Implemented runtime method wrapping that intercepts _client.get_req()
and _client.get_req_stream()
to merge custom headers with existing headers
- Included automatic version detection to ensure compatibility with
langchain-nvidia-ai-endpoints >=
0.3.0, with clear error messages for older versions
- Works with both synchronous invoke() and streaming requests, fully
compatible with VLM (Vision
Language Models)
0 commit comments