Skip to content

Commit 5917732

Browse files
authored
Merge branch 'master' into fix-33684
2 parents d79a2f1 + 8aea6dd commit 5917732

File tree

112 files changed

+1759
-766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1759
-766
lines changed

.github/scripts/check_diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]:
134134
elif dir_ == "libs/core":
135135
py_versions = ["3.10", "3.11", "3.12", "3.13", "3.14"]
136136
# custom logic for specific directories
137-
elif dir_ in {"libs/partners/chroma", "libs/partners/nomic"}:
137+
elif dir_ in {"libs/partners/chroma"}:
138138
py_versions = ["3.10", "3.13"]
139139
else:
140140
py_versions = ["3.10", "3.14"]

.github/workflows/_release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
working-directory: ${{ inputs.working-directory }}
7878

7979
- name: Upload build
80-
uses: actions/upload-artifact@v4
80+
uses: actions/upload-artifact@v5
8181
with:
8282
name: dist
8383
path: ${{ inputs.working-directory }}/dist/
@@ -208,7 +208,7 @@ jobs:
208208
steps:
209209
- uses: actions/checkout@v5
210210

211-
- uses: actions/download-artifact@v5
211+
- uses: actions/download-artifact@v6
212212
with:
213213
name: dist
214214
path: ${{ inputs.working-directory }}/dist/
@@ -258,7 +258,7 @@ jobs:
258258
with:
259259
python-version: ${{ env.PYTHON_VERSION }}
260260

261-
- uses: actions/download-artifact@v5
261+
- uses: actions/download-artifact@v6
262262
with:
263263
name: dist
264264
path: ${{ inputs.working-directory }}/dist/
@@ -395,7 +395,7 @@ jobs:
395395
contents: read
396396
strategy:
397397
matrix:
398-
partner: [openai, anthropic]
398+
partner: [anthropic]
399399
fail-fast: false # Continue testing other partners if one fails
400400
env:
401401
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
@@ -428,7 +428,7 @@ jobs:
428428
with:
429429
python-version: ${{ env.PYTHON_VERSION }}
430430

431-
- uses: actions/download-artifact@v5
431+
- uses: actions/download-artifact@v6
432432
if: startsWith(inputs.working-directory, 'libs/core')
433433
with:
434434
name: dist
@@ -497,7 +497,7 @@ jobs:
497497
with:
498498
python-version: ${{ env.PYTHON_VERSION }}
499499

500-
- uses: actions/download-artifact@v5
500+
- uses: actions/download-artifact@v6
501501
with:
502502
name: dist
503503
path: ${{ inputs.working-directory }}/dist/
@@ -537,7 +537,7 @@ jobs:
537537
with:
538538
python-version: ${{ env.PYTHON_VERSION }}
539539

540-
- uses: actions/download-artifact@v5
540+
- uses: actions/download-artifact@v6
541541
with:
542542
name: dist
543543
path: ${{ inputs.working-directory }}/dist/

.github/workflows/pr_lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# core, cli, langchain, langchain_v1, langchain-classic, standard-tests,
3131
# text-splitters, docs, anthropic, chroma, deepseek, exa, fireworks, groq,
3232
# huggingface, mistralai, nomic, ollama, openai, perplexity, prompty, qdrant,
33-
# xai, infra
33+
# xai, infra, deps
3434
#
3535
# Rules:
3636
# 1. The 'Type' must start with a lowercase letter.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.vs/
22
.claude/
33
.idea/
4+
#Emacs backup
5+
*~
46
# Byte-compiled / optimized / DLL files
57
__pycache__/
68
*.py[cod]

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,19 @@
3434
</a>
3535
</p>
3636

37-
LangChain is a framework for building LLM-powered applications. It helps you chain together interoperable components and third-party integrations to simplify AI application development — all while future-proofing decisions as the underlying technology evolves.
37+
LangChain is a framework for building agents and LLM-powered applications. It helps you chain together interoperable components and third-party integrations to simplify AI application development — all while future-proofing decisions as the underlying technology evolves.
3838

3939
```bash
4040
pip install langchain
4141
```
4242

43+
If you're looking for more advanced customization or agent orchestration, check out [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview), our framework for building controllable agent workflows.
44+
4345
---
4446

