From 2a863727f9a38296a19bfc0e6d76c8b2bda7dddd Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Sun, 23 Nov 2025 20:00:07 -0500 Subject: [PATCH] fix(infra,core): nits (#34079) * Add missing `nits` to allowed PR linting scopes * Ensure `MAJOR.MINOR.PATCH` consistency in admonitions * Ensure valid spacing in admonitions --- .github/workflows/pr_lint.yml | 1 + libs/core/langchain_core/language_models/chat_models.py | 4 ++-- libs/core/langchain_core/messages/utils.py | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_lint.yml b/.github/workflows/pr_lint.yml index 524caa9e076..806168f5660 100644 --- a/.github/workflows/pr_lint.yml +++ b/.github/workflows/pr_lint.yml @@ -102,6 +102,7 @@ jobs: qdrant xai infra + deps requireScope: false disallowScopes: | release diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index 520783115df..c03086acb95 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -333,7 +333,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC): [`langchain-openai`](https://pypi.org/project/langchain-openai)) can also use this field to roll out new content formats in a backward-compatible way. - !!! version-added "Added in `langchain-core` 1.0" + !!! version-added "Added in `langchain-core` 1.0.0" """ @@ -349,7 +349,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC): Example profile data includes context window sizes, supported modalities, or support for tool calling, structured output, and other features. - !!! version-added "Added in `langchain-core` 1.1" + !!! version-added "Added in `langchain-core` 1.1.0" """ model_config = ConfigDict( diff --git a/libs/core/langchain_core/messages/utils.py b/libs/core/langchain_core/messages/utils.py index 9c0c89a23cb..035cc0f6bf7 100644 --- a/libs/core/langchain_core/messages/utils.py +++ b/libs/core/langchain_core/messages/utils.py @@ -738,8 +738,10 @@ def trim_messages( Set to `len` to count the number of **messages** in the chat history. !!! note + Use `count_tokens_approximately` to get fast, approximate token counts. + This is recommended for using `trim_messages` on the hot path, where exact token counting is not necessary.