§
     Âi+*  ã                  ó�   — d dl mZ d dlZd dlZd dlmZmZ d dlmZ d dl	m
Z
 d dl	mZ d dlmZ d dlmZ d	Zd
Z G d„ d¦  «        ZdS )é    )ÚannotationsN)ÚIterableÚOptional)Úprotos)Úcaching_types)Úcontent_types)Úget_default_cache_client)Úfield_mask_pb2ÚuserÚmodelc            	      ó†  — e Zd ZdZd„ Zed2d„¦   «         Zed2d„¦   «         Zed2d„¦   «         Zed3d	„¦   «         Z	ed4d„¦   «         Z
ed4d„¦   «         Zed4d„¦   «         Zd„ ZeZed5d„¦   «         Zd„ Zeddddddddœd6d%„¦   «         Zeddddddddœd7d&„¦   «         Zed8d(„¦   «         Zed9d:d-„¦   «         Zd;d/„Zddd0œd<d1„ZdS )=ÚCachedContentzCached content resource.c                ó–   — t          ¦   «         }d|vrd|z   }t          j        |¬¦  «        }|                     |¦  «        }|| _        dS )z«Fetches a `CachedContent` resource.

        Identical to `CachedContent.get`.

        Args:
            name: The resource name referring to the cached content.
        úcachedContents/©ÚnameN)r	   r   ÚGetCachedContentRequestÚget_cached_contentÚ_proto)Úselfr   ÚclientÚrequestÚresponses        úe/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/google/generativeai/caching.pyÚ__init__zCachedContent.__init__#   sU   € õ *Ñ+Ô+ˆà DÐ(Ð(Ø$ tÑ+ˆDåÔ0°dÐ;Ñ;Ô;ˆØ×,Ò,¨WÑ5Ô5ˆØˆŒˆˆó    ÚreturnÚstrc                ó   — | j         j        S ©N)r   r   ©r   s    r   r   zCachedContent.name4   s   € àŒ{ÔÐr   c                ó   — | j         j        S r    )r   r   r!   s    r   r   zCachedContent.model8   s   € àŒ{Ô Ð r   c                ó   — | j         j        S r    )r   Údisplay_namer!   s    r   r$   zCachedContent.display_name<   s   € àŒ{Ô'Ð'r   ú"protos.CachedContent.UsageMetadatac                ó   — | j         j        S r    )r   Úusage_metadatar!   s    r   r'   zCachedContent.usage_metadata@   s   € àŒ{Ô)Ð)r   údatetime.datetimec                ó   — | j         j        S r    )r   Úcreate_timer!   s    r   r*   zCachedContent.create_timeD   ó   € àŒ{Ô&Ð&r   c                ó   — | j         j        S r    )r   Úupdate_timer!   s    r   r-   zCachedContent.update_timeH   r+   r   c                ó   — | j         j        S r    )r   Úexpire_timer!   s    r   r/   zCachedContent.expire_timeL   r+   r   c                ó²   — t          j        d| j        › d| j        › d| j        › dd› d| j        j        › dd› d	| j        › d
| j        › d| j	        › d�¦  «        S )Nz1            CachedContent(
                name='z',
                model='z!',
                display_name='z"',
                usage_metadata=Ú{z*
                    'total_token_count': z,
                Ú}z,
                create_time=z,
                update_time=z,
                expire_time=z
            ))
ÚtextwrapÚdedentr   r   r$   r'   Útotal_token_countr*   r-   r/   r!   s    r   Ú__str__zCachedContent.__str__P   s»   € ÝŒðà”yðð ð œ
ðð ð  $Ô0ð	ð ð
 !$ðð ð +/Ô*=Ô*Oðð ð ðð ð "Ô-ðð ð "Ô-ðð ð "Ô-ðð ð ñ
