_approximate_token_counter() — langchain Function Reference
Architecture documentation for the _approximate_token_counter() function in utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 18c39895_f266_1937_05dc_c90bd6becb90["_approximate_token_counter()"] 0b528c80_0ce7_1c74_8932_bc433bcb03c6["utils.py"] 18c39895_f266_1937_05dc_c90bd6becb90 -->|defined in| 0b528c80_0ce7_1c74_8932_bc433bcb03c6 0a2d5a3a_f0de_5ab6_561c_6ebc3475ad11["count_tokens_approximately()"] 18c39895_f266_1937_05dc_c90bd6becb90 -->|calls| 0a2d5a3a_f0de_5ab6_561c_6ebc3475ad11 style 18c39895_f266_1937_05dc_c90bd6becb90 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/messages/utils.py lines 2346–2348
def _approximate_token_counter(messages: Sequence[BaseMessage]) -> int:
"""Wrapper for `count_tokens_approximately` that matches expected signature."""
return count_tokens_approximately(messages)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does _approximate_token_counter() do?
_approximate_token_counter() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/utils.py.
Where is _approximate_token_counter() defined?
_approximate_token_counter() is defined in libs/core/langchain_core/messages/utils.py at line 2346.
What does _approximate_token_counter() call?
_approximate_token_counter() calls 1 function(s): count_tokens_approximately.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free