mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-03 10:55:08 +00:00
fix(langchain): recognize ChatAnthropicVertex in _get_approximate_token_counter (#36320)
This commit is contained in:
@@ -141,7 +141,7 @@ Example:
|
||||
|
||||
def _get_approximate_token_counter(model: BaseChatModel) -> TokenCounter:
|
||||
"""Tune parameters of approximate token counter based on model type."""
|
||||
if model._llm_type == "anthropic-chat": # noqa: SLF001
|
||||
if model._llm_type.startswith("anthropic-chat"): # noqa: SLF001
|
||||
# 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
|
||||
return partial(
|
||||
|
||||
Reference in New Issue
Block a user