ô 
ð 	
r   Úobjú+CachedContent | protos.CachedContent | dictc                óŠ   — |                       | ¦  «        }t          j        ¦   «         |_        |                     |¦  «         |S )zKCreates an instance of CachedContent form an object, without calling `get`.)Ú__new__r   r   r   Ú_update)Úclsr7   r   s      r   Ú	_from_objzCachedContent._from_objb   s<   € ð �{Š{˜3ÑÔˆÝÔ*Ñ,Ô,ˆŒØ�Š�SÑÔÐØˆr   c                ó  — t          |t          ¦  «        r|j        }t          |t          ¦  «        s$t	          |¦  «                             |d¬¦  «        }|                     ¦   «         D ]\  }}t          | j        ||¦  «         ŒdS )zFUpdates this instance inplace, does not call the API's `update` methodF)Úincluding_default_value_fieldsN)Ú
isinstancer   r   ÚdictÚtypeÚto_dictÚitemsÚsetattr)r   ÚupdatesÚkeyÚvalues       r   r;   zCachedContent._updatej   s‰   € å�g�}Ñ-Ô-ð 	%Ø”nˆGå˜'¥4Ñ(Ô(ð 	[Ý˜7‘m”m×+Ò+¨GÐTYÐ+ÑZÔZˆGà!Ÿ-š-™/œ/ð 	-ð 	-‰JˆC�Ý�D”K  eÑ,Ô,Ð,Ð,ð	-ð 	-r   N)r$   Úsystem_instructionÚcontentsÚtoolsÚtool_configÚttlr/   r   r$   ú
str | NonerI   ú#Optional[content_types.ContentType]rJ   ú$Optional[content_types.ContentsType]rK   ú+Optional[content_types.FunctionLibraryType]rL   ú&Optional[content_types.ToolConfigType]rM   ú Optional[caching_types.TTLTypes]r/   ú'Optional[caching_types.ExpireTimeTypes]ú!protos.CreateCachedContentRequestc          
     óJ  — |r|rt          d¦  «        ‚d| vrd| z   } |r"t          |¦  «        dk    rt          d¦  «        ‚|rt          j        |¦  «        }t          j        |¦  «        }|r|                     ¦   «         }|rt          j        |¦  «        }|r3t          j        |¦  «        }|d         j        st          |d         _        t          j        |¦  «        }t          j        |¦  «        }t          j        | |||||||¬¦  «        }	t          j        |	¬¦  «        S )	z&Prepares a CreateCachedContentRequest.úLExclusive arguments: Please provide either `ttl` or `expire_time`, not both.ú/zmodels/é€   z;`display_name` must be no more than 128 unicode characters.éÿÿÿÿ©r   r$   rI   rJ   rK   rL   rM   r/   )Úcached_content)Ú
