langchain/libs/community/langchain_community/embeddings
Aubrey Ford 23f701b08e
langchain_community: OpenAIEmbeddings not respecting chunk_size argument (#30946)
This is a follow-on PR to go with the identical changes that were made
in parters/openai.

Previous PR:  https://github.com/langchain-ai/langchain/pull/30757

When calling embed_documents and providing a chunk_size argument, that
argument is ignored when OpenAIEmbeddings is instantiated with its
default configuration (where check_embedding_ctx_length=True).

_get_len_safe_embeddings specifies a chunk_size parameter but it's not
being passed through in embed_documents, which is its only caller. This
appears to be an oversight, especially given that the
_get_len_safe_embeddings docstring states it should respect "the set
embedding context length and chunk size."

Developers typically expect method parameters to take effect (also, take
precedence) when explicitly provided, especially when instantiating
using defaults. I was confused as to why my API calls were being
rejected regardless of the chunk size I provided.
2025-04-21 08:39:07 -04:00
..
__init__.py community: Add ruff rule PGH003 (#30812) 2025-04-14 02:32:13 +00:00
aleph_alpha.py
anyscale.py community[patch]: fix errors introduced by pydantic 2.10 (#28297) 2024-11-22 17:50:13 -05:00
ascend.py Update ascend.py (#30060) 2025-03-01 14:10:41 -05:00
awa.py
azure_openai.py Community/Partner: Adding Azure community and partner user agent to better track usage in Python (#29561) 2025-02-07 23:28:30 +00:00
baichuan.py Improvement[Community]Improve Embeddings API (#28038) 2024-11-12 13:57:35 -05:00
baidu_qianfan_endpoint.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
bedrock.py
bookend.py community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
clarifai.py
cloudflare_workersai.py
clova.py community: Add Naver chat model & embeddings (#25162) 2024-10-24 20:54:13 +00:00
cohere.py
dashscope.py Improvement[Community]Improve Embeddings API (#28038) 2024-11-12 13:57:35 -05:00
databricks.py docs: Updating the imports for langchain-databricks to databricks-langchain (#29646) 2025-02-06 13:28:07 -08:00
deepinfra.py
edenai.py
elasticsearch.py
embaas.py
ernie.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
fake.py Improvement[Community]Improve Embeddings API (#28038) 2024-11-12 13:57:35 -05:00
fastembed.py community: improve FastEmbedEmbeddings support for ONNX execution provider (e.g. GPU) (#29645) 2025-02-06 15:31:23 -05:00
gigachat.py community: Add deprecation warning for GigaChat integration in langchain-community (#28022) 2024-11-20 21:03:47 +00:00
google_palm.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
gpt4all.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
gradient_ai.py
huggingface_hub.py
huggingface.py community: Passing the model_kwargs correctly while maintaing backward compatability (#28439) 2024-12-15 20:34:29 +00:00
hunyuan.py community: support Hunyuan Embedding (#23160) 2024-12-16 19:27:19 +00:00
infinity_local.py community: Add ruff rule PGH003 (#30812) 2025-04-14 02:32:13 +00:00
infinity.py community: Fix closed session in Infinity (#26933) 2024-10-27 11:37:21 -04:00
ipex_llm.py
itrex.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
javelin_ai_gateway.py
jina.py community: Add ruff rule PGH003 (#30812) 2025-04-14 02:32:13 +00:00
johnsnowlabs.py
laser.py core,langchain,community[patch]: allow langsmith 0.2 (#28598) 2024-12-10 18:50:58 +00:00
llamacpp.py community: Repair embeddings/llamacpp's embed_query method (#29935) 2025-02-23 19:32:17 +00:00
llamafile.py
llm_rails.py
localai.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
minimax.py
mlflow_gateway.py
mlflow.py
model2vec.py community: fixed bug in model2vec embedding code (#28670) 2024-12-11 15:50:56 -08:00
modelscope_hub.py
mosaicml.py
naver.py community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
nemo.py community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
nlpcloud.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
oci_generative_ai.py [oci_generative_ai] Option to pass auth_file_location (#29481) 2025-02-03 21:44:13 -05:00
octoai_embeddings.py community[patch]: fix errors introduced by pydantic 2.10 (#28297) 2024-11-22 17:50:13 -05:00
ollama.py community: deprecate community ollama integrations (#26733) 2024-10-01 09:18:07 -07:00
openai.py langchain_community: OpenAIEmbeddings not respecting chunk_size argument (#30946) 2025-04-21 08:39:07 -04:00
openvino.py community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
optimum_intel.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
oracleai.py
ovhcloud.py community: Use new OVHcloud batch embedding (#26209) 2024-11-04 16:40:30 -05:00
premai.py
sagemaker_endpoint.py
sambanova.py libs: add sambanova-lagchain integration package (#29417) 2025-01-27 20:34:55 +00:00
self_hosted_hugging_face.py
self_hosted.py
sentence_transformer.py
solar.py partner: Update Upstage Model Names and Remove Deprecated Model (#29093) 2025-01-08 10:13:22 -05:00
spacy_embeddings.py community: Bump ruff version to 0.9 (#29206) 2025-02-08 01:21:10 +00:00
sparkllm.py
tensorflow_hub.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
text2vec.py community[patch]: Fix missing protected_namespaces(). (#27610) 2024-10-25 02:16:26 +00:00
textembed.py community: Add ruff rule PGH003 (#30812) 2025-04-14 02:32:13 +00:00
titan_takeoff.py
vertexai.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
volcengine.py
voyageai.py
xinference.py
yandex.py
zhipuai.py