Mason Daugherty
26e0a00c4c
style: more work for refs ( #33508 )
...
Largely:
- Remove explicit `"Default is x"` since new refs show default inferred
from sig
- Inline code (useful for eventual parsing)
- Fix code block rendering (indentations)
2025-10-15 18:46:55 -04:00
Eugene Yurtsev
d0f8f00e7e
release(anthropic): 1.0.0a5 ( #33507 )
...
Release anthropic
langchain-anthropic==1.0.0a5
2025-10-15 21:31:52 +00:00
Eugene Yurtsev
a39132787c
feat(anthropic): add async implementation to middleware ( #33506 )
...
Add async implementation to middleware
2025-10-15 17:05:39 -04:00
Sydney Runkle
296994ebf0
release(langchain_v1): 1.0.0a15 ( #33505 )
langchain==1.0.0a15
2025-10-15 20:48:18 +00:00
ccurme
b5b31eec88
feat(core): include original block type in server tool results for google-genai ( #33502 )
2025-10-15 16:26:54 -04:00
Sydney Runkle
8f6851c349
fix(langchain_v1): keep state to relevant middlewares for tool/model call limits ( #33493 )
...
The one risk point that I can see here is that model + tool call
counting now occurs in the `after_model` hook which introduces order
dependency (what if you have HITL execute before this hook and we jump
early to `model`, for example).
This is something users can work around at the moment and we can
document. We could also introduce a priority concept to middleware.
2025-10-15 14:24:59 -04:00
Nuno Campos
0788461abd
feat(openai): Add openai moderation middleware ( #33492 )
2025-10-15 13:59:49 -04:00
ccurme
3bfd1f6d8a
release(core): 1.0.0rc1 ( #33497 )
langchain-core==1.0.0rc1
2025-10-15 13:02:35 -04:00
Mason Daugherty
d83c3a12bf
chore(core): delete BaseMemory, move to langchain-classic ( #33373 )
2025-10-15 12:55:23 -04:00
Mason Daugherty
79200cf3c2
docs: update package READMEs ( #33488 )
2025-10-15 10:49:35 -04:00
ccurme
bcb6789888
fix(anthropic): set langgraph-prebuilt dep explicitly ( #33495 )
2025-10-15 14:44:37 +00:00
ccurme
89b7933ef1
feat(standard-tests): parametrize tool calling test ( #33496 )
2025-10-15 14:43:09 +00:00
ccurme
4da5a8081f
fix(core): propagate extras when aggregating tool calls in v1 content ( #33494 )
2025-10-15 10:38:16 -04:00
Mason Daugherty
53e9f00804
chore(core): delete items marked for removal in schemas.py ( #33375 )
2025-10-15 09:56:27 -04:00
Chenyang Li and Mason Daugherty
6e25e185f6
fix(docs): Fix several typos and grammar ( #33487 )
...
Just typo changes
Co-authored-by: Mason Daugherty <mason@langchain.dev >
2025-10-14 20:04:14 -04:00
Mason Daugherty
68ceeb64f6
chore(core): delete function_calling.py utils marked for removal ( #33376 )
2025-10-14 16:13:19 -04:00
Mason Daugherty
edae976b81
chore(core): delete pydantic_v1/ ( #33374 )
2025-10-14 16:08:24 -04:00
ccurme
9f4366bc9d
feat(mistralai): support reasoning feature and v1 content ( #33485 )
...
Not yet supported: server-side tool calls
2025-10-14 15:19:44 -04:00
Eugene Yurtsev
99e0a60aab
chore(langchain_v1): remove invocation request ( #33482 )
...
Remove ToolNode primitives from langchain
2025-10-14 15:07:30 -04:00
Eugene Yurtsev
d38729fbac
feat(langchain_v1): add async implementations to wrap_model_call ( #33467 )
...
Add async implementations to wrap_model_call for prebuilt middleware
2025-10-14 17:39:38 +00:00
gsmini
ff0d21cfd5
fix(langchain_v1): can not import "wrap_tool_call" from agents.… ( #33472 )
...
fix can not import `wrap_tool_call` from ` langchain.agents.middleware
import `
```python
from langchain.agents import create_agent
from langchain.agents.middleware import wrap_tool_call # here !
from langchain_core.messages import ToolMessage
@wrap_tool_call
def handle_tool_errors(request, handler):
"""Handle tool execution errors with custom messages."""
try:
return handler(request)
except Exception as e:
# Return a custom error message to the model
return ToolMessage(
content=f"Tool error: Please check your input and try again. ({str(e)})",
tool_call_id=request.tool_call["id"]
)
agent = create_agent(
model="openai:gpt-4o",
tools=[search, calculate],
middleware=[handle_tool_errors]
)
```
> example code from:
https://docs.langchain.com/oss/python/langchain/agents#tool-error-handling
2025-10-14 13:39:25 -04:00
Eugene Yurtsev
9140a7cb86
feat(langchain_v1): add override to model request and tool call request ( #33465 )
...
Add override to model request and tool call request
2025-10-14 10:31:46 -04:00
ccurme
41fe18bc80
chore(groq): fix integration tests ( #33478 )
...
- add missing cassette
- update streaming metadata test for v1
2025-10-14 14:16:34 +00:00
Mason Daugherty
9105573cb3
docs: create_agent style and clarify system_prompt ( #33470 )
2025-10-14 09:56:54 -04:00
Sydney Runkle
fff87e95d1
fix(langchain): rename PlanningMiddleware to TodoListMiddleware ( #33476 )
2025-10-14 09:06:06 -04:00
ccurme
9beb29a34c
chore(mistralai): delete redundant tests ( #33468 )
2025-10-13 21:28:51 +00:00
ca00f5aed9
fix(langchain_v1): export ModelResponse from agents.middleware ( #33453 ) ( #33454 )
...
## Description
Fixes #33453
`ModelResponse` was defined in `types.py` and included in its `__all__`
list, but was not exported from the middleware package's `__init__.py`.
This caused `ImportError` when attempting to import it directly
from `langchain.agents.middleware`, despite being documented as a public
export.
## Changes
- Added `ModelResponse` to the import statement in
`langchain/agents/middleware/__init__.py`
- Added `ModelResponse` to the `__all__` list in
`langchain/agents/middleware/__init__.py`
- Added comprehensive unit tests in `test_imports.py` to verify the
import works correctly
## Issue
The original issue reported that the following import failed:
```python
from langchain.agents.middleware import ModelResponse
# ImportError: cannot import name 'ModelResponse' from
'langchain.agents.middleware'
The workaround was to import from the submodule:
from langchain.agents.middleware.types import ModelResponse # Workaround
Solution
After this fix, ModelResponse can be imported directly as documented:
from langchain.agents.middleware import ModelResponse # Now works!
Testing
- ✅ Added 3 unit tests in
tests/unit_tests/agents/middleware/test_imports.py
- ✅ All tests pass locally: make format, make lint, make test
- ✅ Verified ModelResponse is properly exported and importable
- ✅ Verified ModelResponse appears in __all__ list
Dependencies
None. This is a simple export fix with no new dependencies.
---------
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev >
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com >
2025-10-13 16:02:30 -04:00
dependabot[bot]
637777b8e7
chore(infra): bump astral-sh/setup-uv from 6 to 7 ( #33457 )
...
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv ) from 6
to 7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/setup-uv/releases ">astral-sh/setup-uv's
releases</a>.</em></p>
<blockquote>
<h2>v7.0.0 🌈 node24 and a lot of bugfixes</h2>
<h2>Changes</h2>
<p>This release comes with a load of bug fixes and a speed up. Because
of switching from node20 to node24 it is also a breaking change. If you
are running on GitHub hosted runners this will just work, if you are
using self-hosted runners make sure, that your runners are up to date.
If you followed the normal installation instructions your self-hosted
runner will keep itself updated.</p>
<p>This release also removes the deprecated input
<code>server-url</code> which was used to download uv releases from a
different server.
The <a
href="https://github.com/astral-sh/setup-uv?tab=readme-ov-file#manifest-file ">manifest-file</a>
input supersedes that functionality by adding a flexible way to define
available versions and where they should be downloaded from.</p>
<h3>Fixes</h3>
<ul>
<li>The action now respects when the environment variable
<code>UV_CACHE_DIR</code> is already set and does not overwrite it. It
now also finds <a
href="https://docs.astral.sh/uv/reference/settings/#cache-dir ">cache-dir</a>
settings in config files if you set them.</li>
<li>Some users encountered problems that <a
href="https://github.com/astral-sh/setup-uv?tab=readme-ov-file#disable-cache-pruning ">cache
pruning</a> took forever because they had some <code>uv</code> processes
running in the background. Starting with uv version <code>0.8.24</code>
this action uses <code>uv cache prune --ci --force</code> to ignore the
running processes</li>
<li>If you just want to install uv but not have it available in path,
this action now respects <code>UV_NO_MODIFY_PATH</code></li>
<li>Some other actions also set the env var <code>UV_CACHE_DIR</code>.
This action can now deal with that but as this could lead to unwanted
behavior in some edgecases a warning is now displayed.</li>
</ul>
<h3>Improvements</h3>
<p>If you are using minimum version specifiers for the version of uv to
install for example</p>
<pre lang="toml"><code>[tool.uv]
required-version = ">=0.8.17"
</code></pre>
<p>This action now detects that and directly uses the latest version.
Previously it would download all available releases from the uv repo
to determine the highest matching candidate for the version specifier,
which took much more time.</p>
<p>If you are using other specifiers like <code>0.8.x</code> this action
still needs to download all available releases because the specifier
defines an upper bound (not 0.9.0 or later) and "latest" would
possibly not satisfy that.</p>
<h2>🚨 Breaking changes</h2>
<ul>
<li>Use node24 instead of node20 <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/608 ">#608</a>)</li>
<li>Remove deprecated input server-url <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/607 ">#607</a>)</li>
</ul>
<h2>🐛 Bug fixes</h2>
<ul>
<li>Respect UV_CACHE_DIR and cache-dir <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/612 ">#612</a>)</li>
<li>Use --force when pruning cache <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/611 ">#611</a>)</li>
<li>Respect UV_NO_MODIFY_PATH <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/603 ">#603</a>)</li>
<li>Warn when <code>UV_CACHE_DIR</code> has changed <a
href="https://github.com/jamesbraza "><code>@jamesbraza</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/601 ">#601</a>)</li>
</ul>
<h2>🚀 Enhancements</h2>
<ul>
<li>Shortcut to latest version for minimum version specifier <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/598 ">#598</a>)</li>
</ul>
<h2>🧰 Maintenance</h2>
<ul>
<li>Bump dependencies <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/613 ">#613</a>)</li>
<li>Fix test-uv-no-modify-path <a
href="https://github.com/eifinger "><code>@eifinger</code></a> (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/604 ">#604</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/3259c6206f993105e3a61b142c2d97bf4b9ef83d "><code>3259c62</code></a>
Bump deps (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/633 ">#633</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/bf8e8ed895b7f686f85839659243f31a7df4a977 "><code>bf8e8ed</code></a>
Split up documentation (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/632 ">#632</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/9c6b5e9fb575cac8e82bb437dd7fc25a094bd85d "><code>9c6b5e9</code></a>
Add resolution-strategy input to support oldest compatible version
selection ...</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/a5129e99f44f5d2ba22cdc54770745bd6f0d9c33 "><code>a5129e9</code></a>
Add copilot-instructions.md (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/630 ">#630</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/d18bcc753ac29c1ed721aa4a812a90eb937852d6 "><code>d18bcc7</code></a>
Add value of UV_PYTHON_INSTALL_DIR to path (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/628 ">#628</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/bd1f875aba1ebb6d38211b773b094ad1dcca58df "><code>bd1f875</code></a>
Set output venv when activate-environment is used (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/627 ">#627</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/1a91c3851df47749b241e3c5c696350957c93ff0 "><code>1a91c38</code></a>
chore: update known checksums for 0.9.2 (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/626 ">#626</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/c79f606987cb4a0f3d1a95a3e44bcebfb0a9b303 "><code>c79f606</code></a>
chore: update known checksums for 0.9.1 (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/625 ">#625</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/e0249f159931b41f44fc8208c9b4cff085288cc9 "><code>e0249f1</code></a>
Fall back to PR for updating known versions (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/623 ">#623</a>)</li>
<li><a
href="https://github.com/astral-sh/setup-uv/commit/6d2eb15b4979924f7be71aa06908c6211f80ac88 "><code>6d2eb15</code></a>
Cache python installs (<a
href="https://redirect.github.com/astral-sh/setup-uv/issues/621 ">#621</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/setup-uv/compare/v6...v7 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-13 15:21:12 -04:00
Eugene Yurtsev
1cf851e054
chore(langchain_v1,anthropic): migrate anthropic middleware to langchain_anthropic ( #33463 )
...
Migrate prompt caching implementation into langchain_anthropic.middleware
2025-10-13 15:12:54 -04:00
ccurme
961f965f0c
feat(groq): support built-in tools in message content ( #33459 )
2025-10-13 15:06:01 -04:00
Sydney Runkle
760fc3bc12
chore(langchain_v1): use args for HITL ( #33442 )
2025-10-11 07:12:46 -04:00
Eugene Yurtsev
e3fc7d8aa6
chore(langchain_v1): bump release version ( #33440 )
...
bump v1 for release
langchain==1.0.0a14
2025-10-10 21:51:00 -04:00
Eugene Yurtsev
2b3b209e40
chore(langchain_v1): improve error message ( #33433 )
...
Make error messages actionable for sync / async decorators
2025-10-10 17:18:20 -04:00
ccurme
78903ac285
fix(openai): conditionally skip test ( #33431 )
2025-10-10 21:04:18 +00:00
ccurme
f361acc11c
chore(anthropic): speed up integration tests ( #33430 )
2025-10-10 20:57:44 +00:00
Eugene Yurtsev
ed185c0026
chore(langchain_v1): remove langchain_text_splitters from test group ( #33425 )
...
Remove langchain_text_splitters from test group in langchain_v1
2025-10-10 16:56:14 -04:00
Eugene Yurtsev
6dc34beb71
chore(langchain_v1): stricter handling of sync vs. async for wrap_model_call and wrap_tool_call ( #33429 )
...
Wrap model call and wrap tool call
2025-10-10 16:54:42 -04:00
Eugene Yurtsev
c2205f88e6
chore(langchain_v1): further namespace clean up ( #33428 )
...
Reduce exposed namespace for now
2025-10-10 20:48:24 +00:00
ccurme
abdbe185c5
release(anthropic): 1.0.0a4 ( #33427 )
langchain-anthropic==1.0.0a4
2025-10-10 16:39:58 -04:00
ccurme
c1b816cb7e
fix(fireworks): parse standard blocks in input ( #33426 )
2025-10-10 16:18:37 -04:00
Eugene Yurtsev
0559558715
feat(langchain_v1): add async implementation for wrap_tool_call ( #33420 )
...
Add async implementation. No automatic delegation to sync at the moment.
2025-10-10 15:07:19 -04:00
Eugene Yurtsev
75965474fc
chore(langchain_v1): tool error exceptions ( #33424 )
...
Tool error exceptions
2025-10-10 15:06:40 -04:00
Mason Daugherty and Chester Curme
5dc014fdf4
chore(core): delete get_relevant_documents ( #33378 )
...
Co-authored-by: Chester Curme <chester.curme@gmail.com >
2025-10-10 14:51:54 -04:00
Mason Daugherty
291a9fcea1
style: llm -> model ( #33423 )
2025-10-10 13:19:13 -04:00
Christophe Bornet and Mason Daugherty
dd994b9d7f
chore(langchain): remove arg types from docstrings ( #33413 )
...
Co-authored-by: Mason Daugherty <mason@langchain.dev >
2025-10-10 11:51:00 -04:00
Christophe Bornet and Mason Daugherty
83901b30e3
chore(text-splitters): remove arg types from docstrings ( #33406 )
...
Co-authored-by: Mason Daugherty <mason@langchain.dev >
2025-10-10 11:37:53 -04:00
Mason Daugherty
bcfa21a6e7
chore(infra): remove Poetry setup and dependencies ( #33418 )
...
AWS now uses UV
2025-10-10 11:29:52 -04:00
ccurme
af1da28459
feat(langchain_v1): expand message exports ( #33419 )
2025-10-10 15:14:51 +00:00
Mason Daugherty
ed2ee4e8cc
style: fix tables, capitalization ( #33417 )
2025-10-10 11:09:59 -04:00
Sydney Runkle
f293c8ffd6
chore(langchain_v1): add RemoveMessage ( #33416 )
langchain==1.0.0a13
2025-10-10 10:49:18 -04:00