
    
!i                    ~    S r SSKJr  SSKrSSKJr  SSKJr  SSKJ	r
   " S S\R                  5      r " S	 S
5      rg)z=Maintains set of LLM models that can be instantiated by name.    )annotationsN)Callable)
text_model)modelc                      \ rS rSrSrSrSrg)	ModelName   echotext N)__name__
__module____qualname____firstlineno__
ECHO_MODEL
TEXT_MODEL__static_attributes__r       e/home/james-whalen/.local/lib/python3.13/site-packages/google/generativeai/notebook/model_registry.pyr   r      s    JJr   r   c                  @    \ rS rSrSr\R                  rS rSS jr	Sr
g)ModelRegistry   z-Registry that instantiates and caches models.c                    0 U l         [        R                  [        R                  [        R
                  [        R                  0U l        g )N)	_model_cacher   r   	model_lib	EchoModelr   r   	TextModel_model_constructors)selfs    r   __init__ModelRegistry.__init__#   s7    FH  )"5"5  *"6"6\
 r   c                    XR                   ;  a!  U R                  U   " 5       U R                   U'   U R                   U   $ )zGiven `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_modelModelRegistry.get_model*   s?     ...,0,D,DZ,P,RDj)  ,,r   r#   N)r$   r   returnzmodel_lib.AbstractModel)r   r   r   r   __doc__r   r   DEFAULT_MODELr    r%   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>r0      s4    D "   3 ?		 
- -r   