
    Fd                         d dl Z d dlmZmZmZmZ d dlmZ d dlm	Z	m
Z
 dZ G d de          Z	 	 dd	ed
edeeef         deeegef         z  dee         dedef         fdZdS )    N)AnyCallableOptional	TypedDict)Config)CommandCommandParameterauto_gpt_commandc                   .    e Zd ZU eed<   eed<   eed<   dS )CommandParameterSpectypedescriptionrequiredN)__name__
__module____qualname__str__annotations__bool     MC:\Users\Administrator\Downloads\Auto-GPT-master\autogpt\command_decorator.pyr   r      s.         
IIINNNNNr   r   Tnamer   
parametersenableddisabled_reasonreturn.c                 Z     dt           dt          f         dt          f fd}|S )zPThe command decorator is used to create Command objects from ordinary functions.func.r   c                      d                                  D             }t           |          }t          j                   dt          f fd            }||_        t          |t          d           |S )Nc                     g | ]S\  }}t          ||                    d           |                    dd          |                    dd                    TS )r   r   stringr   F)r   r   r   r   )r	   get).0
param_name	parameters      r   
<listcomp>z.command.<locals>.decorator.<locals>.<listcomp>   sq     
 
 
 &
I %MM-88]]6844"z599	  
 
 
r   )r   r   methodr   r   r   r   c                       | i |S )Nr   )argskwargsr   s     r   wrapperz+command.<locals>.decorator.<locals>.wrapper-   s    4((((r   T)itemsr   	functoolswrapsr   commandsetattrAUTO_GPT_COMMAND_IDENTIFIER)	r   typed_parameterscmdr,   r   r   r   r   r   s	   `   r   	decoratorzcommand.<locals>.decorator   s    
 
 *4)9)9););
 
 
 #'+
 
 
 
			) 	) 	) 	) 	) 	) 
		) 4d;;;r   )r   r   r   )r   r   r   r   r   r5   s   ````` r   r0   r0      sX    c* w          : r   )TN)r.   typingr   r   r   r   autogpt.configr   autogpt.models.commandr   r	   r2   r   r   dictr   r0   r   r   r   <module>r:      s       5 5 5 5 5 5 5 5 5 5 5 5 ! ! ! ! ! ! < < < < < < < < 1     9    04%)& &
&& S../& HfXt^,,	&
 c]& c3h& & & & & &r   