From b6695cd2e1545cff4cb573f36eebefac39db68a4 Mon Sep 17 00:00:00 2001 From: STJ Date: Fri, 13 Mar 2026 14:40:30 -0700 Subject: [PATCH] remove slop comments --- strix/tools/browser/litellm/chat.py | 27 ----------------------- strix/tools/browser/litellm/serializer.py | 10 --------- 2 files changed, 37 deletions(-) diff --git a/strix/tools/browser/litellm/chat.py b/strix/tools/browser/litellm/chat.py index 31a27594..62417eeb 100644 --- a/strix/tools/browser/litellm/chat.py +++ b/strix/tools/browser/litellm/chat.py @@ -20,23 +20,6 @@ T = TypeVar("T", bound=BaseModel) @dataclass class ChatLiteLLM(BaseChatModel): - """Chat model that routes to any provider via LiteLLM. - - Uses litellm's unified ``acompletion`` API to support all providers - (OpenAI, Anthropic, Google, Ollama, OpenRouter, DeepSeek, etc.) - through a single interface. - - The ``model`` parameter uses litellm's model format, e.g.:: - - "gpt-4o" - "anthropic/claude-sonnet-4-20250514" - "openrouter/google/gemini-2.0-flash-001" - "ollama/llama3" - - Structured output (``output_format``) is handled via litellm's - ``response_format`` parameter which translates across providers. - """ - model: str api_key: str | None = None api_base: str | None = None @@ -128,16 +111,6 @@ class ChatLiteLLM(BaseChatModel): output_format: type[T] | None = None, **kwargs: Any, # noqa: ARG002 ) -> ChatInvokeCompletion[T] | ChatInvokeCompletion[str]: - """Invoke the model via litellm. - - Args: - messages: List of browser-use chat messages. - output_format: Optional Pydantic model class for structured output. - **kwargs: Extra keyword args (``session_id`` etc.) — ignored. - - Returns: - ``ChatInvokeCompletion`` with either a string or parsed Pydantic model. - """ import litellm litellm_messages = LiteLLMMessageSerializer.serialize(messages) diff --git a/strix/tools/browser/litellm/serializer.py b/strix/tools/browser/litellm/serializer.py index f802b4c0..0477b071 100644 --- a/strix/tools/browser/litellm/serializer.py +++ b/strix/tools/browser/litellm/serializer.py @@ -11,13 +11,10 @@ from browser_use.llm.messages import ( class LiteLLMMessageSerializer: - """Serializer for converting browser-use message types to LiteLLM format.""" - @staticmethod def _serialize_user_content( content: str | list[ContentPartTextParam | ContentPartImageParam], ) -> str | list[dict[str, Any]]: - """Convert user message content for LiteLLM compatibility.""" if isinstance(content, str): return content @@ -46,7 +43,6 @@ class LiteLLMMessageSerializer: def _serialize_system_content( content: str | list[ContentPartTextParam], ) -> str | list[dict[str, Any]]: - """Convert system message content for LiteLLM compatibility.""" if isinstance(content, str): return content @@ -62,7 +58,6 @@ class LiteLLMMessageSerializer: def _serialize_assistant_content( content: str | list[Any] | None, ) -> str | list[dict[str, Any]] | None: - """Convert assistant message content for LiteLLM compatibility.""" if content is None: return None if isinstance(content, str): @@ -88,11 +83,6 @@ class LiteLLMMessageSerializer: @staticmethod def serialize(messages: list[BaseMessage]) -> list[dict[str, Any]]: - """Convert browser-use messages to litellm-compatible dicts (OpenAI format). - - LiteLLM accepts OpenAI-format message dicts for all providers, handling - provider-specific conversion (e.g. image blocks for Anthropic) internally. - """ result: list[dict[str, Any]] = [] for msg in messages: if isinstance(msg, UserMessage):