Ë
    áß²jû  ã                   óŠ   — U d Z ddlZddlZddlmZmZmZmZmZ i Z	e
ed<   daeed<   dZded	ed
dfd„Zdefd„Zdd„Zd
efd„Zy)z£Transport registry for provider response normalization.
    transport = get_transport("anthropic_messages")
    result = transport.normalize_response(raw_response)é    N)ÚNormalizedResponseÚToolCallÚUsageÚbuild_tool_callÚmap_finish_reasonÚ	_REGISTRYFÚ_discovered)Ú	anthropicÚcodexÚchat_completionsÚbedrockÚapi_modeÚtransport_clsÚreturnc                 ó   — |t         | <   y)z2Register a transport class for an api_mode string.N)r   )r   r   s     ú>/home/ubuntu/.hermes/hermes-agent/agent/transports/__init__.pyÚregister_transportr      s   € à'„IˆhÒó    c                 ór   — t         r| t        vr
t        «        t        j                  | «      }|€dS  |«       S )zbReturn a transport instance for ``api_mode``, or None so callers can fall back to the legacy path.N)r	   r   Ú_discover_transportsÚget)r   Úclss     r   Úget_transportr      s3   € õ ˜(¬)Ñ3ÜÔÜ
�-‰-˜Ó
!€CØ�;ˆ4Ð)¡C£EÐ)r   c                  óª   — da t        D ]<  } t        j                  t        «      5  t        j                  d| › �«       ddd«       Œ> y# 1 sw Y   ŒIxY w)z:Import all transport modules to trigger auto-registration.Tzagent.transports.N)r	   Ú_TRANSPORT_MODULESÚ
contextlibÚsuppressÚImportErrorÚ	importlibÚimport_module)Únames    r   r   r   #   s]   € ð €KÜ"ò @ˆÜ× Ñ ¤Ó-ñ 	@Ü×#Ñ#Ð&7¸°vÐ$>Ô?÷	@ð 	@ñ@÷	@ð 	@ús   ¥A	Á	A	c                  ó@   — t         s
t        «        t        t        «      S )u   Every api_mode with a registered transport, in-tree and plugin-supplied.

    ``register_transport`` is the public seam for a provider plugin that speaks
    its own dialect, but the api_mode gates elsewhere are closed literals â€” a
    plugin's mode was rejected there and rewritten to ``chat_completions``, with
    the dialect translation dropped and no error raised. Callers that validate an
    api_mode use this so a registered transport is accepted on every path.
    Discovers first, so a cold registry never reports an empty set.
    )r	   r   Ú	frozensetr   © r   r   Úregistered_api_modesr%   ,   s   € õ ÜÔÜ”YÓÐr   )r   N)Ú__doc__r   r   Úagent.transports.typesr   r   r   r   r   r   ÚdictÚ__annotations__r	   Úboolr   ÚstrÚtyper   r   r   r#   r%   r$   r   r   ú<module>r-      sp   ðò;ó Û ÷õ ð €	ˆ4Ó Ø€ˆTÓ ØJÐ ð( ð (°Tð (¸dó (ð
*˜Có *ó@ð ˜iô  r   