§
    ,Vj4
  ã                  ór   — d Z ddlmZ ddlmZmZ ddlmZmZm	Z	  G d„ de¦  «        Z
 G d„ de¦  «        Zd	S )
z3Abstract base classes for web capability providers.é    )Úannotations)ÚABCÚabstractmethod)ÚAnyÚDictÚListc                  ó\   — e Zd ZdZedd„¦   «         Zedd„¦   «         Zeddd„¦   «         ZdS )ÚWebSearchProvideraŠ  Interface for web search backends (Firecrawl, Tavily, Exa, etc.).

    Implementations live in sibling modules.  The user selects a provider
    via ``hermes tools``; the choice is persisted as
    ``config["web"]["search_backend"]`` (falling back to
    ``config["web"]["backend"]``).

    Search providers return results in a normalized format::

        {
            "success": True,
            "data": {
                "web": [
                    {"title": str, "url": str, "description": str, "position": int},
                    ...
                ]
            }
        }

    On failure::

        {"success": False, "error": str}
    ÚreturnÚstrc                ó   — dS ©z9Short, human-readable name shown in logs and diagnostics.N© ©Úselfs    ú6/root/.hermes/hermes-agent/tools/web_providers/base.pyÚprovider_namezWebSearchProvider.provider_name"   ó   € € € ó    Úboolc                ó   — dS ©u¶   Return True when all required env vars / credentials are present.

        Called at tool-registration time to gate availability.
        Must be cheap â€” no network calls.
        Nr   r   s    r   Úis_configuredzWebSearchProvider.is_configured&   r   r   é   ÚqueryÚlimitÚintúDict[str, Any]c                ó   — dS )z3Execute a web search and return normalized results.Nr   )r   r   r   s      r   ÚsearchzWebSearchProvider.search.   r   r   N©r   r   ©r   r   )r   )r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r    r   r   r   r
   r
   	   sŽ   € € € € € ðð ð0 ðHð Hð Hñ „^ðHð ðð ð ñ „^ðð ðBð Bð Bð Bñ „^ðBð Bð Br   r
   c                  óZ   — e Zd ZdZedd„¦   «         Zedd„¦   «         Zedd
„¦   «         ZdS )ÚWebExtractProviderah  Interface for web content extraction backends.

    Implementations live in sibling modules.  The user selects a provider
    via ``hermes tools``; the choice is persisted as
    ``config["web"]["extract_backend"]`` (falling back to
    ``config["web"]["backend"]``).

    Extract providers return results in a normalized format::

        {
            "success": True,
            "data": [
                {"url": str, "title": str, "content": str,
                 "raw_content": str, "metadata": dict},
                ...
            ]
        }

    On failure::

        {"success": False, "error": str}
    r   r   c                ó   — dS r   r   r   s    r   r   z WebExtractProvider.provider_nameK   r   r   r   c                ó   — dS r   r   r   s    r   r   z WebExtractProvider.is_configuredO   r   r   Úurlsú	List[str]r   c                ó   — dS )zBExtract content from the given URLs and return normalized results.Nr   )r   r+   Úkwargss      r   ÚextractzWebExtractProvider.extractW   r   r   Nr!   r"   )r+   r,   r   r   )r#   r$   r%   r&   r   r   r   r/   r   r   r   r(   r(   3   sˆ   € € € € € ðð ð. ðHð Hð Hñ „^ðHð ðð ð ñ „^ðð ðQð Qð Qñ „^ðQð Qð Qr   r(   N)r&   Ú
__future__r   Úabcr   r   Útypingr   r   r   r
   r(   r   r   r   ú<module>r3      sÄ   ðØ 9Ð 9à "Ð "Ð "Ð "Ð "Ð "à #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "Ð "Ð "ð'Bð 'Bð 'Bð 'Bð 'B˜ñ 'Bô 'Bð 'BðT&Qð &Qð &Qð &Qð &Q˜ñ &Qô &Qð &Qð &Qð &Qr   