o
    ®©Zhr  ã                   @   s<   d dl mZmZ d dlmZ d dlmZ G dd„ deƒZdS )é    )ÚAnyÚDict)Úpre_init)Ú
BaseOpenAIc                       sZ   e Zd ZdZedefdd„ƒZedee	e
f f‡ fdd„ƒZededefdd	„ƒZ‡  ZS )
ÚOpenLMzOpenLM models.Úreturnc                 C   s   dS )NF© )Úclsr   r   úV/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/llms/openlm.pyÚis_lc_serializable   s   zOpenLM.is_lc_serializablec                    s   i d| j i¥tƒ j¥S )NÚmodel)Z
model_nameÚsuperÚ_invocation_params)Úself©Ú	__class__r   r
   r      s   zOpenLM._invocation_paramsÚvaluesc                 C   sB   zdd l }|j|d< W n ty   tdƒ‚w |d rtdƒ‚|S )Nr   ÚclientzTCould not import openlm python package. Please install it with `pip install openlm`.Z	streamingz#Streaming not supported with openlm)ÚopenlmZ
CompletionÚImportErrorÚ
ValueError)r	   r   r   r   r   r
   Úvalidate_environment   s   ÿÿzOpenLM.validate_environment)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚclassmethodÚboolr   Úpropertyr   Ústrr   r   r   r   Ú__classcell__r   r   r   r
   r      s    r   N)Útypingr   r   Zlangchain_core.utilsr   Zlangchain_community.llms.openair   r   r   r   r   r
   Ú<module>   s    