
    dh	                         S SK JrJrJrJrJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S\SS4S	 jr SS
\\   S\\\      S\4S jjr " S S\	5      rg)    )AnyCallableListMappingOptional)CallbackManagerForLLMRun)LLM)Field)enforce_stop_tokenspromptreturnNc                      [        SU  35        g)z&Displays the given prompt to the user.
N)print)r   s    V/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/llms/human.py_display_promptr   
   s    	Bvh-    	separatorstopc                    ^ U =(       d    Sn / n [        5       mT(       d  O5UR                  T5        U(       a  [        U4S jU 5       5      (       a  OMG  U R                  U5      nU$ )z3Collects and returns user input as a single string.r   c              3   *   >#    U H	  oT;   v   M     g 7fN ).0seqlines     r   	<genexpr>&_collect_user_input.<locals>.<genexpr>   s     4ttts   )inputappendanyjoin)r   r   linesmulti_line_inputr   s       @r   _collect_user_inputr%      sb     !TIE
wTC4t444  !~~e,r   c                      \ rS rSr% Sr\" S S9r\\S'   \" S S9r	\\
/S4   \S'   S	r\
\S
'   0 r\\
\4   \S'   0 r\\
\4   \S'   \S\\
\4   4S j5       r\S\
4S j5       r  SS\
S\\\
      S\\   S\S\
4
S jjrSrg)HumanInputLLM#   zUser input as the response.c                      [         $ r   )r%   r   r   r   <lambda>HumanInputLLM.<lambda>&   s    9Lr   )default_factory
input_funcc                      [         $ r   )r   r   r   r   r*   r+   '   s    r   Nprompt_funcr   r   input_kwargsprompt_kwargsr   c                     0 $ )zE
Returns an empty dictionary as there are no identifying parameters.
r   selfs    r   _identifying_params!HumanInputLLM._identifying_params,   s	    
 	r   c                     g)zReturns the type of LLM.zhuman-inputr   r3   s    r   	_llm_typeHumanInputLLM._llm_type3   s     r   r   r   run_managerkwargsc                     U R                   " U40 U R                  D6  U R                  " SU R                  US.U R                  D6nUb  [        XR5      nU$ )a>  
Displays the prompt to the user and returns their input as a response.

Args:
    prompt (str): The prompt to be displayed to the user.
    stop (Optional[List[str]]): A list of stop strings.
    run_manager (Optional[CallbackManagerForLLMRun]): Currently not used.

Returns:
    str: The user's input as a response.
)r   r   r   )r/   r1   r-   r   r0   r   )r4   r   r   r:   r;   
user_inputs         r   _callHumanInputLLM._call8   sa    $ 	64#5#56__ 
nn4
373D3D

  -Z>Jr   r   NN)__name__
__module____qualname____firstlineno____doc__r
   r-   r   __annotations__r/   strr   r0   r   r   r1   propertyr5   r8   r   r   r   r>   __static_attributes__r   r   r   r'   r'   #   s    % 1LMJM).?V)WK3%+&WIs&(L'#s(#(')M738$)WS#X%6   3   %):>	 tCy! 67	
  
 r   r'   r@   )typingr   r   r   r   r   langchain_core.callbacksr   #langchain_core.language_models.llmsr	   pydanticr
   langchain_community.llms.utilsr   rG   r   r%   r'   r   r   r   <module>rO      sg    9 9 = 3  >C D  BF}+3DI+>(0C 0r   