o
    :/i                     @   sD   d Z ddlmZ G dd deZG dd deZG dd deZd	S )
zCustom exceptions for vLLM.    )Anyc                	       sJ   e Zd ZdZddddededB deddf fdd	Z fd
dZ  ZS )VLLMValidationErrora  vLLM-specific validation error for request validation failures.

    Args:
        message: The error message describing the validation failure.
        parameter: Optional parameter name that failed validation.
        value: Optional value that was rejected during validation.
    N)	parametervaluemessager   r   returnc                   s   t  | || _|| _d S N)super__init__r   r   )selfr   r   r   	__class__ \/lsinfo/ai/hellotax_ai/llm_service/venv_vllm/lib/python3.10/site-packages/vllm/exceptions.pyr
      s   
zVLLMValidationError.__init__c                    sd   t   }g }| jd ur|d| j  | jd ur#|d| j  |r0| dd| dS |S )Nz
parameter=zvalue=z (z, ))r	   __str__r   appendr   join)r   baseextrasr   r   r   r      s   


zVLLMValidationError.__str__)	__name__
__module____qualname____doc__strr   r
   r   __classcell__r   r   r   r   r   	   s    r   c                   @   s   e Zd ZdZdS )VLLMNotFoundErrorzvLLM-specific NotFoundErrorN)r   r   r   r   r   r   r   r   r   '   s    r   c                   @   s8   e Zd ZU dZeed< dededdfddZd	d
 ZdS )LoRAAdapterNotFoundErrorzException raised when a LoRA adapter is not found.

    This exception is thrown when a requested LoRA adapter does not exist
    in the system.

    Attributes:
        message: The error message string describing the exception
    r   	lora_name	lora_pathr   Nc                 C   s   d| d| }|| _ d S )NzLoading lora z failed: No adapter found for r   )r   r   r   r   r   r   r   r
   9   s   
z!LoRAAdapterNotFoundError.__init__c                 C   s   | j S r   r    )r   r   r   r   r   A   s   z LoRAAdapterNotFoundError.__str__)r   r   r   r   r   __annotations__r
   r   r   r   r   r   r   -   s   
 	
r   N)r   typingr   
ValueErrorr   	Exceptionr   r   r   r   r   r   <module>   s
   