Skip to content

Commit 47f6dad

Browse files
committed
chore: resolve merge conflict in uv.lock by accepting upstream and regenerating
2 parents 59600ea + 03ae397 commit 47f6dad

File tree

248 files changed

+7034
-3691
lines changed

Some content is hidden

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

248 files changed

+7034
-3691
lines changed

.github/workflows/_lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
cache-suffix: lint-${{ inputs.working-directory }}
4848
working-directory: ${{ inputs.working-directory }}
4949

50+
# - name: "🔒 Verify Lockfile is Up-to-Date"
51+
# working-directory: ${{ inputs.working-directory }}
52+
# run: |
53+
# unset UV_FROZEN
54+
# uv lock --check
55+
5056
- name: "📦 Install Lint & Typing Dependencies"
5157
working-directory: ${{ inputs.working-directory }}
5258
run: |

.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@v5
80+
uses: actions/upload-artifact@v6
8181
with:
8282
name: dist
8383
path: ${{ inputs.working-directory }}/dist/
@@ -208,7 +208,7 @@ jobs:
208208
steps:
209209
- uses: actions/checkout@v6
210210

211-
- uses: actions/download-artifact@v6
211+
- uses: actions/download-artifact@v7
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@v6
261+
- uses: actions/download-artifact@v7
262262
with:
263263
name: dist
264264
path: ${{ inputs.working-directory }}/dist/
@@ -396,7 +396,7 @@ jobs:
396396
contents: read
397397
strategy:
398398
matrix:
399-
partner: [anthropic]
399+
partner: [openai, anthropic]
400400
fail-fast: false # Continue testing other partners if one fails
401401
env:
402402
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
@@ -430,7 +430,7 @@ jobs:
430430
with:
431431
python-version: ${{ env.PYTHON_VERSION }}
432432

433-
- uses: actions/download-artifact@v6
433+
- uses: actions/download-artifact@v7
434434
if: startsWith(inputs.working-directory, 'libs/core')
435435
with:
436436
name: dist
@@ -499,7 +499,7 @@ jobs:
499499
with:
500500
python-version: ${{ env.PYTHON_VERSION }}
501501

502-
- uses: actions/download-artifact@v6
502+
- uses: actions/download-artifact@v7
503503
with:
504504
name: dist
505505
path: ${{ inputs.working-directory }}/dist/
@@ -539,7 +539,7 @@ jobs:
539539
with:
540540
python-version: ${{ env.PYTHON_VERSION }}
541541

542-
- uses: actions/download-artifact@v6
542+
- uses: actions/download-artifact@v7
543543
with:
544544
name: dist
545545
path: ${{ inputs.working-directory }}/dist/

.vscode/extensions.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"ms-toolsai.jupyter",
77
"ms-toolsai.jupyter-keymap",
88
"ms-toolsai.jupyter-renderers",
9-
"ms-toolsai.vscode-jupyter-cell-tags",
10-
"ms-toolsai.vscode-jupyter-slideshow",
119
"yzhang.markdown-all-in-one",
1210
"davidanson.vscode-markdownlint",
1311
"bierner.markdown-mermaid",

libs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Makefile for libs/ directory
2+
# Contains targets that operate across multiple packages
3+
4+
LANGCHAIN_DIRS = core text-splitters langchain langchain_v1 model-profiles
5+
6+
.PHONY: lock check-lock
7+
8+
# Regenerate lockfiles for all core packages
9+
lock:
10+
@for dir in $(LANGCHAIN_DIRS); do \
11+
echo "=== Locking $$dir ==="; \
12+
(cd $$dir && uv lock); \
13+
done
14+
15+
# Verify all lockfiles are up-to-date
16+
check-lock:
17+
@for dir in $(LANGCHAIN_DIRS); do \
18+
echo "=== Checking $$dir ==="; \
19+
(cd $$dir && uv lock --check) || exit 1; \
20+
done

