From 875a0e6404419909be6691280663c442abe3f23e Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 29 Oct 2026 04:47:04 -0700 Subject: [PATCH] style(count_tokens): drop the new docstrings --- litellm/llms/anthropic/common_utils.py | 2 -- litellm/llms/anthropic/count_tokens/transformation.py | 7 ------- .../test_anthropic_count_tokens_transformation.py | 2 -- .../bedrock/count_tokens/test_bedrock_token_counter.py | 2 -- 4 files changed, 13 deletions(-) diff --git a/litellm/llms/anthropic/common_utils.py b/litellm/llms/anthropic/common_utils.py index 29e4121c1c0..e9c29691184 100644 --- a/litellm/llms/anthropic/common_utils.py +++ b/litellm/llms/anthropic/common_utils.py @@ -349,8 +349,6 @@ def _beta_header_values(side: str | Sequence[str] | None) -> tuple[str, ...]: def context_management_betas(context_management: JsonValue) -> frozenset[str]: - """The anthropic-beta values a ``context_management`` body needs: the compact beta for a - ``compact_20260112`` edit and the context-management beta for every other edit.""" edits: Final = context_management.get("edits") if isinstance(context_management, dict) else None if not isinstance(edits, list): return frozenset() diff --git a/litellm/llms/anthropic/count_tokens/transformation.py b/litellm/llms/anthropic/count_tokens/transformation.py index 338950c38ea..e7e6ba5c8ce 100644 --- a/litellm/llms/anthropic/count_tokens/transformation.py +++ b/litellm/llms/anthropic/count_tokens/transformation.py @@ -350,13 +350,6 @@ def claude_count_options( context_management: CountContextManagement | None, deployment: Mapping[str, object] | None, ) -> ClaudeCountOptions | ChatCountTranslationError: - """The thinking, tool_choice, output_config and context_management a Claude count sends, with the - anthropic-beta values they need, after the deployment's own /v1/messages transform rewrites them. - - The transform runs without messages and with a max_tokens above any thinking budget, so it never - caps a budget the caller's real max_tokens would allow. An error it raises is the error inference - answers for the same body. - """ sent: Final = { **{name: value for name, value in request_options.items() if value is not None}, **({} if context_management is None else {"context_management": context_management.spec}), diff --git a/tests/unit/llms/anthropic/test_anthropic_count_tokens_transformation.py b/tests/unit/llms/anthropic/test_anthropic_count_tokens_transformation.py index cdae81ef9cc..51fff399f5e 100644 --- a/tests/unit/llms/anthropic/test_anthropic_count_tokens_transformation.py +++ b/tests/unit/llms/anthropic/test_anthropic_count_tokens_transformation.py @@ -942,8 +942,6 @@ async def test_counter_sends_the_options_and_context_edits_messages_inference_se request_options: dict[str, JsonValue], context_management: dict[str, JsonValue] | None, ) -> None: - """A /v1/messages count that drops thinking, tool_choice, output_config or context_management - counts a different prompt than inference bills, so it carries them the way inference sends them.""" inference: Final = await _messages_inference_request( counter_type, count_endpoint.removesuffix("/count_tokens"), diff --git a/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py b/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py index 47484942927..8a6a1242b95 100644 --- a/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py +++ b/tests/unit/llms/bedrock/count_tokens/test_bedrock_token_counter.py @@ -389,8 +389,6 @@ async def _messages_inference_and_count(deployment_model: str, model_to_use: str async def test_runtime_count_sends_the_options_and_context_edits_invoke_inference_sends( deployment_model: str, model_to_use: str ) -> None: - """Bedrock invoke inference drops edits InvokeModel rejects and sends its betas in the body, so a count - that skips either counts a prompt inference never sends, or gets the 400 inference avoids.""" inference, bedrock = await _messages_inference_and_count(deployment_model, model_to_use) assert bedrock.posted_hosts() == (RUNTIME_HOST,)