
    Pi                       d dl mZ d dlmZ d dlmZ  G d de          Z G d de          Z G d d	e	          Z
 G d
 de	          Z G d de          Z G d de	          Z G d de          Z G d de          Z G d de	          ZeZ ed           G d de                      Z G d de          Z G d de          Z G d de	          Z G d  d!e          Zd"S )#    )annotations)document)AppErrorc                      e Zd ZdZdS )DuplicateBlockErrorzBRaised when a Blocks contains more than one Block with the same idN__name__
__module____qualname____doc__     e/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/gradio/exceptions.pyr   r      s        LLDr   r   c                      e Zd ZdZdS )InvalidComponentErrorz(Raised when invalid components are used.Nr   r   r   r   r   r              22Dr   r   c                      e Zd ZdZdS )ModelNotFoundErrorzVRaised when the provided model doesn't exists or is not found by the provided api url.Nr   r   r   r   r   r      s        ``Dr   r   c                      e Zd ZdZdS )RenderErrorzjRaised when a component has not been rendered in the current Blocks but is expected to have been rendered.Nr   r   r   r   r   r      s        ttDr   r   c                      e Zd ZdS )InvalidApiNameErrorNr	   r
   r   r   r   r   r   r              Dr   r   c                      e Zd ZdS )ServerFailedToStartErrorNr   r   r   r   r   r   #   r   r   r   c                      e Zd ZdZdS )InvalidBlockErrorzcRaised when an event in a Blocks contains a reference to a Block that is not in the original BlocksNr   r   r   r   r   r   '   s        mmDr   r   c                      e Zd ZdZdS )ReloadErrorz?Raised when something goes wrong when reloading the gradio app.Nr   r   r   r   r    r    -   s        IIDr   r    c                      e Zd ZdZdS )GradioVersionIncompatibleErrorz(Raised when loading a 3.x space with 4.0Nr   r   r   r   r"   r"   3   r   r   r"   modals)documentation_groupc                  6     e Zd ZdZ	 	 	 	 	 dd fdZd Z xZS )Errora!  
    This class allows you to pass custom error messages to the user. You can do so by raising a gr.Error("custom message") anywhere in the code, and when that line is executed the custom message will appear in a modal on the demo.
    Example:
        import gradio as gr
        def divide(numerator, denominator):
            if denominator == 0:
                raise gr.Error("Cannot divide by zero!")
        gr.Interface(divide, ["number", "number"], "number").launch()
    Demos: calculator, blocks_chained_events
    Guides: alerts
    Error raised.
   Tmessagestrdurationfloat | Nonevisiblebooltitleprint_exceptionc                T    t                                          |||||           dS )a?  
        Parameters:
            message: The error message to be displayed to the user. Can be HTML, which will be rendered in the modal.
            duration: The duration in seconds to display the error message. If None or 0, the error message will be displayed until the user closes it.
            visible: Whether the error message should be displayed in the UI.
            title: The title to be displayed to the user at the top of the error modal.
            print_exception: Whether to print traceback of the error to the console when the error is raised.
        )r)   r+   r-   r/   r0   Nsuper__init__)selfr)   r+   r-   r/   r0   	__class__s         r   r4   zError.__init__J   s?      	+ 	 	
 	
 	
 	
 	
r   c                *    t          | j                  S N)reprr)   )r5   s    r   __str__zError.__str__b   s    DL!!!r   )r'   r(   Tr&   T)
r)   r*   r+   r,   r-   r.   r/   r*   r0   r.   )r	   r
   r   r   r4   r:   __classcell__r6   s   @r   r&   r&   <   sl        
 
 '!# $
 
 
 
 
 
 
0" " " " " " "r   r&   c                      e Zd ZdS )ComponentDefinitionErrorNr   r   r   r   r>   r>   f   r   r   r>   c                      e Zd ZdS )InvalidPathErrorNr   r   r   r   r@   r@   j   r   r   r@   c                      e Zd ZdS )ChecksumMismatchErrorNr   r   r   r   rB   rB   n   r   r   rB   c                  &     e Zd ZdZdd fdZ xZS )TooManyRequestsErrorz;Raised when the Hugging Face API returns a 429 status code.*Too many requests. Please try again later.r)   r*   c                J    t                                          |           d S r8   r2   )r5   r)   r6   s     r   r4   zTooManyRequestsError.__init__u   s!    !!!!!r   )rE   )r)   r*   )r	   r
   r   r   r4   r;   r<   s   @r   rD   rD   r   sH        EE" " " " " " " " " " "r   rD   N)
__future__r   gradio_client.documentationr   gradio_client.exceptionsr   
ValueErrorr   r   	Exceptionr   r   r   r   r   r    r"   InvalidApiNamer&   NotImplementedErrorr>   r@   rB   rD   r   r   r   <module>rN      s   " " " " " " 0 0 0 0 0 0 - - - - - -	 	 	 	 	* 	 	 		 	 	 	 	J 	 	 		 	 	 	 	 	 	 		 	 	 	 	) 	 	 		 	 	 	 	* 	 	 		 	 	 	 	y 	 	 		 	 	 	 	
 	 	 		 	 	 	 	* 	 	 		 	 	 	 	Y 	 	 	 % 
h'''&" &" &" &" &"H &" &" ('&"R	 	 	 	 	2 	 	 		 	 	 	 	z 	 	 		 	 	 	 	I 	 	 	" " " " "5 " " " " "r   