Skip to content

Commit c032aa7

Browse files
authored
Merge branch 'master' into pprados/07-zeroxpdf
2 parents 0d701f0 + 5237987 commit c032aa7

File tree

33 files changed

+3665
-260
lines changed

33 files changed

+3665
-260
lines changed

.github/workflows/_release.yml

Lines changed: 101 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,32 @@ jobs:
100100
PKG_NAME: ${{ needs.build.outputs.pkg-name }}
101101
VERSION: ${{ needs.build.outputs.version }}
102102
run: |
103-
PREV_TAG="$PKG_NAME==${VERSION%.*}.$(( ${VERSION##*.} - 1 ))"; [[ "${VERSION##*.}" -eq 0 ]] && PREV_TAG=""
104-
105-
# backup case if releasing e.g. 0.3.0, looks up last release
106-
# note if last release (chronologically) was e.g. 0.1.47 it will get
107-
# that instead of the last 0.2 release
108-
if [ -z "$PREV_TAG" ]; then
109-
REGEX="^$PKG_NAME==\\d+\\.\\d+\\.\\d+\$"
110-
echo $REGEX
111-
PREV_TAG=$(git tag --sort=-creatordate | (grep -P $REGEX || true) | head -1)
103+
# Handle regular versions and pre-release versions differently
104+
if [[ "$VERSION" == *"-"* ]]; then
105+
# This is a pre-release version (contains a hyphen)
106+
# Extract the base version without the pre-release suffix
107+
BASE_VERSION=${VERSION%%-*}
108+
# Look for the latest release of the same base version
109+
REGEX="^$PKG_NAME==$BASE_VERSION\$"
110+
PREV_TAG=$(git tag --sort=-creatordate | (grep -P "$REGEX" || true) | head -1)
111+
112+
# If no exact base version match, look for the latest release of any kind
113+
if [ -z "$PREV_TAG" ]; then
114+
REGEX="^$PKG_NAME==\\d+\\.\\d+\\.\\d+\$"
115+
PREV_TAG=$(git tag --sort=-creatordate | (grep -P "$REGEX" || true) | head -1)
116+
fi
117+
else
118+
# Regular version handling
119+
PREV_TAG="$PKG_NAME==${VERSION%.*}.$(( ${VERSION##*.} - 1 ))"; [[ "${VERSION##*.}" -eq 0 ]] && PREV_TAG=""
120+
121+
# backup case if releasing e.g. 0.3.0, looks up last release
122+
# note if last release (chronologically) was e.g. 0.1.47 it will get
123+
# that instead of the last 0.2 release
124+
if [ -z "$PREV_TAG" ]; then
125+
REGEX="^$PKG_NAME==\\d+\\.\\d+\\.\\d+\$"
126+
echo $REGEX
127+
PREV_TAG=$(git tag --sort=-creatordate | (grep -P $REGEX || true) | head -1)
128+
fi
112129
fi
113130
114131
# if PREV_TAG is empty, let it be empty
@@ -312,12 +329,87 @@ jobs:
312329
run: make integration_tests
313330
working-directory: ${{ inputs.working-directory }}
314331

