Ë
    ümxi  ã                  ó~   — 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© ó    úb/home/htdocs/ttos/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×.Ñ.Ñ.Ø,P¨D×,DÑ,DÀZÑ,PÓ,RˆD×Ñ˜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   