From d1a0cdae2cc5e1d8993f4ac6bf12b00e2de627e3 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:06:34 -0700 Subject: [PATCH] refactor(image_gen,browser): compact module/function docstrings and comments across providers (WHYs kept) --- plugins/browser/_common.py | 35 +++++--------- plugins/browser/browser_use/provider.py | 43 +++++++---------- plugins/browser/browserbase/provider.py | 12 ++--- plugins/browser/firecrawl/provider.py | 16 +++---- plugins/image_gen/_common.py | 3 +- plugins/image_gen/deepinfra/__init__.py | 31 +++++-------- plugins/image_gen/fal/__init__.py | 19 +++----- plugins/image_gen/meta-ai/__init__.py | 20 +++----- plugins/image_gen/openai-codex/__init__.py | 3 +- plugins/image_gen/openai/__init__.py | 15 +++--- plugins/image_gen/xai/__init__.py | 54 ++++++++-------------- 11 files changed, 95 insertions(+), 156 deletions(-) diff --git a/plugins/browser/_common.py b/plugins/browser/_common.py index c0aef2e687..490ef7dc3b 100644 --- a/plugins/browser/_common.py +++ b/plugins/browser/_common.py @@ -1,11 +1,7 @@ -"""Shared base for the bundled cloud-browser provider plugins. - -Every vendor (Browserbase, Browser Use, Firecrawl) speaks the same REST shape: -POST to create a session, one request to release it. :class:`CloudBrowserProvider` -owns that lifecycle; subclasses supply class attributes and small hooks. Log -messages carry the vendor label and go to the subclass module's logger so the -emitted text matches the pre-refactor per-vendor modules. -""" +"""Shared base for the bundled cloud-browser plugins. Every vendor speaks the same REST shape +(POST to create a session, one request to release it); :class:`CloudBrowserProvider` owns that +lifecycle, subclasses supply attributes + hooks. Logs go to the subclass module's logger with the +vendor label so emitted text matches the pre-refactor per-vendor modules.""" from __future__ import annotations @@ -21,26 +17,19 @@ _CLOSE_OK = {200, 201, 204} class CloudBrowserProvider(BrowserProvider): - """REST cloud-browser provider driven by class attributes + hooks. - - Subclasses set ``provider_id`` / ``label``, ``release_method`` / ``release_path`` - (``{session_id}`` placeholder, appended to ``config["base_url"]``), implement - ``_get_config_or_none()`` and ``_headers(config)``, and write ``create_session`` - on top of :meth:`_post_create` / :meth:`_check_created` / :meth:`_session_name`. - """ + """Subclasses set ``provider_id``/``label``, ``release_method``/``release_path`` (``{session_id}`` + placeholder appended to ``config["base_url"]``), implement ``_get_config_or_none()`` and + ``_headers(config)``, and build ``create_session`` on ``_post_create``/``_check_created``.""" provider_id: str label: str release_method: str release_path: str missing_credentials_error: str = "" - # Setup-picker metadata; ``setup_tag=None`` hides the provider from the picker. - setup_tag: Optional[str] = None + setup_tag: Optional[str] = None # ``None`` hides the provider from the setup picker setup_env_vars: List[Dict[str, str]] = [] - # Rendered noun in "Failed to create