332+
# Test select published packages against new core
333+
test-prior-published-packages-against-new-core:
334+
needs:
335+
- build
336+
- release-notes
337+
- test-pypi-publish
338+
- pre-release-checks
339+
if: ${{ startsWith(inputs.working-directory, 'libs/core') }}
340+
runs-on: ubuntu-latest
341+
strategy:
342+
matrix:
343+
partner: [openai, anthropic]
344+
fail-fast: false # Continue testing other partners if one fails
345+
env:
346+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
347+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
348+
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
349+
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
350+
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
351+
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
352+
AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME }}
353+
AZURE_OPENAI_LLM_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LLM_DEPLOYMENT_NAME }}
354+
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME }}
355+
steps:
356+
- uses: actions/checkout@v4
357+
358+
- name: Set up Python + uv
359+
uses: "./.github/actions/uv_setup"
360+
with:
361+
python-version: ${{ env.PYTHON_VERSION }}
362+
363+
- uses: actions/download-artifact@v4
364+
with:
365+
name: dist
366+
path: ${{ inputs.working-directory }}/dist/
367+
368+
- name: Test against ${{ matrix.partner }}
369+
run: |
370+
# Identify latest tag
371+
LATEST_PACKAGE_TAG="$(
372+
git ls-remote --tags origin "langchain-${{ matrix.partner }}*" \
373+
| awk '{print $2}' \
374+
| sed 's|refs/tags/||' \
375+
| sort -Vr \
376+
| head -n 1
377+
)"
378+
echo "Latest package tag: $LATEST_PACKAGE_TAG"
379+
380+
# Shallow-fetch just that single tag
381+
git fetch --depth=1 origin tag "$LATEST_PACKAGE_TAG"
382+
383+
# Checkout the latest package files
384+
rm -rf $GITHUB_WORKSPACE/libs/partners/${{ matrix.partner }}/*
385+
cd $GITHUB_WORKSPACE/libs/partners/${{ matrix.partner }}
386+
git checkout "$LATEST_PACKAGE_TAG" -- .
387+
388+
# Print as a sanity check
389+
echo "Version number from pyproject.toml: "
390+
cat pyproject.toml | grep "version = "
391+
392+
# Run tests
393+
uv sync --group test --group test_integration
394+
uv pip install ../../core/dist/*.whl
395+
make integration_tests
396+
315397
publish:
316398
needs:
317399
- build
318400
- release-notes
319401
- test-pypi-publish
320402
- pre-release-checks
403+
- test-prior-published-packages-against-new-core
404+
if: >
405+
always() &&
406+
needs.build.result == 'success' &&
407+
needs.release-notes.result == 'success' &&
408+
needs.test-pypi-publish.result == 'success' &&
409+
needs.pre-release-checks.result == 'success' && (
410+
(startsWith(inputs.working-directory, 'libs/core') && needs.test-prior-published-packages-against-new-core.result == 'success')
411+
|| (!startsWith(inputs.working-directory, 'libs/core'))
412+
)
321413
runs-on: ubuntu-latest
322414
permissions:
323415
# This permission is used for trusted publishing:

README.md

Lines changed: 65 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# 🦜️🔗 LangChain
1+
<picture>
2+
<source media="(prefers-color-scheme: light)" srcset="docs/static/img/logo-dark.svg">
3+
<source media="(prefers-color-scheme: dark)" srcset="docs/static/img/logo-light.svg">
4+
<img alt="LangChain Logo" src="docs/static/img/logo-dark.svg" width="80%">
5+
</picture>
26

3-
⚡ Build context-aware reasoning applications ⚡
7+
<div>
8+
<br>
9+
</div>
410

511
[![Release Notes](https://img.shields.io/github/release/langchain-ai/langchain?style=flat-square)](https://github.com/langchain-ai/langchain/releases)
612
[![CI](https://github.com/langchain-ai/langchain/actions/workflows/check_diffs.yml/badge.svg)](https://github.com/langchain-ai/langchain/actions/workflows/check_diffs.yml)
@@ -12,131 +18,65 @@
1218
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/langchain-ai/langchain)
1319
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai)
1420

15-
Looking for the JS/TS library? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs).
21+
> [!NOTE]
22+
> Looking for the JS/TS library? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs).
1623
17-
To help you ship LangChain apps to production faster, check out [LangSmith](https://smith.langchain.com).
18-
[LangSmith](https://smith.langchain.com) is a unified developer platform for building, testing, and monitoring LLM applications.
19-
Fill out [this form](https://www.langchain.com/contact-sales) to speak with our sales team.
20-
21-
## Quick Install
22-
23-
With pip:
24-
25-
```bash
26-
pip install langchain
27-
```
28-
29-
With conda:
24+
LangChain is a framework for building LLM-powered applications. It helps you chain
25+
together interoperable components and third-party integrations to simplify AI
26+
application development — all while future-proofing decisions as the underlying
27+
technology evolves.
3028

3129
```bash
32-
conda install langchain -c conda-forge
30+
pip install -U langchain
3331
```
3432

35-
## 🤔 What is LangChain?
36-
37-
**LangChain** is a framework for developing applications powered by large language models (LLMs).
38-
39-
For these applications, LangChain simplifies the entire application lifecycle:
40-
41-
42-
- **Open-source libraries**: Build your applications using LangChain's open-source
43-
[components](https://python.langchain.com/docs/concepts/) and
44-
[third-party integrations](https://python.langchain.com/docs/integrations/providers/).
45-
Use [LangGraph](https://langchain-ai.github.io/langgraph/) to build stateful agents with first-class streaming and human-in-the-loop support.
46-
- **Productionization**: Inspect, monitor, and evaluate your apps with [LangSmith](https://docs.smith.langchain.com/) so that you can constantly optimize and deploy with confidence.
47-
- **Deployment**: Turn your LangGraph applications into production-ready APIs and Assistants with [LangGraph Platform](https://langchain-ai.github.io/langgraph/cloud/).
48-
49-
### Open-source libraries
50-
51-
- **`langchain-core`**: Base abstractions.
52-
- **Integration packages** (e.g. **`langchain-openai`**, **`langchain-anthropic`**, etc.): Important integrations have been split into lightweight packages that are co-maintained by the LangChain team and the integration developers.
53-
- **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.
54-
- **`langchain-community`**: Third-party integrations that are community maintained.
55-
- **[LangGraph](https://langchain-ai.github.io/langgraph)**: LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more. Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. Integrates smoothly with LangChain, but can be used without it. To learn more about LangGraph, check out our first LangChain Academy course, *Introduction to LangGraph*, available [here](https://academy.langchain.com/courses/intro-to-langgraph).
56-
57-
### Productionization:
58-
59-
- **[LangSmith](https://docs.smith.langchain.com/)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain.
60-
61-
### Deployment:
62-
63-
- **[LangGraph Platform](https://langchain-ai.github.io/langgraph/cloud/)**: Turn your LangGraph applications into production-ready APIs and Assistants.
64-
65-
![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](docs/static/svg/langchain_stack_112024.svg#gh-light-mode-only "LangChain Architecture Overview")
66-
![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](docs/static/svg/langchain_stack_112024_dark.svg#gh-dark-mode-only "LangChain Architecture Overview")
67-
68-
## 🧱 What can you build with LangChain?
69-
70-
**❓ Question answering with RAG**
71-
72-
- [Documentation](https://python.langchain.com/docs/tutorials/rag/)
73-
- End-to-end Example: [Chat LangChain](https://chat.langchain.com) and [repo](https://github.com/langchain-ai/chat-langchain)
74-
75-
**🧱 Extracting structured output**
76-
77-
- [Documentation](https://python.langchain.com/docs/tutorials/extraction/)
78-
- End-to-end Example: [LangChain Extract](https://github.com/langchain-ai/langchain-extract/)
79-
80-
**🤖 Chatbots**
81-
82-
- [Documentation](https://python.langchain.com/docs/tutorials/chatbot/)
83-
- End-to-end Example: [Web LangChain (web researcher chatbot)](https://weblangchain.vercel.app) and [repo](https://github.com/langchain-ai/weblangchain)
84-
85-
And much more! Head to the [Tutorials](https://python.langchain.com/docs/tutorials/) section of the docs for more.
86-
87-
## 🚀 How does LangChain help?
88-
89-
The main value props of the LangChain libraries are:
90-
91-
1. **Components**: composable building blocks, tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not.
92-
2. **Easy orchestration with LangGraph**: [LangGraph](https://langchain-ai.github.io/langgraph/),
93-
built on top of `langchain-core`, has built-in support for [messages](https://python.langchain.com/docs/concepts/messages/), [tools](https://python.langchain.com/docs/concepts/tools/),
94-
and other LangChain abstractions. This makes it easy to combine components into
95-
production-ready applications with persistence, streaming, and other key features.
96-
Check out the LangChain [tutorials page](https://python.langchain.com/docs/tutorials/#orchestration) for examples.
97-
98-
## Components
99-
100-
Components fall into the following **modules**:
101-
102-
**📃 Model I/O**
103-
104-
This includes [prompt management](https://python.langchain.com/docs/concepts/prompt_templates/)
105-
and a generic interface for [chat models](https://python.langchain.com/docs/concepts/chat_models/), including a consistent interface for [tool-calling](https://python.langchain.com/docs/concepts/tool_calling/) and [structured output](https://python.langchain.com/docs/concepts/structured_outputs/) across model providers.
106-
107-
**📚 Retrieval**
108-
109-
Retrieval Augmented Generation involves [loading data](https://python.langchain.com/docs/concepts/document_loaders/) from a variety of sources, [preparing it](https://python.langchain.com/docs/concepts/text_splitters/), then [searching over (a.k.a. retrieving from)](https://python.langchain.com/docs/concepts/retrievers/) it for use in the generation step.
110-
111-
**🤖 Agents**
112-
113-
Agents allow an LLM autonomy over how a task is accomplished. Agents make decisions about which Actions to take, then take that Action, observe the result, and repeat until the task is complete. [LangGraph](https://langchain-ai.github.io/langgraph/) makes it easy to use
114-
LangChain components to build both [custom](https://langchain-ai.github.io/langgraph/tutorials/)
115-
and [built-in](https://langchain-ai.github.io/langgraph/how-tos/create-react-agent/)
116-
LLM agents.
117-
118-
## 📖 Documentation
119-
120-
Please see [here](https://python.langchain.com) for full documentation, which includes:
121-
122-
- [Introduction](https://python.langchain.com/docs/introduction/): Overview of the framework and the structure of the docs.
123-
- [Tutorials](https://python.langchain.com/docs/tutorials/): If you're looking to build something specific or are more of a hands-on learner, check out our tutorials. This is the best place to get started.
124-
- [How-to guides](https://python.langchain.com/docs/how_to/): Answers to “How do I….?” type questions. These guides are goal-oriented and concrete; they're meant to help you complete a specific task.
125-
- [Conceptual guide](https://python.langchain.com/docs/concepts/): Conceptual explanations of the key parts of the framework.
126-
- [API Reference](https://python.langchain.com/api_reference/): Thorough documentation of every class and method.
127-
128-
## 🌐 Ecosystem
129-
130-
- [🦜🛠️ LangSmith](https://docs.smith.langchain.com/): Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production.
131-
- [🦜🕸️ LangGraph](https://langchain-ai.github.io/langgraph/): Create stateful, multi-actor applications with LLMs. Integrates smoothly with LangChain, but can be used without it.
132-
- [🦜🕸️ LangGraph Platform](https://langchain-ai.github.io/langgraph/concepts/#langgraph-platform): Deploy LLM applications built with LangGraph into production.
133-
134-
## 💁 Contributing
135-
136-
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
137-
138-
For detailed information on how to contribute, see [here](https://python.langchain.com/docs/contributing/).
139-
140-
## 🌟 Contributors
141-
142-
[![langchain contributors](https://contrib.rocks/image?repo=langchain-ai/langchain&max=2000)](https://github.com/langchain-ai/langchain/graphs/contributors)
33+
To learn more about LangChain, check out
34+
[the docs](https://python.langchain.com/docs/introduction/). If you’re looking for more
35+
advanced customization or agent orchestration, check out
36+
[LangGraph](https://langchain-ai.github.io/langgraph/), our framework for building
37+
controllable agent workflows.
38+
39+
## Why use LangChain?
40+
41+
LangChain helps developers build applications powered by LLMs through a standard
42+
interface for models, embeddings, vector stores, and more.
43+
44+
Use LangChain for:
45+
- **Real-time data augmentation**. Easily connect LLMs to diverse data sources and
46+
external / internal systems, drawing from LangChain’s vast library of integrations with
47+
model providers, tools, vector stores, retrievers, and more.
48+
- **Model interoperability**. Swap models in and out as your engineering team
49+
experiments to find the best choice for your application’s needs. As the industry
50+
frontier evolves, adapt quickly — LangChain’s abstractions keep you moving without
51+
losing momentum.
52+
53+
## LangChain’s ecosystem
54+
While the LangChain framework can be used standalone, it also integrates seamlessly
55+
with any LangChain product, giving developers a full suite of tools when building LLM
56+
applications.
57+
58+
To improve your LLM application development, pair LangChain with:
59+
60+
- [LangSmith](http://www.langchain.com/langsmith) - Helpful for agent evals and
61+
observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain
62+
visibility in production, and improve performance over time.
63+
- [LangGraph](https://langchain-ai.github.io/langgraph/) - Build agents that can
64+
reliably handle complex tasks with LangGraph, our low-level agent orchestration
65+
framework. LangGraph offers customizable architecture, long-term memory, and
66+
human-in-the-loop workflows — and is trusted in production by companies like LinkedIn,
67+
Uber, Klarna, and GitLab.
68+
- [LangGraph Platform](https://langchain-ai.github.io/langgraph/concepts/#langgraph-platform) - Deploy
69+
and scale agents effortlessly with a purpose-built deployment platform for long
70+
running, stateful workflows. Discover, reuse, configure, and share agents across
71+
teams — and iterate quickly with visual prototyping in
72+
[LangGraph Studio](https://langchain-ai.github.io/langgraph/concepts/langgraph_studio/).
73+
74+
## Additional resources
75+
- [Tutorials](https://python.langchain.com/docs/tutorials/): Simple walkthroughs with
76+
guided examples on getting started with LangChain.
77+
- [How-to Guides](https://python.langchain.com/docs/how_to/): Quick, actionable code
78+
snippets for topics such as tool calling, RAG use cases, and more.
79+
- [Conceptual Guides](https://python.langchain.com/docs/concepts/): Explanations of key
80+
concepts behind the LangChain framework.
81+
- [API Reference](https://python.langchain.com/api_reference/): Detailed reference on
82+
navigating base packages and integrations for LangChain.

0 commit comments

Comments
 (0)