You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community/embeddings
Miroslav 04e2611fea
Added additional headers for HuggingFaceInferenceAPIEmbeddings endpoint. (#21282)
Thank you for contributing to LangChain!

- [ ] **HuggingFaceInferenceAPIEmbeddings**: "Additional Headers"
  - Where: langchain, community, embeddings. huggingface.py.
- Community: add additional headers when needed by custom HuggingFace
TEI embedding endpoints. HuggingFaceInferenceAPIEmbeddings"


- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
- **Description:** Adding the `additional_headers` to be passed to
requests library if needed
    - **Dependencies:** none
 

- [ ] **Add tests and docs**: If you're adding a new integration, please
include
1. Tested with locally available TEI endpoints with and without
`additional_headers`
  2. Example  Usage
  
```python
embeddings=HuggingFaceInferenceAPIEmbeddings(
                             api_key=MY_CUSTOM_API_KEY,
                             api_url=MY_CUSTOM_TEI_URL,
                             additional_headers={
                                "Content-Type": "application/json"
                               }
)
```

 

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.

---------

Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
5 months ago
..
__init__.py community: add SambaNova embeddings integration (#21227) 5 months ago
aleph_alpha.py community[minor]: import fix (#20995) 5 months ago
anyscale.py community[minor]: Add Anyscale embedding support (#17605) 6 months ago
awa.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
azure_openai.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
baichuan.py infra: add print rule to ruff (#16221) 8 months ago
baidu_qianfan_endpoint.py community:qianfan endpoint support init params & remove useless params definietion (#15381) 9 months ago
bedrock.py community[minor]: import fix (#20995) 5 months ago
bookend.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
clarifai.py community[patch] : Tidy up and update Clarifai SDK functions (#18314) 7 months ago
cloudflare_workersai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
cohere.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
dashscope.py Fixing the Issue with DashScopeEmbeddings Handling More than 25 Rows of Data (#14662) 9 months ago
databricks.py community[patch]: docstrings update (#20301) 6 months ago
deepinfra.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
edenai.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
elasticsearch.py elasticsearch[patch], community[patch]: update references, deprecate community classes (#18506) 7 months ago
embaas.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
ernie.py community[patch]: deprecate ErnieBotChat and ErnieEmbeddings classes (#15862) 9 months ago
fake.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
fastembed.py community[patch]: support fastembed v1 and v2 (#19125) 7 months ago
gigachat.py community[minor]: Added GigaChat Embeddings support + updated previous GigaChat integration (#19516) 6 months ago
google_palm.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
gpt4all.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
gradient_ai.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
huggingface.py Added additional headers for HuggingFaceInferenceAPIEmbeddings endpoint. (#21282) 5 months ago
huggingface_hub.py community[patch]: Fixed 'coroutine' object is not subscriptable error (#15986) 9 months ago
infinity.py docs: community docstring updates (#21040) 5 months ago
infinity_local.py community[patch]: docstrings update (#20301) 6 months ago
itrex.py community[minor]: Add ITREX optimized Embeddings (#18474) 6 months ago
javelin_ai_gateway.py community[patch]: docstrings update (#20301) 6 months ago
jina.py Refactor: use SecretStr for jina embeddings (#15068) 10 months ago
johnsnowlabs.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
laser.py community: Add Laser Embedding Integration (#18111) 7 months ago
llamacpp.py community[minor]: import fix (#20995) 5 months ago
llamafile.py community[minor]: llamafile embeddings support (#17976) 7 months ago
llm_rails.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
localai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
minimax.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
mlflow.py docs: fix databricks document url (#19096) 7 months ago
mlflow_gateway.py community[patch]: docstrings update (#20301) 6 months ago
modelscope_hub.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
mosaicml.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
nemo.py mark NemoEmbeddings as deprecated (#21239) 5 months ago
nlpcloud.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
oci_generative_ai.py community[minor]: import fix (#20995) 5 months ago
octoai_embeddings.py community[patch]: octoai embeddings bug fix (#17216) 8 months ago
ollama.py community[patch]: OllamaEmbeddings - Pass headers to post request (#16880) 6 months ago
openai.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
openvino.py community[minor]: import fix (#20995) 5 months ago
optimum_intel.py community: fix tqdm import (#20263) 5 months ago
oracleai.py community[minor]: Oraclevs integration (#21123) 5 months ago
premai.py docs: community docstring updates (#21040) 5 months ago
sagemaker_endpoint.py community[patch]: Add explicit error message to Bedrock error output. (#17328) 6 months ago
sambanova.py community: add SambaNova embeddings integration (#21227) 5 months ago
self_hosted.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
self_hosted_hugging_face.py docs: Update documentation to use 'model_id' rather than 'model_name' to match actual API (#16615) 8 months ago
sentence_transformer.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
solar.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
spacy_embeddings.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
sparkllm.py docs: community docstring updates (#21040) 5 months ago
tensorflow_hub.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
text2vec.py Update text2vec.py (#19657) 6 months ago
titan_takeoff.py docs: community docstring updates (#21040) 5 months ago
vertexai.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
volcengine.py Feat add volcano embedding (#14693) 9 months ago
voyageai.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 5 months ago
xinference.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
yandex.py community[patch]: YandexGPT API add ability to disable request logging (#20670) 6 months ago