Commit Graph

13529 Commits

Author SHA1 Message Date
ccurme
4071670f56
huggingface[patch]: bump transformers (#31559) 2025-06-10 20:43:33 +00:00
ccurme
40d6d4c738
huggingface[patch]: bump core dep (#31558) 2025-06-10 20:26:13 +00:00
Mohammad Mohtashim
42eb356a44
[OpenAI]: Encoding Model (#31402)
- **Description:** Small Fix for when getting the encoder in case of
KeyError and using the correct encoder for newer models
- **Issue:** #31390
2025-06-10 16:00:00 -04:00
Mrityunjay Jha
40bd71caa5
doc:Updating doc with consistent bullet format. (#31527)
Description: Added line-break for each of the step mentioned, also made
bullet points consistent with other docs.
Dependencies: N/A
Twitter handle: [mrityu___](https://x.com/mrityu___)

Before Changes:

![image](https://github.com/user-attachments/assets/867b0c05-7ebd-418b-bfe4-e1cb6134baf2)

After Changes:

![image](https://github.com/user-attachments/assets/3ff5db49-a713-4bb0-b814-dc02b9dc6bb4)



The styling(non-bold of bullet) is consistent with
[chat_models.mdx](https://github.com/langchain-ai/langchain/edit/master/docs/docs/concepts/chat_models.mdx)
(SS below from same, take note that how bullet numbers are not bold).


![image](https://github.com/user-attachments/assets/712b1a73-85ca-45d0-86d6-aa1c0fb3f164)
2025-06-10 15:45:11 -04:00
CCM
1935e4526a
docs: update graph_rag.mdx (#31548)
**Description:** fix broken links
2025-06-10 15:43:30 -04:00
Steven Silvester
323850fae1
docs: Update MongoDB feature status (#31553)
**Description:** a description of the change

Update the MongoDBAtlasVectorSearch feature status.

As of https://github.com/langchain-ai/langchain-mongodb/pull/98,
MongoDBAtlasVectorSearch is using the standard test suite.
2025-06-10 15:42:17 -04:00
Mateusz Szewczyk
eadbb9077e
docs: Updated text embedding model for IBM provider (#31554)
Thank you for contributing to LangChain!

Description: Updated text embedding (`WatsonxEmbeddings`) model for IBM
provider
2025-06-10 15:41:36 -04:00
ccurme
b0f100af7e
core: release 0.3.65 (#31557) 2025-06-10 19:39:50 +00:00
Sydney Runkle
5b165effcd
core(fix): revert set_text optimization (#31555)
Revert serialization regression introduced in
https://github.com/langchain-ai/langchain/pull/31238

Fixes https://github.com/langchain-ai/langchain/issues/31486
2025-06-10 13:36:55 -04:00
Soumendra kumar sahoo
e455fab5d3
docs: Update Multi_modal_RAG_google.ipynb to remove the unsupported Gemini models (#31526)
- **Description:** Remove the outdated Gemini models and replace those
with the latest models.
- **Issue:** Earlier the code was not running, now the code runs.
- **Dependencies:** No
- **Twitter handle:** [soumendrak_](https://x.com/soumendrak_)
2025-06-09 21:26:01 -04:00
Jacob Peddicord
b21526fe38
docs: update Exa integration examples (#31547)
## Description

Updating Exa integration documentation to showcase the latest features
and best practices.

## Changes

- Added examples for `ExaSearchResults` tool with advanced search
options
- Added examples for `ExaFindSimilarResults` tool
- Updated agent example to use LangGraph
- Demonstrated text content options, summaries, and highlights
- Included examples of search type control and live crawling

## Additional Context

I'm from the Exa team updating our integration documentation to reflect
current capabilities and best practices.
2025-06-09 21:24:42 -04:00
Eugene Yurtsev
9ce974247c
langchain[patch]: Remove proxy imports to langchain_experimental (#31541)
Remove proxy imports to langchain_experimental.

Previously, these imports would work if a user manually installed
langchain_experimental. However, we want to drop support even for that
as langchain_experimental is generally not recommended to be run in
production.

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
2025-06-09 17:09:09 -04:00
Zameel Hassan
16e5a12806
docs: fix grammar in retrievers.mdx ("be built" → "build") (#31537)
**Description:**  
Fixed a small grammatical error in the `retrievers.mdx` documentation.  
Replaced "we can be built retrievers on top of search APIs..." with  
"we can build retrievers on top of search APIs..." for clarity and
correctness.

**Issue:**  
N/A

**Dependencies:**  
None

**Twitter handle:**  
@hassan_zameel
2025-06-09 16:29:14 -04:00
ccurme
71b0f78952
openai: release 0.3.22 (#31542) 2025-06-09 15:29:15 -04:00
ccurme
575662d5f1
openai[patch]: accommodate change in image generation API (#31522)
OpenAI changed their API to require the `partial_images` parameter when
using image generation + streaming.

As described in https://github.com/langchain-ai/langchain/pull/31424, we
are ignoring partial images. Here, we accept the `partial_images`
parameter (as required by OpenAI), but emit a warning and continue to
ignore partial images.
2025-06-09 14:57:46 -04:00
ccurme
ece9e31a7a
openai[patch]: VCR some tests (#31524) 2025-06-06 23:00:57 +00:00
Bagatur
5187817006
openai[release]: 0.3.21 (#31519) 2025-06-06 11:40:09 -04:00
Bagatur
761f8c3231
openai[patch]: pass through with_structured_output kwargs (#31518)
Support 
```python
from langchain.chat_models import init_chat_model
from pydantic import BaseModel


class ResponseSchema(BaseModel):
    response: str


def get_weather(location: str) -> str:
    """Get weather"""
    pass

llm = init_chat_model("openai:gpt-4o-mini")

structured_llm = llm.with_structured_output(
    ResponseSchema,
    tools=[get_weather],
    strict=True,
    include_raw=True,
    tool_choice="required",
    parallel_tool_calls=False,
)

structured_llm.invoke("whats up?")
```
2025-06-06 11:17:34 -04:00
Bagatur
0375848f6c
openai[patch]: update with_structured_outputs docstring (#31517)
Update docstrings
2025-06-06 10:03:47 -04:00
ccurme
9c639035c0
standard-tests: add cache_control to Anthropic inputs test (#31516) 2025-06-06 10:00:43 -04:00
ccurme
a1f068eb85
openai: release 0.3.20 (#31515) 2025-06-06 13:29:12 +00:00
ccurme
4cc2f6b807
openai[patch]: guard against None text completions in BaseOpenAI (#31514)
Some chat completions APIs will return null `text` output (even though
this is typed as string).
2025-06-06 09:14:37 -04:00
Mrityunjay Jha
abc8bf9f1c
docs:Adding line breaks to better explain each step, also making sure that bulleting style is consistent with other docs. (#31506)
- **Description:** Added line-break for each of the step mentioned for a
diagram in the doc.
- **Dependencies:** N/A
- **Twitter handle:** [mrityu___](https://x.com/mrityu___)

Before changes:

![image](https://github.com/user-attachments/assets/c9946aec-79c7-4ad5-a28e-06ea4c163ce5)


After Changes:

![image](https://github.com/user-attachments/assets/933db561-bea2-421e-88e8-f79cbb30856d)




The styling(non-bold of bullet) is consistent with
[chat_models.mdx](https://github.com/langchain-ai/langchain/edit/master/docs/docs/concepts/chat_models.mdx)
(SS below from same, take note that how bullet numbers are not bold).


![image](https://github.com/user-attachments/assets/958c1e25-e52c-4d6f-8b46-f59af3aa3d3b)
2025-06-06 08:43:15 -04:00
nakanoh
c25b832f51
fix: typo in SECURITY.md (practicies -> practices) (#31509)
**Description:**
Fixes a typo in SECURITY.md ("practicies" → "practices").
Note: This PR also unifies apostrophe usage (’ → ').

**Issue:**
N/A

**Dependencies:**
None

**Twitter handle:**
N/A

Co-authored-by: 中野 博文 <hirofumi0082@gmail.com>
2025-06-06 08:42:01 -04:00
lc-arjun
35ae5eab4f
core: use run tree post/patch (#31500)
Use run post/patch
2025-06-05 14:05:57 -07:00
Eugene Yurtsev
73655b0ca8
huggingface: 0.3.0 release (#31503)
Breaking change to make some dependencies optional:
https://github.com/langchain-ai/langchain/pull/31268

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2025-06-05 20:20:15 +00:00
Bagatur
f7f52cab12
anthropic[patch]: cache tokens nit (#31484)
if you pass in beta headers directly cache_creation is a dict
2025-06-05 16:15:03 -04:00
ccurme
14c561e15d
infra: relax types-requests version range (#31504) 2025-06-05 18:57:08 +00:00
ccurme
6d6f305748
openai[patch]: clarify docs on api_version in docstring for AzureChatOpenAI (#31502) 2025-06-05 16:06:22 +00:00
Simon Stone
815bfa5408
huggingface[major]: Reduce disk footprint by 95% by making large dependencies optional (#31268)
**Description:** 
`langchain_huggingface` has a very large installation size of around 600
MB (on a Mac with Python 3.11). This is due to its dependency on
`sentence-transformers`, which in turn depends on `torch`, which is 320
MB all by itself. Similarly, the depedency on `transformers` adds
another set of heavy dependencies. With those dependencies removed, the
installation of `langchain_huggingface` only takes up ~26 MB. This is
only 5 % of the full installation!

These libraries are not necessary to use `langchain_huggingface`'s API
wrapper classes, only for local inferences/embeddings. All import
statements for those two libraries already have import guards in place
(try/catch with a helpful "please install x" message).

This PR therefore moves those two libraries to an optional dependency
group `full`. So a `pip install langchain_huggingface` will only install
the lightweight version, and a `pip install
"langchain_huggingface[full]"` will install all dependencies.

I know this may break existing code, because `sentence-transformers` and
`transformers` are now no longer installed by default. Given that users
will see helpful error messages when that happens, and the major impact
of this small change, I hope that you will still consider this PR.

**Dependencies:** No new dependencies, but new optional grouping.
2025-06-05 12:04:19 -04:00
Mohammad Mohtashim
ae3551c96b
core[patch]: Correct type casting of annotations in _infer_arg_descriptions (#31181)
- **Description:** 
- In _infer_arg_descriptions, the annotations dictionary contains string
representations of types instead of actual typing objects. This causes
_is_annotated_type to fail, preventing the correct description from
being generated.
- This is a simple fix using the get_type_hints method, which resolves
the annotations properly and is supported across all Python versions.

  - **Issue:** #31051

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-06-05 11:58:36 -04:00
Mrityunjay Jha
dea43436ea
docs: updated incorrect datatype for custom tool notebook (#31498)
- **Description:** `"string"` is given as the `"type"` for a custom tool
argument, even though it is an `integer`. This can be validated from the
Colab notebook output.
- **Issue:** N/A
- **Dependencies:** N/A
- **Twitter handle:** [mrityu___](https://x.com/mrityu___)

    
Current: 

![image](https://github.com/user-attachments/assets/403c04c5-ba35-4845-a8ce-9e9c584a57b8)

After Change:

![image](https://github.com/user-attachments/assets/c0af90c4-2039-4b92-9be3-7b77d08bae3d)

Colab Output:

![image](https://github.com/user-attachments/assets/9495c574-21bf-475d-8ede-a14cb2576ffa)
2025-06-05 11:40:52 -04:00
ccurme
43bee469ce
standard-tests: release 0.3.20 (#31499) 2025-06-05 11:28:18 -04:00
ccurme
741bb1ffa1
core[patch]: revert change to stream type hint (#31501)
https://github.com/langchain-ai/langchain/pull/31286 included an update
to the return type for `BaseChatModel.(a)stream`, from
`Iterator[BaseMessageChunk]` to `Iterator[BaseMessage]`.

This change is correct, because when streaming is disabled, the stream
methods return an iterator of `BaseMessage`, and the inheritance is such
that an `BaseMessage` is not a `BaseMessageChunk` (but the reverse is
true).

However, LangChain includes a pattern throughout its docs of [summing
BaseMessageChunks](https://python.langchain.com/docs/how_to/streaming/#llms-and-chat-models)
to accumulate a chat model stream. This pattern is implemented in tests
for most integration packages and appears in application code. So
https://github.com/langchain-ai/langchain/pull/31286 introduces mypy
errors throughout the ecosystem (or maybe more accurately, it reveals
that this pattern does not account for use of the `.stream` method when
streaming is disabled).

Here we revert just the change to the stream return type to unblock
things. A fix for this should address docs + integration packages (or if
we elect to just force people to update code, be explicit about that).
2025-06-05 11:20:06 -04:00
Eugene Yurtsev
b149cce5f8
Revert "docs: replace deprecated initialize_agent with create_react_agent and non-deprecated functions" (#31492)
Reverts langchain-ai/langchain#31361
2025-06-04 14:42:47 +00:00
Michael Li
222578b296
docs: fix grammar issues in rag_with_quantized_embeddings.ipynb and imessage.ipynb (#31460) 2025-06-04 10:28:55 -04:00
Michael Li
e845a83099
docs: fix grammar issues in airbyte_typeform.ipynb and airbyte_zendes… (#31476) 2025-06-04 10:28:32 -04:00
Michael Li
457b235b5d
docs: fix grammar issues in alibaba_cloud_maxcompute.ipynb and async_chromium.ipynb (#31477) 2025-06-04 10:28:01 -04:00
Michael Li
d2a023a183
docs: fix grammar and typo issues in async_html.ipynb and azure_blob_storage_file.ipynb (#31478) 2025-06-04 10:27:44 -04:00
Michael Li
21d6f1fc6a
docs: fix lets typos in multiple files (#31481)
Fix typo
2025-06-04 10:27:16 -04:00
Ahmad Elmalah
f97e1825b7
Docs: Amazon Textract Page - removing a redundancy and fixing a title (#31488)
- The second 'the' is redundant 
- Fixing the title grammatically
2025-06-04 10:26:51 -04:00
Ahmed Hassan
81db124351
docs: replace deprecated initialize_agent with create_react_agent and non-deprecated functions (#31361)
**Description:**  
This PR updates approximately 4' occurences of the deprecated
`initialize_agent` function in LangChain documentation and examples,
replacing it with the recommended `create_react_agent` and pattern. It
also refactors related examples to align with current best practices.

**Issue:**  
Partially Fixes #29277


**Dependencies:**  
None

**X handle:**  
@TK1475

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-06-04 10:24:30 -04:00
Marlene
4ec46aeb73
Docs: Updating Microsoft Provider Documentation to Include Azure AI (#31467)
This PR adds documentation to our Microsft Provider page for LangChain
Azure AI. This PR does not add any extra dependencies or require any
tests besides passing CI.
2025-06-04 10:23:01 -04:00
Cheney Zhang
993e34fafb
docs: Update Milvus feature table (#31472)
We found the [table of langchain milvus
feature](https://python.langchain.com/docs/integrations/vectorstores/)
is not consistent with the currently implemented code. So we change it
with a PR.

- searchByVector: code is
[here](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L1543))
- passesStandardTests: All methods will be tested(including unittest and
integration test) , see an example [here](
https://github.com/langchain-ai/langchain-milvus/actions/runs/15347213828/job/43186093988)
, the test code it
[here](https://github.com/langchain-ai/langchain-milvus/tree/main/libs/milvus/tests)
and the github workflow is defined
[here](https://github.com/langchain-ai/langchain-milvus/blob/main/.github/workflows/_test.yml)
- multiTenancy: milvus supports different kinds of [multi
tenancy](https://milvus.io/docs/multi_tenancy.md#Implement-Multi-tenancy),
they also implemented by langchain_milvus
- database level: specify the database name in
[connection_args](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L374))
- collection level: specify the collection in [collection_name
param](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L337))
- partition level: specify the [partition-related params
](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L280))
- idsInAddDocuments: [add document
method](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L2030))
supports ids param passed in( then passed to add_texts method
[here](e29ff1bff5/libs/milvus/langchain_milvus/vectorstores/milvus.py (L1102)))
@ccurme  please take a review, thanks.

Signed-off-by: ChengZi <chen.zhang@zilliz.com>
2025-06-03 16:56:52 -04:00
Bagatur
ec8bab83f8
anthropic[fix]: bump langchain-core dep (#31483) 2025-06-03 10:56:48 -04:00
Bagatur
310e643842
release[anthropic]: 0.3.15 (#31479)
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-06-03 10:38:11 -04:00
Ahmad Elmalah
e70ec3b9fa
Docs: Textract Integration Page - Fixing a typo (#31475)
Fixing a little typo in AWS textract integration page
2025-06-03 10:10:40 -04:00
Michael Li
9649222322
docs: fix typo in multiple files (#31480)
Fix typo
2025-06-03 10:10:20 -04:00
Christophe Bornet
539e5b6936
core: Add mypy strict-equality rule (#31286) 2025-06-02 18:24:35 +00:00
Sam Zhang
2c4e0ab3bc
fix: module 'defusedxml' has no attribute 'ElementTree' (#31429) (#31431)
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-06-02 18:09:22 +00:00