mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 18:50:33 +00:00
fix(langchain): bump min core version and improve approximate token counting (#35026)
This commit is contained in:
@@ -144,8 +144,10 @@ def _get_approximate_token_counter(model: BaseChatModel) -> TokenCounter:
|
|||||||
if model._llm_type == "anthropic-chat": # noqa: SLF001
|
if model._llm_type == "anthropic-chat": # noqa: SLF001
|
||||||
# 3.3 was estimated in an offline experiment, comparing with Claude's token-counting
|
# 3.3 was estimated in an offline experiment, comparing with Claude's token-counting
|
||||||
# API: https://platform.claude.com/docs/en/build-with-claude/token-counting
|
# API: https://platform.claude.com/docs/en/build-with-claude/token-counting
|
||||||
return partial(count_tokens_approximately, chars_per_token=3.3)
|
return partial(
|
||||||
return count_tokens_approximately
|
count_tokens_approximately, use_usage_metadata_scaling=True, chars_per_token=3.3
|
||||||
|
)
|
||||||
|
return partial(count_tokens_approximately, use_usage_metadata_scaling=True)
|
||||||
|
|
||||||
|
|
||||||
class SummarizationMiddleware(AgentMiddleware[AgentState[ResponseT], ContextT, ResponseT]):
|
class SummarizationMiddleware(AgentMiddleware[AgentState[ResponseT], ContextT, ResponseT]):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ classifiers = [
|
|||||||
version = "1.2.9"
|
version = "1.2.9"
|
||||||
requires-python = ">=3.10.0,<4.0.0"
|
requires-python = ">=3.10.0,<4.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"langchain-core>=1.2.8,<2.0.0",
|
"langchain-core>=1.2.9,<2.0.0",
|
||||||
"langgraph>=1.0.7,<1.1.0",
|
"langgraph>=1.0.7,<1.1.0",
|
||||||
"pydantic>=2.7.4,<3.0.0",
|
"pydantic>=2.7.4,<3.0.0",
|
||||||
]
|
]
|
||||||
|
|||||||
4
libs/langchain_v1/uv.lock
generated
4
libs/langchain_v1/uv.lock
generated
@@ -1,5 +1,5 @@
|
|||||||
version = 1
|
version = 1
|
||||||
revision = 3
|
revision = 2
|
||||||
requires-python = ">=3.10.0, <4.0.0"
|
requires-python = ">=3.10.0, <4.0.0"
|
||||||
resolution-markers = [
|
resolution-markers = [
|
||||||
"python_full_version >= '3.14' and platform_python_implementation == 'PyPy'",
|
"python_full_version >= '3.14' and platform_python_implementation == 'PyPy'",
|
||||||
@@ -2125,7 +2125,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "langchain-core"
|
name = "langchain-core"
|
||||||
version = "1.2.8"
|
version = "1.2.9"
|
||||||
source = { editable = "../core" }
|
source = { editable = "../core" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "jsonpatch" },
|
{ name = "jsonpatch" },
|
||||||
|
|||||||
Reference in New Issue
Block a user