libs/cli/pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ ignore = [
6464
"FIX002", # Line contains TODO
6565
"PERF203", # Rarely useful
6666
"PLR09", # Too many something (arg, statements, etc)
67-
"RUF012", # Doesn't play well with Pydantic
68-
"TC001", # Doesn't play well with Pydantic
69-
"TC002", # Doesn't play well with Pydantic
70-
"TC003", # Doesn't play well with Pydantic
7167
"TD002", # Missing author in TODO
7268
"TD003", # Missing issue link in TODO
7369

libs/cli/uv.lock

Lines changed: 44 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/core/langchain_core/_api/deprecation.py

Lines changed: 110 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,27 @@
2828
from langchain_core._api.internal import is_caller_internal
2929

3030

31+
def _build_deprecation_message(
32+
*,
33+
alternative: str = "",
34+
alternative_import: str = "",
35+
) -> str:
36+
"""Build a simple deprecation message for `__deprecated__` attribute.
37+
38+
Args:
39+
alternative: An alternative API name.
40+
alternative_import: A fully qualified import path for the alternative.
41+
42+
Returns:
43+
A deprecation message string for IDE/type checker display.
44+
"""
45+
if alternative_import:
46+
return f"Use {alternative_import} instead."
47+
if alternative:
48+
return f"Use {alternative} instead."
49+
return "Deprecated."
50+
51+
3152
class LangChainDeprecationWarning(DeprecationWarning):
3253
"""A class for issuing deprecation warnings for LangChain users."""
3354

@@ -81,60 +102,57 @@ def deprecated(
81102
) -> Callable[[T], T]:
82103
"""Decorator to mark a function, a class, or a property as deprecated.
83104
84-
When deprecating a classmethod, a staticmethod, or a property, the
85-
`@deprecated` decorator should go *under* `@classmethod` and
86-
`@staticmethod` (i.e., `deprecated` should directly decorate the
87-
underlying callable), but *over* `@property`.
105+
When deprecating a classmethod, a staticmethod, or a property, the `@deprecated`
106+
decorator should go *under* `@classmethod` and `@staticmethod` (i.e., `deprecated`
107+
should directly decorate the underlying callable), but *over* `@property`.
88108
89-
When deprecating a class `C` intended to be used as a base class in a
90-
multiple inheritance hierarchy, `C` *must* define an `__init__` method
91-
(if `C` instead inherited its `__init__` from its own base class, then
92-
`@deprecated` would mess up `__init__` inheritance when installing its
93-
own (deprecation-emitting) `C.__init__`).
109+
When deprecating a class `C` intended to be used as a base class in a multiple
110+
inheritance hierarchy, `C` *must* define an `__init__` method (if `C` instead
111+
inherited its `__init__` from its own base class, then `@deprecated` would mess up
112+
`__init__` inheritance when installing its own (deprecation-emitting) `C.__init__`).
94113
95-
Parameters are the same as for `warn_deprecated`, except that *obj_type*
96-
defaults to 'class' if decorating a class, 'attribute' if decorating a
97-
property, and 'function' otherwise.
114+
Parameters are the same as for `warn_deprecated`, except that *obj_type* defaults to
115+
'class' if decorating a class, 'attribute' if decorating a property, and 'function'
116+
otherwise.
98117
99118
Args:
100-
since:
101-
The release at which this API became deprecated.
102-
message:
103-
Override the default deprecation message. The %(since)s,
104-
%(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
105-
and %(removal)s format specifiers will be replaced by the
119+
since: The release at which this API became deprecated.
120+
message: Override the default deprecation message.
121+
122+
The `%(since)s`, `%(name)s`, `%(alternative)s`, `%(obj_type)s`,
123+
`%(addendum)s`, and `%(removal)s` format specifiers will be replaced by the
106124
values of the respective arguments passed to this function.
107-
name:
108-
The name of the deprecated object.
109-
alternative:
110-
An alternative API that the user may use in place of the
111-
deprecated API. The deprecation warning will tell the user
112-
about this alternative if provided.
113-
alternative_import:
114-
An alternative import that the user may use instead.
115-
pending:
116-
If `True`, uses a `PendingDeprecationWarning` instead of a
117-
DeprecationWarning. Cannot be used together with removal.
118-
obj_type:
119-
The object type being deprecated.
120-
addendum:
121-
Additional text appended directly to the final message.
122-
removal:
123-
The expected removal version. With the default (an empty
124-
string), a removal version is automatically computed from
125-
since. Set to other Falsy values to not schedule a removal
126-
date. Cannot be used together with pending.
127-
package:
128-
The package of the deprecated object.
125+
name: The name of the deprecated object.
126+
alternative: An alternative API that the user may use in place of the deprecated
127+
API.
128+
129+
The deprecation warning will tell the user about this alternative if
130+
provided.
131+
alternative_import: An alternative import that the user may use instead.
132+
pending: If `True`, uses a `PendingDeprecationWarning` instead of a
133+
`DeprecationWarning`.
134+
135+
Cannot be used together with removal.
136+
obj_type: The object type being deprecated.
137+
addendum: Additional text appended directly to the final message.
138+
removal: The expected removal version.
139+
140+
With the default (an empty string), a removal version is automatically
141+
computed from since. Set to other Falsy values to not schedule a removal
142+
date.
143+
144+
Cannot be used together with pending.
145+
package: The package of the deprecated object.
129146
130147
Returns:
131148
A decorator to mark a function or class as deprecated.
132149
133-
```python
134-
@deprecated("1.4.0")
135-
def the_function_to_deprecate():
136-
pass
137-
```
150+
Example:
151+
```python
152+
@deprecated("1.4.0")
153+
def the_function_to_deprecate():
154+
pass
155+
```
138156
"""
139157
_validate_deprecation_params(
140158
removal, alternative, alternative_import, pending=pending
@@ -223,6 +241,11 @@ def warn_if_direct_instance(
223241
obj.__init__ = functools.wraps(obj.__init__)( # type: ignore[misc]
224242
warn_if_direct_instance
225243
)
244+
# Set __deprecated__ for PEP 702 (IDE/type checker support)
245+
obj.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
246+
alternative=alternative,
247+
alternative_import=alternative_import,
248+
)
226249
return obj
227250

228251
elif isinstance(obj, FieldInfoV1):
@@ -315,12 +338,15 @@ def __set_name__(self, owner: type | None, set_name: str) -> None:
315338

316339
def finalize(wrapper: Callable[..., Any], new_doc: str) -> T: # noqa: ARG001
317340
"""Finalize the property."""
318-
return cast(
319-
"T",
320-
_DeprecatedProperty(
321-
fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
322-
),
341+
prop = _DeprecatedProperty(
342+
fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
323343
)
344+
# Set __deprecated__ for PEP 702 (IDE/type checker support)
345+
prop.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
346+
alternative=alternative,
347+
alternative_import=alternative_import,
348+
)
349+
return cast("T", prop)
324350

325351
else:
326352
_name = _name or cast("type | Callable", obj).__qualname__
@@ -343,6 +369,11 @@ def finalize(wrapper: Callable[..., Any], new_doc: str) -> T:
343369
"""
344370
wrapper = functools.wraps(wrapped)(wrapper)
345371
wrapper.__doc__ = new_doc
372+
# Set __deprecated__ for PEP 702 (IDE/type checker support)
373+
wrapper.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
374+
alternative=alternative,
375+
alternative_import=alternative_import,
376+
)
346377
return cast("T", wrapper)
347378

348379
old_doc = inspect.cleandoc(old_doc or "").strip("\n")
@@ -398,7 +429,7 @@ def finalize(wrapper: Callable[..., Any], new_doc: str) -> T:
398429

399430
@contextlib.contextmanager
400431
def suppress_langchain_deprecation_warning() -> Generator[None, None, None]:
401-
"""Context manager to suppress LangChainDeprecationWarning."""
432+
"""Context manager to suppress `LangChainDeprecationWarning`."""
402433
with warnings.catch_warnings():
403434
warnings.simplefilter("ignore", LangChainDeprecationWarning)
404435
warnings.simplefilter("ignore", LangChainPendingDeprecationWarning)
@@ -421,35 +452,33 @@ def warn_deprecated(
421452
"""Display a standardized deprecation.
422453
423454
Args:
424-
since:
425-
The release at which this API became deprecated.
426-
message:
427-
Override the default deprecation message. The %(since)s,
428-
%(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
429-
and %(removal)s format specifiers will be replaced by the
455+
since: The release at which this API became deprecated.
456+
message: Override the default deprecation message.
457+
458+
The `%(since)s`, `%(name)s`, `%(alternative)s`, `%(obj_type)s`,
459+
`%(addendum)s`, and `%(removal)s` format specifiers will be replaced by the
430460
values of the respective arguments passed to this function.
431-
name:
432-
The name of the deprecated object.
433-
alternative:
434-
An alternative API that the user may use in place of the
435-
deprecated API. The deprecation warning will tell the user
436-
about this alternative if provided.
437-
alternative_import:
438-
An alternative import that the user may use instead.
439-
pending:
440-
If `True`, uses a `PendingDeprecationWarning` instead of a
441-
DeprecationWarning. Cannot be used together with removal.
442-
obj_type:
443-
The object type being deprecated.
444-
addendum:
445-
Additional text appended directly to the final message.
446-
removal:
447-
The expected removal version. With the default (an empty
448-
string), a removal version is automatically computed from
449-
since. Set to other Falsy values to not schedule a removal
450-
date. Cannot be used together with pending.
451-
package:
452-
The package of the deprecated object.
461+
name: The name of the deprecated object.
462+
alternative: An alternative API that the user may use in place of the
463+
deprecated API.
464+
465+
The deprecation warning will tell the user about this alternative if
466+
provided.
467+
alternative_import: An alternative import that the user may use instead.
468+
pending: If `True`, uses a `PendingDeprecationWarning` instead of a
469+
`DeprecationWarning`.
470+
471+
Cannot be used together with removal.
472+
obj_type: The object type being deprecated.
473+
addendum: Additional text appended directly to the final message.
474+
removal: The expected removal version.
475+
476+
With the default (an empty string), a removal version is automatically
477+
computed from since. Set to other Falsy values to not schedule a removal
478+
date.
479+
480+
Cannot be used together with pending.
481+
package: The package of the deprecated object.
453482
"""
454483
if not pending:
455484
if not removal:
@@ -534,8 +563,8 @@ def rename_parameter(
534563
"""Decorator indicating that parameter *old* of *func* is renamed to *new*.
535564
536565
The actual implementation of *func* should use *new*, not *old*. If *old* is passed
537-
to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is
538-
also passed by keyword.
566+
to *func*, a `DeprecationWarning` is emitted, and its value is used, even if *new*
567+
is also passed by keyword.
539568
540569
Args:
541570
since: The version in which the parameter was renamed.

libs/core/langchain_core/_api/internal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import inspect
2+
from typing import cast
23

34

45
def is_caller_internal(depth: int = 2) -> bool:
@@ -16,7 +17,7 @@ def is_caller_internal(depth: int = 2) -> bool:
1617
return False
1718
# Directly access the module name from the frame's global variables
1819
module_globals = frame.f_globals
19-
caller_module_name = module_globals.get("__name__", "")
20+
caller_module_name = cast("str", module_globals.get("__name__", ""))
2021
return caller_module_name.startswith("langchain")
2122
finally:
2223
del frame

libs/core/langchain_core/caches.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Distinct from provider-based [prompt caching](https://docs.langchain.com/oss/python/langchain/models#prompt-caching).
44
55
!!! warning "Beta feature"
6+
67
This is a beta feature. Please be wary of deploying experimental code to production
78
unless you've taken appropriate precautions.
89

0 commit comments

Comments
 (0)