Skip to content

The agent engineering platform.

docs[patch]: add warning to token counter docstring (#30426)

Vadym Barda673ec000301e
diff --git a/libs/core/langchain_core/messages/utils.py b/libs/core/langchain_core/messages/utils.py
index ad6627888b..c5303fbed5 100644
--- a/libs/core/langchain_core/messages/utils.py
+++ b/libs/core/langchain_core/messages/utils.py
@@ -1529,6 +1529,9 @@ def count_tokens_approximately(
This is a simple approximation that may not match the exact token count
used by specific models. For accurate counts, use model-specific tokenizers.
+ Warning:
+ This function does not currently support counting image tokens.
+
.. versionadded:: 0.3.46
"""
token_count = 0.0