
    Ng	                         d dl Z d dlZd dlmZmZmZmZmZmZ d dl	m
Z
mZ 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dS )    N)AnyAsyncIteratorIteratorListMappingOptional)AsyncCallbackManagerForLLMRunCallbackManagerForLLMRun)LanguageModelInput)LLM)RunnableConfigc                   &   e Zd ZU dZee         ed<   dZee	         ed<   dZ
eed<   edefd            Z	 	 dd	ed
eee                  dee         dedef
dZ	 	 dd	ed
eee                  dee         dedef
dZedeeef         fd            ZdS )FakeListLLMzFake LLM for testing purposes.	responsesNsleepr   ireturnc                     dS )zReturn type of llm.z	fake-list selfs    Y/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_community/llms/fake.py	_llm_typezFakeListLLM._llm_type   s	     {    promptstoprun_managerkwargsc                     | j         | j                 }| j        t          | j                   dz
  k     r| xj        dz  c_        nd| _        |S zReturn next response   r   r   r   lenr   r   r   r   r   responses         r   _callzFakeListLLM._call   sK     >$&)6C''!+++FFaKFFFDFr   c                    K   | j         | j                 }| j        t          | j                   dz
  k     r| xj        dz  c_        nd| _        |S r    r"   r$   s         r   _acallzFakeListLLM._acall)   sO       >$&)6C''!+++FFaKFFFDFr   c                     d| j         iS )Nr   )r   r   s    r   _identifying_paramszFakeListLLM._identifying_params8   s    T^,,r   )NN)__name__
__module____qualname____doc__r   str__annotations__r   r   floatr   intpropertyr   r
   r   r&   r	   r(   r   r*   r   r   r   r   r      sb        ((Cy!E8E?!!!AsJJJ3    X %):>	  tCy! 67	
  
   $ %)?C	  tCy! ;<	
  
    -WS#X%6 - - - X- - -r   r   c                       e Zd ZdZ	 ddddedee         deee                  de	de
e         f
d	Z	 ddddedee         deee                  de	dee         f
d
ZdS )FakeStreamingListLLMz-Fake streaming list LLM for testing purposes.N)r   inputconfigr   r   r   c             +      K   |                      ||          }|D ]&}| j        t          j        | j                   |V  'd S N)invoker   timer   r6   r7   r   r   resultcs          r   streamzFakeStreamingListLLM.stream@   sY       UF++ 	 	Az%
4:&&&GGGG	 	r   c                  K   |                      ||           d {V }|D ]-}| j        t          j        | j                   d {V  |W V  .d S r9   )ainvoker   asyncior<   s          r   astreamzFakeStreamingListLLM.astreamN   s       ||E622222222 	 	Az%mDJ/////////GGGGG	 	r   r9   )r+   r,   r-   r.   r   r   r   r   r/   r   r   r?   r   rC   r   r   r   r5   r5   =   s        77
 ,0
 %)  ! (
 tCy!  
#   " ,0
 %)  ! (
 tCy!  
s	     r   r5   )rB   r;   typingr   r   r   r   r   r   langchain_core.callbacksr	   r
   langchain_core.language_modelsr   #langchain_core.language_models.llmsr   langchain_core.runnablesr   r   r5   r   r   r   <module>rI      s     H H H H H H H H H H H H H H H H        > = = = = = 3 3 3 3 3 3 3 3 3 3 3 3,- ,- ,- ,- ,-# ,- ,- ,-^    ;     r   