ValueErrorÚlenr   Ú
to_contentÚto_function_libraryÚto_protoÚto_tool_configÚto_contentsÚroleÚ
_USER_ROLEr   Úto_optional_ttlÚto_optional_expire_timer   r   ÚCreateCachedContentRequest)
r   r$   rI   rJ   rK   rL   rM   r/   Ú	tools_libr\   s
             r   Ú_prepare_create_requestz%CachedContent._prepare_create_requestu   s^  € ð ð 	�;ð 	ÝØ^ñô ð ð �eÐÐØ Ñ%ˆEàð 	\�C Ñ-Ô-°Ò3Ð3ÝÐZÑ[Ô[Ð[àð 	NÝ!.Ô!9Ð:LÑ!MÔ!MÐå!Ô5°eÑ<Ô<ˆ	Øð 	-Ø!×*Ò*Ñ,Ô,ˆIàð 	DÝ'Ô6°{ÑCÔCˆKàð 	/Ý$Ô0°Ñ:Ô:ˆHØ˜B”<Ô$ð /Ý$.�˜”Ô!åÔ+¨CÑ0Ô0ˆÝ#Ô;¸KÑHÔHˆåÔ-ØØ%Ø1ØØØ#ØØ#ð	
ñ 	
ô 	
ˆõ Ô0ÀÐOÑOÔOÐOr   c          
     óº   — t          ¦   «         }	|                      ||||||||¬¦  «        }
|	                     |
¦  «        }t                               |¦  «        }|S )a  Creates `CachedContent` resource.

        Args:
            model: The name of the `model` to use for cached content creation.
                   Any `CachedContent` resource can be only used with the
                   `model` it was created for.
            display_name: The user-generated meaningful display name
                          of the cached content. `display_name` must be no
                          more than 128 unicode characters.
            system_instruction: Developer set system instruction.
            contents: Contents to cache.
            tools: A list of `Tools` the model may use to generate response.
            tool_config: Config to apply to all tools.
            ttl: TTL for cached resource (in seconds). Defaults to 1 hour.
                 `ttl` and `expire_time` are exclusive arguments.
            expire_time: Expiration time for cached resource.
                         `ttl` and `expire_time` are exclusive arguments.

        Returns:
            `CachedContent` resource with specified name.
        r[   )r	   rj   Úcreate_cached_contentr   r=   )r<   r   r$   rI   rJ   rK   rL   rM   r/   r   r   r   Úresults                r   ÚcreatezCachedContent.create¬   so   € õD *Ñ+Ô+ˆà×-Ò-ØØ%Ø1ØØØ#ØØ#ð .ñ 	
ô 	
ˆð ×/Ò/°Ñ8Ô8ˆÝ×(Ò(¨Ñ2Ô2ˆØˆr   r   c                ó¼   — t          ¦   «         }d|vrd|z   }t          j        |¬¦  «        }|                     |¦  «        }t                               |¦  «        }|S )zÕFetches required `CachedContent` resource.

        Args:
            name: The resource name referring to the cached content.

        Returns:
            `CachedContent` resource with specified `name`.
        r   r   )r	   r   r   r   r   r=   )r<   r   r   r   r   rm   s         r   ÚgetzCachedContent.getß   sb   € õ *Ñ+Ô+ˆà DÐ(Ð(Ø$ tÑ+ˆDåÔ0°dÐ;Ñ;Ô;ˆØ×,Ò,¨WÑ5Ô5ˆÝ×(Ò(¨Ñ2Ô2ˆØˆr   é   Ú	page_sizeúOptional[int]úIterable[CachedContent]c              #  ó¼   K  — t          ¦   «         }t          j        |¬¦  «        }|                     |¦  «        D ] }t                               |¦  «        }|V — Œ!dS )a.  Lists `CachedContent` objects associated with the project.

        Args:
            page_size: The maximum number of permissions to return (per page).
            The service may return fewer `CachedContent` objects.

        Returns:
            A paginated list of `CachedContent` objects.
        )rr   N)r	   r   ÚListCachedContentsRequestÚlist_cached_contentsr   r=   )r<   rr   r   r   r\   s        r   ÚlistzCachedContent.listó   so   è è € õ *Ñ+Ô+ˆåÔ2¸YÐGÑGÔGˆØ$×9Ò9¸'ÑBÔBð 	!ð 	!ˆNÝ*×4Ò4°^ÑDÔDˆNØ Ð Ð Ð Ð ð	!ð 	!r   ÚNonec                ó€   — t          ¦   «         }t          j        | j        ¬¦  «        }|                     |¦  «         dS )z!Deletes `CachedContent` resource.r   N)r	   r   ÚDeleteCachedContentRequestr   Údelete_cached_content)r   r   r   s      r   ÚdeletezCachedContent.delete  s;   € å)Ñ+Ô+ˆåÔ3¸¼ÐCÑCÔCˆØ×$Ò$ WÑ-Ô-Ð-Øˆr   )rM   r/   c               ó  — t          ¦   «         }|r|rt          d¦  «        ‚t          j        |¦  «        }t          j        |¦  «        }t          j        | j        ||¬¦  «        }t          j	        ¦   «         }|r|j
                             d¦  «         n,|r|j
                             d¦  «         nt          d¦  «        ‚t          j        ||¬¦  «        }|                     |¦  «        }|                      |¦  «         dS )aX  Updates requested `CachedContent` resource.

        Args:
            ttl: TTL for cached resource (in seconds). Defaults to 1 hour.
                 `ttl` and `expire_time` are exclusive arguments.
            expire_time: Expiration time for cached resource.
                         `ttl` and `expire_time` are exclusive arguments.
        rW   )r   rM   r/   rM   r/   zQBad update name: Only `ttl`  or `expire_time` can be updated for `CachedContent`.)r\   Úupdate_maskN)r	   r]   r   rf   rg   r   r   r   r
   Ú	FieldMaskÚpathsÚappendÚUpdateCachedContentRequestÚupdate_cached_contentr;   )r   rM   r/   r   rF   Ú
