Ë
    ümxiË"  ã                  óz  — d dl mZ d dlmZmZmZ d dlmc 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 d	lmZ 	 	 	 	 d	 	 	 	 	 	 	 	 	 dd
„Z	 	 	 	 d	 	 	 	 	 	 	 	 	 dd„Z	 	 d	 	 	 	 	 	 	 dd„Z	 	 d	 	 	 	 	 	 	 dd„Z	 	 	 d	 	 	 	 	 	 	 dd„Z	 	 	 d	 	 	 	 	 	 	 dd„Zddddœ	 	 	 	 	 	 	 dd„Zddddœ	 	 	 	 	 	 	 dd„Zy)é    )Úannotations)ÚAsyncIterableÚIterableÚOptionalN)Úprotos)Úget_default_retriever_client)Ú"get_default_retriever_async_client)Úhelper_types)Úidecode_time)Úretriever_typesc                óþ  — |€i }|€
t        «       }| €t        j                  |¬«      }nct        j                  | «      rt        j                  d| › �|¬«      }n3t        t        j                  j                  t        | «      | ¬«      «      ‚t        j                  |¬«      } |j                  |fi |¤Ž}t        |«      j                  |«      }t        |d«       t        |d«       t        j                  di |¤Ž}|S )	aÈ  Calls the API to create a new `Corpus` by specifying either a corpus resource name as an ID or a display name, and returns the created `Corpus`.

    Args:
        name: The corpus resource name (ID). The name must be alphanumeric and fewer
            than 40 characters.
        display_name: The human readable display name. The display name must be fewer
            than 128 characters. All characters, including alphanumeric, spaces, and
            dashes are supported.
        request_options: Options for the request.

    Return:
        `retriever_types.Corpus` object with specified name or display name.

    Raises:
        ValueError: When the name is not specified or formatted incorrectly.
    ©Údisplay_nameúcorpora/©Únamer   ©Úlengthr   ©ÚcorpusÚcreate_timeÚupdate_time© )r   r   ÚCorpusr   Ú
valid_nameÚ
ValueErrorÚNAME_ERROR_MSGÚformatÚlenÚCreateCorpusRequestÚcreate_corpusÚtypeÚto_dictr   ©r   r   ÚclientÚrequest_optionsr   ÚrequestÚresponses          úT/home/htdocs/ttos/venv/lib/python3.12/site-packages/google/generativeai/retriever.pyr!   r!      sá   € ð, ÐØˆà€~Ü-Ó/ˆà€|Ü—‘¨LÔ9‰Ü	×	#Ñ	# DÔ	)Ü—‘ h¨t¨fÐ$5ÀLÔQ‰äœ×7Ñ7×>Ñ>ÄcÈ$ÃiÐVZÐ>Ó[Ó\Ð\ä×(Ñ(°Ô7€GØ#ˆv×#Ñ# GÑ?¨Ñ?€HÜ�H‹~×%Ñ% hÓ/€HÜ�˜=Ô)Ü�˜=Ô)Ü×%Ñ%Ñ1¨Ñ1€HØ€Oó    c              ƒ  ó  K  — |€i }|€
t        «       }| €t        j                  |¬«      }nct        j                  | «      rt        j                  d| › �|¬«      }n3t        t        j                  j                  t        | «      | ¬«      «      ‚t        j                  |¬«      } |j                  |fi |¤Žƒ d{  –—† }t        |«      j                  |«      }t        |d«       t        |d«       t        j                  d	i |¤Ž}|S 7 ŒM­w)
z7This is the async version of `retriever.create_corpus`.Nr   r   r   r   r   r   r   r   )r	   r   r   r   r   r   r   r   r   r    r!   r"   r#   r   r$   s          r)   Úcreate_corpus_asyncr,   J   sî   è ø€ ð ÐØˆà€~Ü3Ó5ˆà€|Ü—‘¨LÔ9‰Ü	×	#Ñ	# DÔ	)Ü—‘ h¨t¨fÐ$5ÀLÔQ‰äœ×7Ñ7×>Ñ>ÄcÈ$ÃiÐVZÐ>Ó[Ó\Ð\ä×(Ñ(°Ô7€GØ)�V×)Ñ)¨'ÑE°_ÑE×E€HÜ�H‹~×%Ñ% hÓ/€HÜ�˜=Ô)Ü�˜=Ô)Ü×%Ñ%Ñ1¨Ñ1€HØ€Oð Fús   ‚B9DÂ;D	Â<ADc                ó  — |€i }|€
t        «       }d| vrd| z   } t        j                  | ¬«      } |j                  |fi |¤Ž}t	        |«      j                  |«      }t        |d«       t        |d«       t        j                  di |¤Ž}|S )zãCalls the API to fetch a `Corpus` by name and returns the `Corpus`.

    Args:
        name: The `Corpus` name.
        request_options: Options for the request.

    Return:
        a `retriever_types.Corpus` of interest.
    ú/r   ©r   r   r   r   )	r   r   ÚGetCorpusRequestÚ
