Commit Graph
121 Commits
Author SHA1 Message Date
219b372051 fix(deepseek,infra): resolve compatible minimum OpenAI dependencies, bump min ver (#40738)
- The [DeepSeek release
check](https://github.com/langchain-ai/langchain/actions/runs/35686046493/job/106613011631)
downgraded core to 1.4.7 while retaining local OpenAI 1.6.3, which
requires core 1.6.4. Include `langchain-openai` in release
minimum-version selection so both dependencies are resolved together;
preserve local packages during PR checks.
- Raise DeepSeek's OpenAI minimum to 1.3.1: testing the old 1.1.0 floor
exposes missing model-profile behavior and package-version metadata. Add
regression coverage for release and PR dependency selection.

## Release note
`langchain-deepseek` now requires `langchain-openai>=1.3.1` for model
profiles and package-version metadata.

Made by [Open SWE](https://github.com/langchain-ai/open-swe) · [view
thread](https://openswe.vercel.app/agents/ed7f0398-e808-5f5b-9eb4-0521c82fff7f)
· openai:gpt-6-astra (low)

Co-authored-by: Mason <mdrxy@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-09-22 00:27:19 -04:00
Hunter Lovell d1fee60ef2 feat(typesafe): TypeSafeClassifier (#40542)
Adds a first-party `langchain-typesafe` partner package for making
structured decisions using the new and shiny `jev` model. It introduces
a new `TypeSafeClassifier` runnable while using the typesafe wire
protocol, message normalization, response parsing, and provider failures
behind a standard LangChain interface.

- Supports TypeSafe's `Choice`, `Noul`, and `Score` primitives with
typed answers, probabilities, confidence, usage metadata, and request
IDs.
- Resolves credentials and API configuration from explicit arguments or
`TYPESAFE_API_KEY` and `TYPESAFE_BASE_URL`.
- Supports injected `httpx2.Client` and `httpx2.AsyncClient` instances
for custom transports, proxies, test fixtures, and shared connection
pools (matching patterns of other provider packages in this repo)

---

There were a couple of rapid fire design decisions that I'll document
here to aid in review:

### Extending base `Runnable`

This is largely the impetus for this PR; we can use typesafe's native
python client, but we lose tracing if it isn't captured through the
runnable interface. I imagine because this is a different model we want
to attribute its costs and things in tracing (at a later point in time)

### Direct `httpx2` integration

This package implements the System One `POST /v1/systemone` contract
directly rather than wrapping `typesafe-sdk` (the status quo of other
integrations in langchain). This keeps the integration's public types
and behavior native, avoids adding a transitive dependency, and gives us
lower level controls which is harder to do when indirecting through
someone elses client.

Aspirationally this is a direction we've wanted to work towards for
integrations generally:
* The benefit of wrapping an external sdk is that we can stay tied to
the supply-chain of a package thats maintained first party (we don't
need to maintain types, the transitive dependency keeps capabilities up
to date, etc.)
* This was in a time when maintainer attention was limited, and the
focus wasn't on nitty gritty implementation details with a provider
* ^Agents are probably good enough to start shouldering most of the
burden we've encountered in the past
* There's an indirection tax we have to pay when we shove the
responsibility onto a separate package- it makes us harder to design
single abstractions around

Because this is a 0-1 integration, my intention is to trial typesafes'
implementation under a "langchain maintained client" paradigm to see if
this is something that could work more generally

### State typing and message normalization

I had to bifurcate the input state types into `State` and `_StateValue`
representations mostly to respect TypeSafe API invariants: input must be
a string, object, or array. Its private recursive `_StateValue`
representation permits ordinary scalars by itself and through
dicts/sequences.

I'm also adding langchain `BaseMessage` objects and `BaseMessage`
sequences at any nesting level. This is because messages are the most
common unit of context within langchain, and translating between agent
context and classifier context is a very important part of us plugging
jev into the ecosystem. I'm imagining something like this:

```python
class ClassifierMiddleware(AgentMiddleware[AgentState, ContextT, ResponseT]):

    def after_model(self, state):
        result = TypeSafeClassifier(...).invoke(state.messages)
        # do something with results
```


This uses the `convert_to_openai_messages` utility exposed in core since
that is the most context friendly representation we have to pass
messages through to typesafe (which doesn't have any concept of an LLM
message)

### Typed request and response models

Question and answer models use Pydantic because they sit directly on
serialization and validation layers, and I was hoping to meet some of
the invariant criteria that the typesafe API has. Things like:

* request models requiring instructions for every question
* `Score` requiring at least two ordered levels
* rejecting empty model identifiers

Criteria remain JSON-capable rather than being narrowed to strings
because TypeSafe's advanced documentation supports structured
instructions and criteria, even though the compact HTTP reference
presents narrower examples.

(lmk if pydantic is defunct and we should pivot)

### Error handling infrastructure

I wanted to meet the same level of specification that the TypeSafe
Python SDK has with regards to how it represents errors. This package
exports a standard error reference (in `_client_utils.py`) that does
this while also inheriting from alngchains standard `Model*Error`
classes which we recently added. Callers can handle either
TypeSafe-specific metadata or provider-independent model failures.

The package mirrors the TypeSafe Python SDK's status, connection,
timeout, rate-limit, and response-validation exception names.
Status-specific provider errors also inherit from LangChain's standard
`Model*Error` classes, following the OpenAI integration pattern, so
callers can handle either TypeSafe-specific metadata or
provider-independent model failures.

API errors retain structured status, body, headers, request ID,
sanitized endpoint, response-validation field path, and rate-limit delay
metadata where applicable. TypeSafe's `529 Overloaded` response maps to
a retryable `ModelAPIError`, while `429` maps to `ModelRateLimitError`
and preserves `retry_after_ms`.

Automatic retry policy is intentionally outside the initial package
scope. The classified retryable errors and retry metadata provide the
foundation for a focused follow-up without coupling this integration to
a retry policy in its first release.

## Package infrastructure

- Introduces `langchain-typesafe` at version `0.0.1` with typed-package
markers, documentation, unit and integration-compilation coverage, and a
reproducible `uv` lockfile.
- Adds bounded `httpx2>=2.0.0,<3.0.0` and `langchain-core>=1.6.2,<2.0.0`
dependencies. The core minimum provides the standard `Model*Error`
hierarchy used by the provider exceptions.
- Registers the package with repository CI, release automation,
dependency updates, issue routing, and package labeling.

## Release note

Added the new `langchain-typesafe` integration package, including a
composable `TypeSafeClassifier` for typed classification, scoring, and
confidence-aware decisions with TypeSafe's Jev model.

---

This was developed with heavy assistance from Sol, earnestly reviewed by
me, and validated through similar CI patterns established in other
packages
2026-09-17 10:42:16 -07:00
ccurme fd2fbd702b feat(anthropic): support 1.0 sdk (#39938) 2026-08-27 09:21:00 -04:00
Mason Daugherty 5b029268f7 ci(infra): check release dependency pins against PyPI (#38048)
Release PRs now get an earlier dependency-resolution check before merge,
catching unpublished intra-monorepo pins before they can produce broken
wheel metadata. The minimum-version helper also fails with a clear error
when no published PyPI version satisfies a declared constraint, instead
of emitting an invalid `pkg==None` requirement.
2026-06-10 21:03:51 -04:00
Mason Daugherty 2458a7912e ci(infra): port four CI governance workflows (#37511)
Four GitHub Actions workflows ported from the Deep Agents monorepo to
enforce repository hygiene rules that were not previously applied here.

## Changes

- **Fork-main PR guard**: closes PRs from forks whose head is `main` or
`master`, with a sticky comment explaining how to reopen from a feature
branch. Prevents the "Update branch" → admin-override path that lets a
`Merge branch 'master' into master` commit land on the default branch
and bypass squash-only policy. Maintainers can override with a
`bypass-fork-main-check` label.
- **Monthly uv pin bump**: opens a PR on the first of each month to
advance `UV_VERSION` in the composite setup action. Probes
`releases.astral.sh` across four architectures before committing so CI
doesn't race a lagging mirror on fresh-release days — the gap
Dependabot's `github-actions` ecosystem can't cover because it tracks
`uses:` SHA pins, not the inline `UV_VERSION` value.
- **Extras-sync validation**: a Python script (`check_extras_sync.py`)
and companion workflow that detect version-constraint drift between
`[project.dependencies]` and `[project.optional-dependencies]` across
every `libs/**/pyproject.toml`. Runs on PRs touching any
`pyproject.toml` and on pushes to `master`; is a no-op on packages that
declare no extras.
- **Banned-trailer pre-merge lint**: rejects PR descriptions containing
a `Co-authored-by: ... <noreply@anthropic.com>` trailer before the PR
reaches merge, where the org ruleset would reject the squash-push
anyway. Posts a sticky comment with remediation steps; updates it to a
"resolved" state when the trailer is removed, rather than deleting
(which requires elevated token scope on fork PRs).
2026-05-18 17:12:21 -05:00
Mason Daugherty c4c91d9cd3 ci: parse changed files as JSON (#37372)
Avoid interpolating changed file names directly into shell scripts when
building CI matrices.
2026-05-12 22:25:19 -07:00
Mason Daugherty 2d3b49162c ci(infra): shorten working-directory dropdown labels (#36974)
Clean up the `workflow_dispatch` dropdowns for the release and scheduled
integration-test workflows. Showing short package names (`openai`,
`langchain_v1`, ...) instead of `libs/partners/openai` makes the UI in
the Actions tab easier to scan; the prefix now lives in the resolver
rather than every dropdown entry.
2026-04-23 15:53:17 -04:00
Mason Daugherty f2d3a2f6e2 fix(infra): skip codspeed for partners without benchmarks (#36775)
The CodSpeed workflow was failing on partner PRs because `check_diff.py`
added every partner to the `codspeed` matrix unconditionally — even when
no `tests/benchmarks/` directory exists. The workflow then ran an empty
shell block for those partners, CodSpeed saw zero benchmarks, and marked
the check as failed.

Currently no partner package has benchmarks, so this affected every
partner PR.
2026-04-15 17:45:14 -06:00
Eugene Yurtsev 1df6816fbd chore(infra): add langchain to codspeed (#36650)
add langchain to codspeed
2026-04-10 10:48:42 -04:00
Mason Daugherty ce21bf469d ci: convert working-directory to validated dropdown (#36575)
Convert the `working-directory` input in the release workflow from a
free-text string to a dropdown of known package paths.

## Changes
- Change `working-directory` from `type: string` to `type: choice` in
`_release.yml`, enumerating all 21 releasable packages under `libs/` and
`libs/partners/`
- Add `check-release-options` CI job in `check_diffs.yml` that runs a
pytest script to assert the dropdown options match directories
containing a `pyproject.toml`
2026-04-06 22:46:11 -04:00
Mason Daugherty deb85b6c4c chore(openai): fix broken vcr cassette playback and add ci guard (#36502)
Fix broken VCR cassette playback in `langchain-openai` integration tests
and add a CI job to prevent regressions. Two independent bugs made all
VCR-backed tests fail: `before_record_request` redacts URIs to
`**REDACTED**` but `match_on` still included `uri` (so playback never
matched), and a typo-fix commit (`c9f51aef85`) changed test input
strings without re-recording cassettes (so `json_body` matching also
failed).
2026-04-03 12:55:52 -04:00
Christophe BornetandMason Daugherty 494b760028 fix(chroma): fix Python 3.14 support in langchain-chroma (#36199)
Latest chromadb version supports Python 3.14 and pydantic 3.12.

Co-authored-by: Mason Daugherty <mason@langchain.dev>
2026-03-27 15:40:42 -04:00
Mason Daugherty a9d31b30f8 ci: skip excluded files when applying package labels in pr-labeler (#36114)
A PR that only touches `uv.lock` currently gets the label of its' dir
because the file rule matches on the file prefix. This is misleading —
lockfile-only changes aren't meaningful package changes. The
`excludedFiles` list already existed in config (for size calculations),
but file rules didn't consult it.

## Changes
- Add `skipExcludedFiles` option to file rules in
`pr-labeler-config.json`, enabled for the four package rules
(`deepagents`, `cli`, `acp`, `evals`) so lockfile-only PRs don't trigger
package labels
- `matchFileLabels` in `pr-labeler.js` now filters out files whose
basename appears in the top-level `excludedFiles` list (currently just
`uv.lock`) before testing rules that opt in via `skipExcluded`
- Non-package rules (`github_actions`, `dependencies`) are unaffected —
they don't set the flag
2026-03-19 18:14:34 -04:00
Mason Daugherty cf1f510d77 fix(infra): resolve module crash blocking external PR enforcement (#36059)
`pr-labeler.js` used `require('@actions/core')` to access GitHub Actions
logging/failure helpers, but that module is bundled inside
`actions/github-script`'s dist — it's not resolvable via Node's
`require()` from a checked-out file on disk. Two of the three call sites
were in rarely-hit error branches, so the bug was latent. The third
(`applyTierLabel`) ran unconditionally, crashing the tier-label step on
every external PR. Because the tier step runs *before* the "add external
label" step, the crash prevented the `external` label from ever being
applied — which meant `require_issue_link.yml` never triggered and
unapproved external PRs stayed open.

## Changes
- Thread the `core` object (provided by `actions/github-script` at eval
time) through `loadAndInit()` → `init()` instead of calling
`require('@actions/core')` from the checked-out script — fixes the
`MODULE_NOT_FOUND` crash on all three call sites (`ensureLabel`,
`getContributorInfo`, `applyTierLabel`)
- Add a console-based fallback in `loadAndInit` so callers that don't
need `core.setFailed` still work without passing it
- Update all 9 `loadAndInit(github, owner, repo)` call sites across
`pr_labeler.yml`, `pr_labeler_backfill.yml`, and
`tag-external-issues.yml` to pass `core`
2026-03-18 00:53:18 -04:00
Mason Daugherty b7e0b41d3a ci: use codspeed walltime mode for slow partners (#36049)
Speed up CodSpeed benchmarks for partners with heavy SDK inits by
switching them to walltime mode. `fireworks` takes ~328s and `openai` ~6
min under CPU simulation (Valgrind-based) — walltime is noisier but more
than adequate for detecting init-time regressions on these packages.

## Changes
- Add `CODSPEED_WALLTIME_DIRS` set in `_get_configs_for_single_dir` that
routes `libs/core`, `libs/partners/fireworks`, and
`libs/partners/openai` to walltime mode; all other partners default to
`simulation`
- Emit a `codspeed-mode` field in the CodSpeed matrix config and consume
it as `${{ matrix.job-configs.codspeed-mode }}` in the workflow,
replacing the inline ternary
2026-03-17 21:30:42 -04:00
Mason Daugherty 58f3d1a633 ci: consolidate PR labeling into unified workflows (#36042)
Consolidate four separate PR labeling workflows (`pr_labeler_file.yml`,
`pr_labeler_title.yml`, `pr_size_labeler.yml`, and the PR-handling half
of `tag-external-contributions.yml`) into a single `pr_labeler.yml`
workflow. The old workflows raced against each other — concurrent label
mutations could drop or duplicate labels depending on execution order. A
unified workflow with concurrency grouping eliminates that class of bug.
2026-03-17 20:29:33 -04:00
Tejas Attarde d6dbcf6294 perf(.github): set a timeout on get min versions HTTP calls (#35851)
During an automated code review of .github/scripts/get_min_versions.py,
the following issue was identified. Set a timeout on get min versions
HTTP calls. Network calls without a timeout can hang a worker
indefinitely. I kept the patch small and re-ran syntax checks after
applying it.
2026-03-13 17:24:32 -04:00
Mason Daugherty 9b22f9c450 chore: housekeeping (#35850) 2026-03-13 16:24:35 -04:00
ccurme f058e45dfb chore(infra): delete prompty (#35044) 2026-02-06 10:38:27 -05:00
Mason Daugherty 4e9a1eb283 chore: delete CLI (#34855)
preserved in
https://github.com/langchain-ai/langchain/tree/langchain-cli
2026-01-23 12:55:09 -05:00
Alazar Genene 94d5271cb5 fix(standard-tests): fix semantic typo in if statement (#33890) 2025-11-07 18:01:59 -05:00
ccurme 493be259c3 feat(core): mint langchain-model-profiles and add profile property to BaseChatModel (#33728) 2025-10-31 09:44:46 -04:00
Christophe BornetandMason Daugherty dff37f6048 fix(nomic): support Python 3.14 (#33655)
Pyarrow just published 3.14 binaries

Co-authored-by: Mason Daugherty <mason@langchain.dev>
2025-10-24 13:32:07 -04:00
Christophe Bornet 965dac74e5 chore(infra): test pydantic with python 3.12 (#33421) 2025-10-20 10:28:41 -04:00
Christophe BornetandMason Daugherty 3dcf4ae1e9 fix(cli): support Python 3.14 (#33598)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
2025-10-19 19:37:34 -04:00
Christophe Bornet 3391168777 ci(infra): test CodSpeed with Python 3.13 (#33599) 2025-10-19 19:33:20 -04:00
Sydney RunkleandChristophe Bornet 8fd54f13b5 feat(langchain_v1): Python 3.14 support (#33560)
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
2025-10-17 15:10:01 -04:00
Mason Daugherty a194ae6959 release(huggingface): 1.0.0 (#33572) 2025-10-17 11:26:48 -04:00
3152d25811 fix: support python 3.14 in various projects (#33575)
Co-authored-by: cbornet <cbornet@hotmail.com>
Co-authored-by: Mason Daugherty <mason@langchain.dev>
2025-10-17 11:06:23 -04:00
2d5efd7b29 fix(core): support for Python 3.14 (#33461)
* Fix detection of support of context in `asyncio.create_task`
* Fix: in Python 3.14 `asyncio.get_event_loop()` raises an exception if
there's no running loop
* Bump pydantic to version 2.12
* Skips tests with pydantic v1 models as they are not supported with
Python 3.14
* Run core tests with Python 3.14 in CI.

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
Co-authored-by: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com>
2025-10-17 05:27:34 -04:00
Mason Daugherty ffb1a08871 style(infra): use modern Optional typing in script (#33361) 2025-10-08 21:09:43 -04:00
Mason Daugherty 690b620b7f docs(infra): add note about check_diff.py running on seemingly unrelated PRs (#33323) 2025-10-06 17:56:57 -04:00
ccurme 426b8e2e6a feat(standard-tests): enable parametrization of output_version (#33301) 2025-10-06 14:37:33 -04:00
Mason Daugherty bba37bd6be chore: add libs/ note (#33238) 2025-10-02 19:57:50 -04:00
ae5b105d11 docs: v1 docs updates (#33173)
Co-authored-by: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com>
Co-authored-by: Caspar Broekhuizen <caspar@langchain.dev>
Co-authored-by: ccurme <chester.curme@gmail.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Sadra Barikbin <sadraqazvin1@yahoo.com>
Co-authored-by: Vadym Barda <vadim.barda@gmail.com>
2025-10-02 18:46:26 -04:00
eaa6dcce9e release: v1.0.0 (#32567)
Co-authored-by: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com>
Co-authored-by: Caspar Broekhuizen <caspar@langchain.dev>
Co-authored-by: ccurme <chester.curme@gmail.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Sadra Barikbin <sadraqazvin1@yahoo.com>
Co-authored-by: Vadym Barda <vadim.barda@gmail.com>
2025-10-02 10:49:42 -04:00
Mason Daugherty 79e536b0d6 chore(infra): further docs build cleanup (#33057)
Reorganize the requirements for better clarity and consistency. Improve
documentation on scripts and workflows.
2025-09-23 17:29:58 -04:00
Mason Daugherty 2c95586f2a chore(infra): audit workflows, scripts (#33055)
Mostly adding a descriptive frontmatter to workflow files. Also address
some formatting and outdated artifacts

No functional changes outside of
[d5457c3](https://github.com/langchain-ai/langchain/pull/33055/commits/d5457c39eeab30786d97d7447ddabcc7e9c3afe4),
[90708a0](https://github.com/langchain-ai/langchain/pull/33055/commits/90708a0d99613cc4e1ff67da82a5525839682b6d),
and
[338c82d](https://github.com/langchain-ai/langchain/pull/33055/commits/338c82d21e894e07bc85fea994ba0a3e9ac57db5)
2025-09-23 17:08:19 +00:00
Mason Daugherty 244c699551 refactor(cli): drop Python 3.9 (#32964) 2025-09-15 19:22:53 -04:00
Sydney Runkle c6c7fce6c9 chore(langchain): drop Python 3.9 to prep for v1 (#32704)
Python 3.9 EOL is October 2025, so we're going to drop it for the v1
alpha release.
2025-08-26 23:16:42 +00:00
Mason Daugherty c31236264e chore: formatting across codebase (#32466) 2025-08-08 10:20:10 -04:00
Mason Daugherty 5ecbb5f277 fix(docs): temporary workaround until the underlying dependency issues in the AI21 package ecosystem are resolved. (#32248) 2025-07-25 15:12:44 -04:00
Eugene Yurtsev 56dde3ade3 feat(langchain): v1 scaffolding (#32166)
This PR adds scaffolding for langchain 1.0 entry package.

Most contents have been removed. 

Currently remaining entrypoints for:

* chat models
* embedding models
* memory -> trimming messages, filtering messages and counting tokens
[we may remove this]
* prompts -> we may remove some prompts
* storage: primarily to support cache backed embeddings, may remove the
kv store
* tools -> report tool primitives

Things to be added:

* Selected agent implementations
* Selected workflows
* Common primitives: messages, Document
* Primitives for type hinting: BaseChatModel, BaseEmbeddings
* Selected retrievers
* Selected text splitters

Things to be removed:

* Globals needs to be removed (needs an update in langchain core)


Todos: 

* TBD indexing api (requires sqlalchemy which we don't want as a
dependency)
* Be explicit about public/private interfaces (e.g., likely rename
chat_models.base.py to something more internal)
* Remove dockerfiles
* Update module doc-strings and README.md
2025-07-24 09:47:48 -04:00
ccurmeandSydney Runkle 49eeb0f3c3 standard-tests: add benchmarks (#31302)
Co-authored-by: Sydney Runkle <sydneymarierunkle@gmail.com>
2025-05-29 15:21:37 +00:00
ccurme bf645c83f4 voyageai: remove from monorepo (#31281)
langchain-voyageai is now maintained at
https://github.com/voyage-ai/langchain-voyageai.
2025-05-19 16:33:38 +00:00
ccurme 9ff5b5d282 community: move to separate repo (#31060)
langchain-community is moving to
https://github.com/langchain-ai/langchain-community
2025-04-29 09:22:04 -04:00
Sydney Runkle d614842d23 ci: temporarily run chroma on 3.12 for CI (#31056)
Waiting on a fix for https://github.com/chroma-core/chroma/issues/4382
2025-04-28 13:20:37 -04:00
ccurme 04a899ebe3 infra: support third-party integration packages in API ref build (#31021) 2025-04-25 16:02:27 -04:00
ccurme 001cf99253 pinecone[patch]: add support for python 3.13 (#29737) 2025-02-11 11:20:21 -08:00
ccurme d172984c91 infra: migrate to uv (#29566) 2025-02-06 13:36:26 -05:00