
    Fd/                     L    d dl mZmZmZ d dlmZ ddlmZ  G d d          ZdS )    )AnyCallableOptional)Config   )CommandParameterc                       e Zd ZdZ	 	 ddedededef         dee         d	e	ee
ge	f         z  d
ee         fdZdefdZdefdZdS )Commanda   A class representing a command.

    Attributes:
        name (str): The name of the command.
        description (str): A brief description of what the command does.
        parameters (list): The parameters of the function that the command executes.
    TNnamedescriptionmethod.
parametersenableddisabled_reasonc                 Z    || _         || _        || _        || _        || _        || _        d S )N)r   r   r   r   r   r   )selfr   r   r   r   r   r   s          JC:\Users\Administrator\Downloads\Auto-GPT-master\autogpt\models\command.py__init__zCommand.__init__   s6     	&$.    returnc                     t          |d          r4t          | j                  r |                     |d                   | _        | j        s$| j        rd| j         d| j         S d| j         dS  | j        |i |S )Nconfigz	Command 'z' is disabled: z' is disabled)hasattrcallabler   r   r   r   )r   argskwargss      r   __call__zCommand.__call__!   s    68$$ 	:$,)?)? 	:<<x(899DL| 	8# TS49SST=QSSS7ty7777t{D+F+++r   c                 t    d | j         D             }| j         d| j         dd                    |           dS )Nc                 T    g | ]%}|j          d |j        r|j        n
d|j         d &S ): z	Optional[])r   requiredtype).0params     r   
<listcomp>z#Command.__str__.<locals>.<listcomp>+   sS     
 
 
 zZZ5>XUZZ?X5:?X?X?XZZ
 
 
r   r    z, params: (z, ))r   r   r   join)r   paramss     r   __str__zCommand.__str__*   sT    
 

 
 
 )PPt/PPDIIf<M<MPPPPr   )TN)__name__
__module____qualname____doc__strr   r   listr   boolr   r   r   r   r*    r   r   r
   r
      s          48)-/ // / c"	/
 )*/ &400/ "#/ / / / ,3 , , , ,Q Q Q Q Q Q Qr   r
   N)	typingr   r   r   autogpt.configr   command_parameterr   r
   r2   r   r   <module>r6      s    * * * * * * * * * * ! ! ! ! ! ! / / / / / /'Q 'Q 'Q 'Q 'Q 'Q 'Q 'Q 'Q 'Qr   