4547
**Documentation**: To learn more about LangChain, check out [the docs](https://docs.langchain.com/oss/python/langchain/overview).
4648

47-
If you're looking for more advanced customization or agent orchestration, check out [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview), our framework for building controllable agent workflows.
49+
**Discussions**: Visit the [LangChain Forum](https://forum.langchain.com) to connect with the community and share all of your technical questions, ideas, and feedback.
4850

4951
> [!NOTE]
5052
> Looking for the JS/TS library? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs).
@@ -58,21 +60,18 @@ Use LangChain for:
5860
- **Real-time data augmentation**. Easily connect LLMs to diverse data sources and external/internal systems, drawing from LangChain’s vast library of integrations with model providers, tools, vector stores, retrievers, and more.
5961
- **Model interoperability**. Swap models in and out as your engineering team experiments to find the best choice for your application’s needs. As the industry frontier evolves, adapt quickly — LangChain’s abstractions keep you moving without losing momentum.
6062

61-
## LangChain’s ecosystem
63+
## LangChain ecosystem
6264

6365
While the LangChain framework can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools when building LLM applications.
6466

6567
To improve your LLM application development, pair LangChain with:
6668

67-
- [LangSmith](https://www.langchain.com/langsmith) - Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time.
6869
- [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) - Build agents that can reliably handle complex tasks with LangGraph, our low-level agent orchestration framework. LangGraph offers customizable architecture, long-term memory, and human-in-the-loop workflows — and is trusted in production by companies like LinkedIn, Uber, Klarna, and GitLab.
69-
- [LangGraph Platform](https://docs.langchain.com/langgraph-platform) - Deploy and scale agents effortlessly with a purpose-built deployment platform for long-running, stateful workflows. Discover, reuse, configure, and share agents across teams — and iterate quickly with visual prototyping in [LangGraph Studio](https://langchain-ai.github.io/langgraph/concepts/langgraph_studio).
70+
- [LangSmith](https://www.langchain.com/langsmith) - Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time.
71+
- [LangSmith Deployment](https://docs.langchain.com/langsmith/deployments) - Deploy and scale agents effortlessly with a purpose-built deployment platform for long-running, stateful workflows. Discover, reuse, configure, and share agents across teams — and iterate quickly with visual prototyping in [LangSmith Studio](https://docs.langchain.com/langsmith/studio).
7072

7173
## Additional resources
7274

73-
- [Learn](https://docs.langchain.com/oss/python/learn): Use cases, conceptual overviews, and more.
74-
- [API Reference](https://reference.langchain.com/python): Detailed reference on
75-
navigating base packages and integrations for LangChain.
75+
- [API Reference](https://reference.langchain.com/python): Detailed reference on navigating base packages and integrations for LangChain.
76+
- [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview): List of LangChain integrations, including chat & embedding models, tools & toolkits, and more
7677
- [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview): Learn how to contribute to LangChain and find good first issues.
77-
- [LangChain Forum](https://forum.langchain.com): Connect with the community and share all of your technical questions, ideas, and feedback.
78-
- [Chat LangChain](https://chat.langchain.com): Ask questions & chat with our documentation.

libs/core/langchain_core/agents.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
66
!!! warning
77
New agents should be built using the
8-
[langgraph library](https://github.com/langchain-ai/langgraph), which provides a
8+
[`langchain` library](https://pypi.org/project/langchain/), which provides a
99
simpler and more flexible way to define agents.
1010
11-
Please see the
12-
[migration guide](https://python.langchain.com/docs/how_to/migrate_agent/) for
13-
information on how to migrate existing agents to modern langgraph agents.
11+
See docs on [building agents](https://docs.langchain.com/oss/python/langchain/agents).
1412
1513
Agents use language models to choose a sequence of actions to take.
1614

libs/core/langchain_core/chat_history.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ def add_user_message(self, message: HumanMessage | str) -> None:
121121
This method may be deprecated in a future release.
122122
123123
Args:
124-
message: The human message to add to the store.
124+
message: The `HumanMessage` to add to the store.
125125
"""
126126
if isinstance(message, HumanMessage):
127127
self.add_message(message)
128128
else:
129129
self.add_message(HumanMessage(content=message))
130130

131131
def add_ai_message(self, message: AIMessage | str) -> None:
132-
"""Convenience method for adding an AI message string to the store.
132+
"""Convenience method for adding an `AIMessage` string to the store.
133133
134134
!!! note
135135
This is a convenience method. Code should favor the bulk `add_messages`
@@ -138,7 +138,7 @@ def add_ai_message(self, message: AIMessage | str) -> None:
138138
This method may be deprecated in a future release.
139139
140140
Args:
141-
message: The AI message to add.
141+
message: The `AIMessage` to add.
142142
"""
143143
if isinstance(message, AIMessage):
144144
self.add_message(message)
@@ -173,7 +173,7 @@ def add_messages(self, messages: Sequence[BaseMessage]) -> None:
173173
in an efficient manner to avoid unnecessary round-trips to the underlying store.
174174
175175
Args:
176-
messages: A sequence of BaseMessage objects to store.
176+
messages: A sequence of `BaseMessage` objects to store.
177177
"""
178178
for message in messages:
179179
self.add_message(message)
@@ -182,7 +182,7 @@ async def aadd_messages(self, messages: Sequence[BaseMessage]) -> None:
182182
"""Async add a list of messages.
183183
184184
Args:
185-
messages: A sequence of BaseMessage objects to store.
185+
messages: A sequence of `BaseMessage` objects to store.
186186
"""
187187
await run_in_executor(None, self.add_messages, messages)
188188

libs/core/langchain_core/document_loaders/base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class BaseLoader(ABC): # noqa: B024
2727
"""Interface for Document Loader.
2828
2929
Implementations should implement the lazy-loading method using generators
30-
to avoid loading all Documents into memory at once.
30+
to avoid loading all documents into memory at once.
3131
3232
`load` is provided just for user convenience and should not be overridden.
3333
"""
@@ -53,9 +53,11 @@ async def aload(self) -> list[Document]:
5353
def load_and_split(
5454
self, text_splitter: TextSplitter | None = None
5555
) -> list[Document]:
56-
"""Load Documents and split into chunks. Chunks are returned as `Document`.
56+
"""Load `Document` and split into chunks. Chunks are returned as `Document`.
5757
58-
Do not override this method. It should be considered to be deprecated!
58+
!!! danger
59+
60+
Do not override this method. It should be considered to be deprecated!
5961
6062
Args:
6163
text_splitter: `TextSplitter` instance to use for splitting documents.
@@ -135,7 +137,7 @@ def lazy_parse(self, blob: Blob) -> Iterator[Document]:
135137
"""
136138

137139
def parse(self, blob: Blob) -> list[Document]:
138-
"""Eagerly parse the blob into a `Document` or `Document` objects.
140+
"""Eagerly parse the blob into a `Document` or list of `Document` objects.
139141
140142
This is a convenience method for interactive development environment.
141143

libs/core/langchain_core/document_loaders/blob_loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BlobLoader(ABC):
2828
def yield_blobs(
2929
self,
3030
) -> Iterable[Blob]:
31-
"""A lazy loader for raw data represented by LangChain's Blob object.
31+
"""A lazy loader for raw data represented by LangChain's `Blob` object.
3232
3333
Returns:
3434
A generator over blobs

libs/core/langchain_core/document_loaders/langsmith.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515

1616
class LangSmithLoader(BaseLoader):
17-
"""Load LangSmith Dataset examples as Documents.
17+
"""Load LangSmith Dataset examples as `Document` objects.
1818
19-
Loads the example inputs as the Document page content and places the entire example
20-
into the Document metadata. This allows you to easily create few-shot example
21-
retrievers from the loaded documents.
19+
Loads the example inputs as the `Document` page content and places the entire
20+
example into the `Document` metadata. This allows you to easily create few-shot
21+
example retrievers from the loaded documents.
2222
23-
??? note "Lazy load"
23+
??? note "Lazy loading example"
2424
2525
```python
2626
from langchain_core.document_loaders import LangSmithLoader
@@ -66,12 +66,11 @@ def __init__(
6666
format_content: Function for converting the content extracted from the example
6767
inputs into a string. Defaults to JSON-encoding the contents.
6868
example_ids: The IDs of the examples to filter by.
69-
as_of: The dataset version tag OR
70-
timestamp to retrieve the examples as of.
71-
Response examples will only be those that were present at the time
72-
of the tagged (or timestamped) version.
69+
as_of: The dataset version tag or timestamp to retrieve the examples as of.
70+
Response examples will only be those that were present at the time of
71+
the tagged (or timestamped) version.
7372
splits: A list of dataset splits, which are
74-
divisions of your dataset such as 'train', 'test', or 'validation'.
73+
divisions of your dataset such as `train`, `test`, or `validation`.
7574
Returns examples only from the specified splits.
7675
inline_s3_urls: Whether to inline S3 URLs.
7776
offset: The offset to start from.

0 commit comments

Comments
 (0)