
    rh	                    n    d Z ddlmZ ddlZddlmZmZmZ eeeef      Z	 G d dej                        Zy)zLLMFnInputsSource.    )annotationsN)CallableMappingSequencec                  J    e Zd ZdZd ZdddZej                  	 	 dd       Zy)	LLMFnInputsSourcezAbstract class representing a source of inputs for LLMFunction.

    This class could be extended with concrete implementations that read data
    from external sources, such as Google Sheets.
    c                "    d | _         d | _        y )Nc                      y )N r       /var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/google/generativeai/notebook/lib/llmfn_inputs_source.py<lambda>z,LLMFnInputsSource.__init__.<locals>.<lambda>"       r   )_cached_inputs_display_status_fnselfs    r   __init__zLLMFnInputsSource.__init__    s    ;?6Br   c                    | j                   | j                         \  | _         | _        |s| j                          | j                   S )a  Returns a sequence of normalized inputs.

        The return value is a sequence of dictionaries of (placeholder, value)
        pairs, e.g. [{"word": "hot"}, {"word: "cold"}, ....]

        These are used for keyword-substitution for prompts in LLMFunctions.

        Args:
          suppress_status_msgs: If True, suppress status messages regarding the
            input being read.

        Returns:
          A sequence of normalized inputs.
        )r   _to_normalized_inputs_implr   )r   suppress_status_msgss     r   to_normalized_inputsz&LLMFnInputsSource.to_normalized_inputs$   sJ     & //1#'###%"""r   c                     y)a  Returns a tuple of NormalizedInputsList and a display function.

        The display function displays some status about the input (e.g. where
        it is read from). This way the status continues to be displayed
        even though the results are cached.
        Nr   r   s    r   r   z,LLMFnInputsSource._to_normalized_inputs_impl<   r   r   N)F)r   boolreturnNormalizedInputsList)r   z/tuple[NormalizedInputsList, Callable[[], None]])	__name__
__module____qualname____doc__r   r   abcabstractmethodr   r   r   r   r   r      s4    C#0 		8 r   r   )r    
__future__r   r!   typingr   r   r   strr   ABCr   r   r   r   <module>r'      s<     " 
 . .  S 12 , ,r   