mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-30 05:47:54 +00:00
Hi there, This is a complementary PR to #30733. This PR introduces support for Hugging Face's serverless Inference Providers (documentation [here](https://huggingface.co/docs/inference-providers/index)), allowing users to specify different providers This PR also removes the usage of `InferenceClient.post()` method in `HuggingFaceEndpointEmbeddings`, in favor of the task-specific `feature_extraction` method. `InferenceClient.post()` is deprecated and will be removed in `huggingface_hub` v0.31.0. ## Changes made - bumped the minimum required version of the `huggingface_hub` package to ensure compatibility with the latest API usage. - added a provider field to `HuggingFaceEndpointEmbeddings`, enabling users to select the inference provider. - replaced the deprecated `InferenceClient.post()` call in `HuggingFaceEndpointEmbeddings` with the task-specific `feature_extraction` method for future-proofing, `post()` will be removed in `huggingface-hub` v0.31.0. ✅ All changes are backward compatible. --------- Co-authored-by: Lucain <lucainp@gmail.com> Co-authored-by: ccurme <chester.curme@gmail.com>