
    i                     ^    d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ  G d de      Zy	)
zPassthrough node executor.    )List)Node)PassthroughConfig)MessageMessageRole)NodeExecutorc                   0    e Zd ZdZdedee   dee   fdZy)PassthroughNodeExecutorz-Forward input messages without modifications.nodeinputsreturnc                    |j                   dk7  rt        d|j                   d      |j                  t              }|t        d|j                   d      |sVd|j                   d}| j
                  j                  ||j                  ddi	       t        d
t        j                        gS |j                  rot        |      dkD  rM| j
                  j                  d|j                   dt        |       d|j                  dt        |      i	       |d   j                         gS |D cg c]  }|j                          c}S c c}w )NpassthroughzNode z is not a passthrough nodez" missing passthrough configurationzPassthrough node 'z' triggered without inputsinput_countr   )node_iddetails )contentrole   z' received z$ inputs; forwarding the latest entry)	node_type
ValueErrorid	as_configr   log_managerwarningr   r   USERonly_last_messagelendebugclone)selfr   r   configwarning_msgmsgs         W/Users/bowang/.openclaw/workspace/ChatDev/runtime/node/executor/passthrough_executor.pyexecutezPassthroughNodeExecutor.execute   s6   >>]*uTWWI-GHII 12>uTWWI-OPQQ.twwi7QRK$$[$''M[\K]$^B[-=-=>??##6{Q  &&(	S[MImn GG*CK8 ' 
 2J$$&''+126CCIIK6222s   0E
N)__name__
__module____qualname____doc__r   r   r   r(        r'   r
   r
      s'    73D 3$w- 3DM 3r.   r
   N)r,   typingr   entity.configsr   entity.configs.node.passthroughr   entity.messagesr   r   runtime.node.executor.baser   r
   r-   r.   r'   <module>r4      s#        = 0 33l 3r.   