field_maskr   Ú
updated_ccs           r   ÚupdatezCachedContent.update  s"  € õ *Ñ+Ô+ˆàð 	�;ð 	ÝØ^ñô ð õ Ô+¨CÑ0Ô0ˆÝ#Ô;¸KÑHÔHˆåÔ&Ø”ØØ#ð
ñ 
ô 
ˆõ $Ô-Ñ/Ô/ˆ
àð 	ØÔ×#Ò# EÑ*Ô*Ð*Ð*Øð 	ØÔ×#Ò# MÑ2Ô2Ð2Ð2åØdñô ð õ Ô3À7ÐXbÐcÑcÔcˆØ×1Ò1°'Ñ:Ô:ˆ
Ø�Š�ZÑ Ô Ð àˆr   )r   r   )r   r%   )r   r(   )r7   r8   r   r   )r   r   r$   rN   rI   rO   rJ   rP   rK   rQ   rL   rR   rM   rS   r/   rT   r   rU   )r   r   r$   rN   rI   rO   rJ   rP   rK   rQ   rL   rR   rM   rS   r/   rT   r   r   )r   r   r   r   )rq   )rr   rs   r   rt   )r   ry   )rM   rS   r/   rT   r   ry   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r$   r'   r*   r-   r/   r6   Ú__repr__Úclassmethodr=   r;   Ústaticmethodrj   rn   rp   rx   r}   r‡   © r   r   r   r       sU  € € € € € Ø"Ð"ðð ð ð" ð ð  ð  ñ „Xð ð ð!ð !ð !ñ „Xð!ð ð(ð (ð (ñ „Xð(ð ð*ð *ð *ñ „Xð*ð ð'ð 'ð 'ñ „Xð'ð ð'ð 'ð 'ñ „Xð'ð ð'ð 'ð 'ñ „Xð'ð
ð 
ð 
ð  €Hàðð ð ñ „[ðð	-ð 	-ð 	-ð ð $(ØBFØ9=Ø=AØ>BØ04Ø?Cð4Pð 4Pð 4Pð 4Pð 4Pñ „\ð4Pðl ð
 $(ØBFØ9=Ø=AØ>BØ04Ø?Cð0ð 0ð 0ð 0ð 0ñ „[ð0ðd ðð ð ñ „[ðð& ð!ð !ð !ð !ñ „[ð!ð"ð ð ð ð 15Ø?Cð	-ð -ð -ð -ð -ð -ð -ð -r   r   )Ú
__future__r   Údatetimer3   Útypingr   r   Úgoogle.generativeair   Úgoogle.generativeai.typesr   r   Úgoogle.generativeai.clientr	   Úgoogle.protobufr
   re   Ú_MODEL_ROLEr   r�   r   r   ú<module>r™      sã   ðð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø %Ð %Ð %Ð %Ð %Ð %Ð %Ð %à &Ð &Ð &Ð &Ð &Ð &Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?à *Ð *Ð *Ð *Ð *Ð *à€
Ø€ðZð Zð Zð Zð Zñ Zô Zð Zð Zð Zr   