
    rh                    ~    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y)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y)	ModelNameechotextN)__name__
__module____qualname__
ECHO_MODEL
TEXT_MODEL     ~/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/google/generativeai/notebook/model_registry.pyr   r      s    JJr   r   c                  6    e Zd ZdZej
                  Zd ZddZy)ModelRegistryz-Registry that instantiates and caches models.c                    i | _         t        j                  t        j                  t        j
                  t        j                  i| _        y )N)	_model_cacher   r   	model_lib	EchoModelr   r   	TextModel_model_constructors)selfs    r   __init__zModelRegistry.__init__#   s7    FH  )"5"5  *"6"6\
 r   c                ~    || 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   
model_names     r   	get_modelzModelRegistry.get_model*   sC     T...,PD,D,DZ,P,RDj)  ,,r   N)r   r   returnzmodel_lib.AbstractModel)	r   r   r   __doc__r   r   DEFAULT_MODELr   r   r   r   r   r   r      s    7((M
-r   r   )r!   
__future__r   enumtypingr   google.generativeai.notebookr    google.generativeai.notebook.libr   r   Enumr   r   r   r   r   <module>r)      s4    D "   3 ?		 
- -r   