get_corpusr"   r#   r   r   r   ©r   r%   r&   r'   r(   s        r)   r1   r1   g   s”   € ð ÐØˆà€~Ü-Ó/ˆà
�$�Ø˜DÑ ˆä×%Ñ%¨4Ô0€GØ ˆv× Ñ  Ñ<¨OÑ<€HÜ�H‹~×%Ñ% hÓ/€HÜ�˜=Ô)Ü�˜=Ô)Ü×%Ñ%Ñ1¨Ñ1€HØ€Or*   c              ƒ  ó4  K  — |€i }|€
t        «       }d| vrd| z   } t        j                  | ¬«      } |j                  |fi |¤Žƒ d{  –—† }t	        |«      j                  |«      }t        |d«       t        |d«       t        j                  di |¤Ž}|S 7 ŒM­w)z4This is the async version of `retriever.get_corpus`.Nr.   r   r/   r   r   r   )	r	   r   r0   r1   r"   r#   r   r   r   r2   s        r)   Úget_corpus_asyncr4   ‡   s¡   è ø€ ð ÐØˆà€~Ü3Ó5ˆà
�$�Ø˜DÑ ˆä×%Ñ%¨4Ô0€GØ&�V×&Ñ& wÑB°/ÑB×B€HÜ�H‹~×%Ñ% hÓ/€HÜ�˜=Ô)Ü�˜=Ô)Ü×%Ñ%Ñ1¨Ñ1€HØ€Oð Cús   ‚ABÁBÁ	ABc                óŠ   — |€i }|€
t        «       }d| vrd| z   } t        j                  | |¬«      } |j                  |fi |¤Ž y)ab  Calls the API to remove a `Corpus` from the service, optionally deleting associated `Document`s and objects if the `force` parameter is set to true.

    Args:
        name: The `Corpus` name.
        force: If set to true, any `Document`s and objects related to this `Corpus` will also be deleted.
        request_options: Options for the request.

    Nr.   r   ©r   Úforce)r   r   ÚDeleteCorpusRequestÚdelete_corpus©r   r7   r%   r&   r'   s        r)   r9   r9       sT   € ð ÐØˆà€~Ü-Ó/ˆà
�$�Ø˜DÑ ˆä×(Ñ(¨d¸%Ô@€GØ€F×Ñ˜Ñ4 OÓ4r*   c              ƒ  ó¦   K  — |€i }|€
t        «       }d| vrd| z   } t        j                  | |¬«      } |j                  |fi |¤Žƒ d{  –—†  y7 Œ­w)z7This is the async version of `retriever.delete_corpus`.Nr.   r   r6   )r	   r   r8   r9   r:   s        r)   Údelete_corpus_asyncr<   »   s^   è ø€ ð ÐØˆà€~Ü3Ó5ˆà
�$�Ø˜DÑ ˆä×(Ñ(¨d¸%Ô@€GØ
ˆ&×
Ñ
˜wÑ
:¨/Ñ
:×:Ò:ús   ‚AAÁ	AÁ
A)Ú	page_sizer%   r&   c              #  ó  K  — |€i }|€
t        «       }t        j                  | ¬«      } |j                  |fi |¤ŽD ]K  }t	        |«      j                  |«      }t        |d«       t        |d«       t        j                  di |¤Ž–— ŒM y­w)aY  Calls the API to list all `Corpora` in the service and returns a list of paginated `Corpora`.

    Args:
        page_size: Maximum number of `Corpora` to request.
        page_token: A page token, received from a previous ListCorpora call.
        request_options: Options for the request.

    Return:
        Paginated list of `Corpora`.
    N©r=   r   r   r   )	r   r   ÚListCorporaRequestÚlist_corporar"   r#   r   r   r   ©r=   r%   r&   r'   r   s        r)   rA   rA   Ï   s�   è ø€ ð  ÐØˆà€~Ü-Ó/ˆä×'Ñ'°)Ô<€GØ%�&×%Ñ% gÑA°ÑAò /ˆÜ�f“×%Ñ% fÓ-ˆÜ�V˜]Ô+Ü�V˜]Ô+Ü×$Ñ$Ñ. vÑ.Ó.ñ	/ùs   ‚B	Bc               ó@  K  — |€i }|€
