Compare commits

...

4 Commits

Author SHA1 Message Date
Sydney Runkle
608d2343a1 lint 2025-10-16 18:40:38 -04:00
Sydney Runkle
ecc28d22d2 subclass 2025-10-16 18:39:51 -04:00
Sydney Runkle
0fd699e767 allow injecting direct subclasses 2025-10-16 18:37:19 -04:00
Sydney Runkle
ae8feeab3b another rc 2025-10-16 17:55:18 -04:00
4 changed files with 19 additions and 3 deletions

View File

@@ -1250,6 +1250,22 @@ def _is_injected_arg_type(
`True` if the type is an injected argument, `False` otherwise.
"""
injected_type = injected_type or InjectedToolArg
# if the type is a generic alias, check if the origin is a subclass of inj type
origin = get_origin(type_)
if (
origin is not None
and isinstance(origin, type)
and issubclass(origin, injected_type)
):
return True
# check if the type is a subclass of the injected type
if isinstance(type_, type) and issubclass(type_, injected_type):
return True
# if the type is an Annotated type, check if any of the annotations
# are a subclass of the injected type
return any(
isinstance(arg, injected_type)
or (isinstance(arg, type) and issubclass(arg, injected_type))

View File

@@ -1,3 +1,3 @@
"""Main entrypoint into LangChain."""
__version__ = "1.0.0rc1"
__version__ = "1.0.0rc2"

View File

@@ -13,7 +13,7 @@ dependencies = [
]
name = "langchain"
version = "1.0.0rc1"
version = "1.0.0rc2"
description = "Building applications with LLMs through composability"
readme = "README.md"

View File

@@ -1550,7 +1550,7 @@ wheels = [
[[package]]
name = "langchain"
version = "1.0.0rc1"
version = "1.0.0rc2"
source = { editable = "." }
dependencies = [
{ name = "langchain-core" },