Ë
    µŒj©  ã                   ó†   — d dl mZ d dlmZmZmZmZmZmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZmZ d dlmZ  G d„ d	e«      Zy
)é    )Úpartial)ÚAnyÚDictÚListÚMappingÚOptionalÚSet)ÚCallbackManagerForLLMRun)ÚLLM)Úpre_init)Ú
ConfigDictÚField)Úenforce_stop_tokensc                   óZ  — e Zd ZU dZeed<   	  edd¬«      Zee   ed<    edd¬«      Z	e
ed<   	  edd	¬«      Ze
ed	<   	  ed
d¬«      Ze
ed<   	  edd¬«      Zeed<   	  edd¬«      Zeed<   	  edd¬«      Zeed<   	  edd¬«      Zeed<   	  edd¬«      Zeed<   	  edd¬«      Zee
   ed<   	 dZee
   ed<   	 dZee   ed<   	 dZee   ed<   	 dZee
   ed<   	 dZee   ed<   	 g Zeee      ed<   	 dZee
   ed<   	 d Zee   ed!<   	  ed"d#¬«      Ze
ed#<   	 dZeed$<   	 dZ eed%<   	  ed&d'¬«      Z!ee   ed'<   	 dZ"e#ed(<    e$d)¬*«      Z%e&d+e'e   fd,„«       Z(d+e)ee#f   fd-„Z*e+d.e)d+e)fd/„«       Z,e-d+e.ee#f   fd0„«       Z/e-d+efd1„«       Z0	 	 d6d2edeee      d3ee1   d4e#d+ef
d5„Z2y)7ÚGPT4Alla¹  GPT4All language models.

    To use, you should have the ``gpt4all`` python package installed, the
    pre-trained model file, and the model's config information.

    Example:
        .. code-block:: python

            from langchain_community.llms import GPT4All
            model = GPT4All(model="./models/gpt4all-model.bin", n_threads=8)

            # Simplest invocation
            response = model.invoke("Once upon a time, ")
    ÚmodelNÚbackend)ÚaliaséÈ   Ú
max_tokenséÿÿÿÿÚn_partsr   ÚseedFÚf16_kvÚ
logits_allÚ
vocab_onlyÚ	use_mlockÚ	embeddingé   Ú	n_threadsé   Ú	n_predictgffffffæ?Útempgš™™™™™¹?Útop_pé(   Útop_kÚechoÚstopé@   Úrepeat_last_ngáz®Gáò?Úrepeat_penaltyé   Ún_batchÚ	streamingÚallow_downloadÚcpuÚdeviceÚclientÚforbid)ÚextraÚreturnc                  ó
   — h d£S )N>	   r#   r&   r$   r-   r"   r.   r   r*   r+   © r7   ó    új/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/llms/gpt4all.pyÚ_model_param_nameszGPT4All._model_param_namesg   s   € ò

ð 
	
r8   c           
      óÎ   — | j                   | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  dœ	S )N©	r   r"   r&   r$   r#   r-   r+   r*   r.   r<   ©Úselfs    r9   Ú_default_paramszGPT4All._default_paramsu   sO   € àŸ/™/ØŸ™Ø—Z‘ZØ—Z‘ZØ—I‘IØ—|‘|Ø"×1Ñ1Ø!×/Ñ/ØŸ™ñ

ð 
	
r8   Úvaluesc                 ó†  — 	 ddl m} |d   }|j                  d«      \  }}}||z  } |||xs d|d   |d   |d	   ¬
«      |d<   |d   �!|d   j                  j                  |d   «       	 |d   j                  |d<   |S # t        $ r t        d«      ‚w xY w# t        $ r  |d   j                  j                  |d<   Y |S w xY w)z;Validate that the python package exists in the environment.r   )r   zVCould not import gpt4all python package. Please install it with `pip install gpt4all`.r   Ú/Nr   r/   r1   )Ú
model_pathÚ
model_typer/   r1   r2   r    )Úgpt4allr   ÚImportErrorÚ
rpartitionr   Úset_thread_countrD   ÚAttributeError)Úclsr@   ÚGPT4AllModelÚ	full_pathrC   Ú	delimiterÚ
model_names          r9   Úvalidate_environmentzGPT4All.validate_environment‚   s  € ð	Ý7ð ˜7‘Oˆ	Ø,5×,@Ñ,@ÀÓ,EÑ)ˆ
�I˜zØ�iÑˆ
á'ØØ!Ò) TØ˜iÑ(Ø!Ð"2Ñ3Ø˜(Ñ#ô
ˆˆxÑð �+ÑÐ*à�8Ñ×"Ñ"×3Ñ3°F¸;Ñ4GÔHð	BØ & xÑ 0× ;Ñ ;ˆF�9Ñð
 ˆøô7 ò 	Üð@óð ð	ûô. ò 	Bà & xÑ 0× 6Ñ 6× AÑ AˆF�9Òàˆð		Bús   ‚A? Á+B Á?BÂ%C Â?C c                 óÌ   — d| j                   i| j                  «       ¥| j                  j                  «       D ��ci c]  \  }}|| j	                  «       v sŒ||“Œ c}}¥S c c}}w )zGet the identifying parameters.r   )r   r?   Ú__dict__Úitemsr:   )r>   ÚkÚvs      r9   Ú_identifying_paramszGPT4All._identifying_params¤   sq   € ð �T—Z‘Zð