t        «       }t        j                  | ¬«      } |j                  |fi |¤Žƒ d{  –—† 2 3 d{  –—† }t	        |«      j                  |«      }t        |d«       t        |d«       t        j                  di |¤Ž­–— ŒT7 ŒX7 ŒQ6 y­w)z6This is the async version of `retriever.list_corpora`.Nr?   r   r   r   )	r	   r   r@   rA   r"   r#   r   r   r   rB   s        r)   Úlist_corpora_asyncrD   í   s    è ø€ ð ÐØˆà€~Ü3Ó5ˆä×'Ñ'°)Ô<€GØ1˜f×1Ñ1°'ÑM¸_ÑM×M÷ /ð /ˆfÜ�f“×%Ñ% fÓ-ˆÜ�V˜]Ô+Ü�V˜]Ô+Ü×$Ñ$Ñ. vÑ.Ô.ð	 Nøð /øÑMùs5   ‚=B¿BÁ BÁBÁBÁ	BÁABÂBÂB)NNNN)
r   ú
str | Noner   rE   r%   ú!glm.RetrieverServiceClient | Noner&   ú&helper_types.RequestOptionsType | NoneÚreturnúretriever_types.Corpus)
r   rE   r   rE   r%   ú&glm.RetrieverServiceAsyncClient | Noner&   rG   rH   rI   )NN)r   Ústrr%   rF   r&   rG   rH   rI   )r   rK   r%   rJ   r&   rG   rH   rI   )FNN)r   rK   r7   Úboolr%   rF   r&   rG   )r   rK   r7   rL   r%   rJ   r&   rG   )r=   úOptional[int]r%   rF   r&   rG   rH   z Iterable[retriever_types.Corpus])r=   rM   r%   rF   r&   rG   rH   z%AsyncIterable[retriever_types.Corpus])Ú
__future__r   Útypingr   r   r   Úgoogle.ai.generativelanguageÚaiÚgenerativelanguageÚglmÚgoogle.generativeair   Úgoogle.generativeai.clientr   r	   Úgoogle.generativeai.typesr
   Ú%google.generativeai.types.model_typesr   r   r!   r,   r1   r4   r9   r<   rA   rD   r   r*   r)   ú<module>rX      så  ðõ #÷ 5Ñ 4ç *Ð *Ý &å CÝ IÝ 2Ý >Ý 5ð Ø#Ø04Ø>Bð	)Ø
ð)àð)ð .ð)ð <ð	)ð
 ó)ðZ Ø#Ø59Ø>Bð	Ø
ðàðð 3ðð <ð	ð
 óð> 15Ø>BðØ
ðà-ðð <ðð ó	ðD 6:Ø>BðØ
ðà2ðð <ðð ó	ð6 Ø04Ø>Bð	5Ø
ð5àð5ð .ð5ð <ó	5ð: Ø59Ø>Bð	;Ø
ð;àð;ð 3ð;ð <ó	;ð,  $Ø04Ø>Bñ	/àð/ð .ð/ð <ð	/ð
 &ó/ð@  $Ø04Ø>Bñ	/àð/ð .ð/ð <ð	/ð
 +ô/r*   