
    {h	                        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y)    )annotations)Anyc                      e Zd ZdZy)InstructorErrorz2Base exception for all Instructor-specific errors.N__name__
__module____qualname____doc__     V/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/instructor/exceptions.pyr   r          <r   r   c                  :     e Zd ZdZddd	 	 	 	 	 	 	 d fdZ xZS )IncompleteOutputExceptionzXException raised when the output from LLM is incomplete due to max tokens limit reached.Nz:The output is incomplete due to a max_tokens length limit.)last_completionmessagec               :    || _         t        |   |g|i | y N)r   super__init__)selfr   r   argskwargs	__class__s        r   r   z"IncompleteOutputException.__init__   s$      /24262r   )r   	list[Any]r   
Any | Noner   strr   dict[str, Any]r   r	   r
   r   r   __classcell__r   s   @r   r   r      s>    b
 '+S	33 $3 	3
 !3 3r   r   c                  H     e Zd ZdZdddd	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ xZS )InstructorRetryExceptionz=Exception raised when all retry attempts have been exhausted.N)r   messagescreate_kwargsc               j    || _         || _        || _        || _        || _        t        |   |i | y r   )r   r%   
n_attemptstotal_usager&   r   r   )	r   r   r%   r(   r)   r&   r   r   r   s	           r   r   z!InstructorRetryException.__init__   s=      / $&*$)&)r   )r   r   r   r   r%   zlist[Any] | Noner(   intr)   r*   r&   zdict[str, Any] | Noner   r   r    r"   s   @r   r$   r$      sa    G
 '+%) 04** $* #	*
 * * -* !* *r   r$   c                      e Zd ZdZy)ValidationErrorz0Exception raised when response validation fails.Nr   r   r   r   r,   r,   /   s    :r   r,   c                  $     e Zd ZdZd fdZ xZS )ProviderErrorz.Exception raised for provider-specific errors.c                D    || _         t        |   | d| g|i | y )Nz: )providerr   r   )r   r0   r   r   r   r   s        r   r   zProviderError.__init__8   s,     H:Ry1CDCFCr   )r0   r   r   r   r   r   r   r   r    r"   s   @r   r.   r.   5   s    8D Dr   r.   c                      e Zd ZdZy)ConfigurationErrorz2Exception raised for configuration-related errors.Nr   r   r   r   r2   r2   =   r   r   r2   c                  8     e Zd ZdZ	 	 	 	 	 	 	 	 	 	 d fdZ xZS )	ModeErrorz=Exception raised when an invalid mode is used for a provider.c                    || _         || _        || _        d| d| ddj                  |       }t	        |   |g|i | y )NzInvalid mode 'z' for provider 'z'. Valid modes: z, )moder0   valid_modesjoinr   r   )r   r6   r0   r7   r   r   r   r   s          r   r   zModeError.__init__F   sZ     	 &"4&(8
BRSWS\S\]hSiRjk24262r   )
r6   r   r0   r   r7   z	list[str]r   r   r   r   r    r"   s   @r   r4   r4   C   s@    G33 3 	3
 3 3 3r   r4   c                      e Zd ZdZy)ClientErrorz;Exception raised for client initialization or usage errors.Nr   r   r   r   r:   r:   U   s    Er   r:   N)
__future__r   typingr   	Exceptionr   r   r$   r,   r.   r2   r4   r:   r   r   r   <module>r>      sm    " 	i 	3 3* **	o 	DO D	 	3 3$	/ 	r   