à×"Ñ"Ó$ð
ð "&§¡×!4Ñ!4Ô!6ôÙ!6™˜˜A¸!¸t×?VÑ?VÓ?XÒ:X��1‘Ð!6òð
ð 	
ùós   »A ÁA c                  ó   — y)zReturn the type of llm.rE   r7   r=   s    r9   Ú	_llm_typezGPT4All._llm_type¯   s   € ð r8   ÚpromptÚrun_managerÚkwargsc                 óú   — d}|r!t        |j                  | j                  ¬«      }d}i | j                  «       ¥|¥} | j                  j
                  |fi |¤ŽD ]  }|r ||«       ||z  }Œ |�t        ||«      }|S )a¡  Call out to GPT4All's generate method.

        Args:
            prompt: The prompt to pass into the model.
            stop: A list of strings to stop generation when encountered.

        Returns:
            The string generated by the model.

        Example:
            .. code-block:: python

                prompt = "Once upon a time, "
                response = model.invoke(prompt, n_predict=55)
        N)ÚverboseÚ )r   Úon_llm_new_tokenr\   r?   r2   Úgenerater   )	r>   rX   r(   rY   rZ   Útext_callbackÚtextÚparamsÚtokens	            r9   Ú_callzGPT4All._call´   sŒ   € ð, ˆÙÜ# K×$@Ñ$@È$Ï,É,ÔWˆMØˆØ5�D×(Ñ(Ó*Ð5¨fÐ5ˆØ)�T—[‘[×)Ñ)¨&Ñ;°FÔ;ˆEÙÙ˜eÔ$Ø�E‰M‰Dð <ð ÐÜ& t¨TÓ2ˆDØˆr8   )NN)3Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrÚ__annotations__r   r   r   r   Úintr   r   r   Úboolr   r   r   r   r    r"   r#   Úfloatr$   r&   r'   r(   r   r*   r+   r-   r.   r/   r1   r2   r   r   Úmodel_configÚstaticmethodr	   r:   r   r?   r   rO   Úpropertyr   rU   rW   r
   rd   r7   r8   r9   r   r      s­  … ñð ƒJØ5á" 4¨yÔ9€GˆX�c‰]Ó9á˜C |Ô4€J�Ó4Øá˜ 9Ô-€GˆSÓ-ð?ñ �a˜vÔ&€Dˆ#Ó&Ø-á˜ hÔ/€FˆDÓ/Ø1á˜U¨,Ô7€J�Ó7Ø@á˜U¨,Ô7€J�Ó7Ø/á˜E¨Ô5€IˆtÓ5Ø,á˜E¨Ô5€IˆtÓ5Ø"á$ Q¨kÔ:€Iˆx˜‰}Ó:Ø#à"€Iˆx˜‰}Ó"Ø3à€Dˆ(�5‰/ÓØ.à €Eˆ8�E‰?Ó Ø.à€Eˆ8�C‰=ÓØ.à €Dˆ(�4‰.Ó Ø%à "€Dˆ(�4˜‘9Ñ
Ó"Ø@à#%€M�8˜C‘=Ó%Øà&*€N�H˜U‘OÓ*Ø2á˜ )Ô,€GˆSÓ,Ø+à€IˆtÓØ/à €N�DÓ ØDá! %¨xÔ8€FˆH�S‰MÓ8ØBà€FˆCÓáØô€Lð ð
  C¡ò 
ó ð
ð
  c¨3 h¡ó 
ð ð¨$ð °4ò ó ððB ð
 W¨S°#¨XÑ%6ò 
ó ð
ð ð˜3ò ó ðð %)Ø:>ñ	!àð!ð �t˜C‘yÑ!ð!ð Ð6Ñ7ð	!ð
 ð!ð 
ô!r8   r   N)Ú	functoolsr   Útypingr   r   r   r   r   r	   Úlangchain_core.callbacksr
   Ú#langchain_core.language_models.llmsr   Úlangchain_core.utilsr   Úpydanticr   r   Úlangchain_community.llms.utilsr   r   r7   r8   r9   Ú<module>rx      s+   ðÝ ß :× :å =Ý 3Ý )ß &å >ôIˆcõ Ir8   