
    ; i                        d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z
  G d dej                  Z G d	 d
          ZdS )z=Maintains set of LLM models that can be instantiated by name.    )annotationsN)Callable)
text_model)modelc                      e Zd ZdZdZdS )	ModelNameechotextN)__name__
__module____qualname__
ECHO_MODEL
TEXT_MODEL     /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/google/generativeai/notebook/model_registry.pyr   r      s        JJJJr   r   c                  .    e Zd ZdZej        Zd Zd	dZdS )
ModelRegistryz-Registry that instantiates and caches models.c                z    i | _         t          j        t          j        t          j        t          j        i| _        d S )N)	_model_cacher   r   	model_lib	EchoModelr   r   	TextModel_model_constructors)selfs    r   __init__zModelRegistry.__init__#   s1    FH )"5 *"6\
   r   
model_namer   returnmodel_lib.AbstractModelc                h    || j         vr | j        |                     | j         |<   | j         |         S )a  Given `model_name`, return the corresponding Model instance.

        Model instances are cached and reused for the same `model_name`.

        Args:
          model_name: The name of the model.

        Returns:
          The corresponding model instance for `model_name`.
        )r   r   )r   r   s     r   	get_modelzModelRegistry.get_model*   s=     T...,PD,DZ,P,R,RDj) ,,r   N)r   r   r   r   )	r   r   r   __doc__r   r   DEFAULT_MODELr   r!   r   r   r   r   r      sE        77(M
 
 
- - - - - -r   r   )r"   
__future__r   enumtypingr   google.generativeai.notebookr    google.generativeai.notebook.libr   r   Enumr   r   r   r   r   <module>r*      s    D C " " " " " "        3 3 3 3 3 3 ? ? ? ? ? ?    	   
- - - - - - - - - -r   