§
     ÂiË"  ã                  ó  — 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dS )0é    )Úannotations)ÚAsyncIterableÚIterableÚOptionalN)Úprotos)Úget_default_retriever_client)Ú"get_default_retriever_async_client)Úhelper_types)Úidecode_time)Úretriever_typesÚnameú
str | NoneÚdisplay_nameÚclientú!glm.RetrieverServiceClient | NoneÚrequest_optionsú&helper_types.RequestOptionsType | NoneÚreturnúretriever_types.Corpusc                ó  — |€i }|€t          ¦   «         }| €t          j        |¬¦  «        }nit          j        | ¦  «        rt          j        d| › �|¬¦  «        }n;t          t          j                             t          | ¦  «        | ¬¦  «        ¦  «        ‚t          j	        |¬¦  «        } |j
        |fi |¤Ž}t          |¦  «                             |¦  «        }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.
    N©r   úcorpora/©r   r   ©Ú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   r   r   r   ÚrequestÚresponses          úg/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/google/generativeai/retriever.pyr(   r(      s  € ð, ÐØˆà€~Ý-Ñ/Ô/ˆà€|Ý”¨LÐ9Ñ9Ô9ˆˆÝ	Ô	# DÑ	)Ô	)ð ]Ý”Ð$5¨tÐ$5Ð$5ÀLÐQÑQÔQˆˆå�Ô7×>Ò>ÅcÈ$ÁiÄiÐVZÐ>Ñ[Ô[Ñ\Ô\Ð\åÔ(°Ð7Ñ7Ô7€GØ#ˆvÔ# GÐ?Ð?¨Ð?Ð?€HÝ�H‰~Œ~×%Ò% hÑ/Ô/€HÝ�˜=Ñ)Ô)Ð)Ý�˜=Ñ)Ô)Ð)ÝÔ%Ð1Ð1¨Ð1Ð1€HØ€Oó    ú&glm.RetrieverServiceAsyncClient | Nonec              ƒ  ó,  K  — |€i }|€t          ¦   «         }| €t          j        |¬¦  «        }nit          j        | ¦  «        rt          j        d| › �|¬¦  «        }n;t          t          j                             t          | ¦  «        | ¬¦  «        ¦  «        ‚t          j	        |¬¦  «        } |j
        |fi |¤Žƒ d{V —†}t          |¦  «                             |¦  «        }t          |d¦  «         t          |d¦  «         t          j        d	i |¤Ž}|S )
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_asyncr2   J   s-  è è € ð ÐØˆà€~Ý3Ñ5Ô5ˆà€|Ý”¨LÐ9Ñ9Ô9ˆˆÝ	Ô	# DÑ	)Ô	)ð ]Ý”Ð$5¨tÐ$5Ð$5ÀLÐQÑQÔQˆˆå�Ô7×>Ò>ÅcÈ$ÁiÄiÐVZÐ>Ñ[Ô[Ñ\Ô\Ð\åÔ(°Ð7Ñ7Ô7€GØ)�VÔ)¨'ÐEÐE°_ÐEÐEÐEÐEÐEÐEÐEÐE€HÝ�H‰~Œ~×%Ò% hÑ/Ô/€HÝ�˜=Ñ)Ô)Ð)Ý�˜=Ñ)Ô)Ð)ÝÔ%Ð1Ð1¨Ð1Ð1€HØ€Or/   Ústrc                ó,  — |€i }|€t          ¦   «         }d| vrd| z   } t          j        | ¬¦  «        } |j        |fi |¤Ž}t	          |¦  «                             |¦  «        }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.
    Nú/r   ©r   r   r   r    )	r   r   ÚGetCorpusRequestÚ
get_corpusr)   r*   r   r   r!   ©r   r   r   r,   r-   s        r.   r8   r8   g   s³   € ð ÐØˆà€~Ý-Ñ/Ô/ˆà
�$€€Ø˜DÑ ˆåÔ%¨4Ð0Ñ0Ô0€GØ ˆvÔ  Ð<Ð<¨OÐ<Ð<€HÝ�H‰~Œ~×%Ò% hÑ/Ô/€HÝ�˜=Ñ)Ô)Ð)Ý�˜=Ñ)Ô)Ð)ÝÔ%Ð1Ð1¨Ð1Ð1€HØ€Or/   c              ƒ  ó<  K  — |€i }|€t          ¦   «         }d| vrd| z   } t          j        | ¬¦  «        } |j        |fi |¤Žƒ d{V —†}t	          |¦  «                             |¦  «        }t          |d¦  «         t          |d¦  «         t          j        di |¤Ž}|S )z4This is the async version of `retriever.get_corpus`.Nr5   r   r6   r   r   r    )	r	   r   r7   r8   r)   r*   r   r   r!   r9   s        r.   Úget_corpus_asyncr;   ‡   sÉ   è è € ð ÐØˆà€~Ý3Ñ5Ô5ˆà
�$€€Ø˜DÑ ˆåÔ%¨4Ð0Ñ0Ô0€GØ&�VÔ& wÐBÐB°/ÐBÐBÐBÐBÐBÐBÐBÐB€HÝ�H‰~Œ~×%Ò% hÑ/Ô/€HÝ�˜=Ñ)Ô)Ð)Ý�˜=Ñ)Ô)Ð)ÝÔ%Ð1Ð1¨Ð1Ð1€HØ€Or/   FÚforceÚboolc                óˆ   — |€i }|€t          ¦   «         }d| vrd| z   } t          j        | |¬¦  «        } |j        |fi |¤Ž dS )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.

    Nr5   r   ©r   r<   )r   r   ÚDeleteCorpusRequestÚdelete_corpus©r   r<   r   r   r,   s        r.   rA   rA       sh   € ð ÐØˆà€~Ý-Ñ/Ô/ˆà
�$€€Ø˜DÑ ˆåÔ(¨d¸%Ð@Ñ@Ô@€GØ€FÔ˜Ð4Ð4 OÐ4Ð4Ð4Ð4Ð4r/   c              ƒ  ó˜   K  — |€i }|€t          ¦   «         }d| vrd| z   } t          j        | |¬¦  «        } |j        |fi |¤Žƒ d{V —† dS )z7This is the async version of `retriever.delete_corpus`.Nr5   r   r?   )r	   r   r@   rA   rB   s        r.   Údelete_corpus_asyncrD   »   s~   è è € ð ÐØˆà€~Ý3Ñ5Ô5ˆà
�$€€Ø˜DÑ ˆåÔ(¨d¸%Ð@Ñ@Ô@€GØ
ˆ&Ô
˜wÐ
:Ð
:¨/Ð
:Ð
:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:r/   )Ú	page_sizer   r   rE   úOptional[int]ú Iterable[retriever_types.Corpus]c              #  ó(  K  — |€i }|€t          ¦   «         }t          j        | ¬¦  «        } |j        |fi |¤ŽD ]W}t	          |¦  «                             |¦  «        }t          |d¦  «         t          |d¦  «         t          j        di |¤ŽV — ŒXdS )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©rE   r   r   r    )	r   r   ÚListCorporaRequestÚlist_corporar)   r*   r   r   r!   ©rE   r   r   r,   r   s        r.   rK   rK   Ï   s½   è è € ð  ÐØˆà€~Ý-Ñ/Ô/ˆåÔ'°)Ð<Ñ<Ô<€GØ%�&Ô% gÐAÐA°ÐAÐAð /ð /ˆÝ�f‘”×%Ò% fÑ-Ô-ˆÝ�V˜]Ñ+Ô+Ð+Ý�V˜]Ñ+Ô+Ð+ÝÔ$Ð.Ð. vÐ.Ð.Ð.Ð.Ð.Ð.ð	/ð /r/   ú%AsyncIterable[retriever_types.Corpus]c               óB  K  — |€i }|€t          ¦   «         }t          j        | ¬¦  «        } |j        |fi |¤Žƒ d{V —†2 3 d{V —†}t	          |¦  «                             |¦  «        }t          |d¦  «         t          |d¦  «         t          j        di |¤ŽW V — Œ^6 dS )z6This is the async version of `retriever.list_corpora`.NrI   r   r   r    )	r	   r   rJ   rK   r)   r*   r   r   r!   rL   s        r.   Úlist_corpora_asyncrO   í   sí   è è € ð ÐØˆà€~Ý3Ñ5Ô5ˆåÔ'°)Ð<Ñ<Ô<€GØ1˜fÔ1°'ÐMÐM¸_ÐMÐMÐMÐMÐMÐMÐMÐMð /ð /ð /ð /ð /ð /ð /ˆfÝ�f‘”×%Ò% fÑ-Ô-ˆÝ�V˜]Ñ+Ô+Ð+Ý�V˜]Ñ+Ô+Ð+ÝÔ$Ð.Ð. vÐ.Ð.Ð.Ð.Ð.Ð.Ð.ð	 NÐMÐMs   Á B)NNNN)
r   r   r   r   r   r   r   r   r   r   )
r   r   r   r   r   r0   r   r   r   r   )NN)r   r3   r   r   r   r   r   r   )r   r3   r   r0   r   r   r   r   )FNN)r   r3   r<   r=   r   r   r   r   )r   r3   r<   r=   r   r0   r   r   )rE   rF   r   r   r   r   r   rG   )rE   rF   r   r   r   r   r   rM   )Ú
__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(   r2   r8   r;   rA   rD   rK   rO   r    r/   r.   ú<module>rZ      s÷  ðð #Ð "Ð "Ð "Ð "Ð "ð 5Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4à *Ð *Ð *Ð *Ð *Ð *Ð *Ð *Ð *Ø &Ð &Ð &Ð &Ð &Ð &à CÐ CÐ CÐ CÐ CÐ CØ IÐ IÐ IÐ IÐ IÐ IØ 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø >Ð >Ð >Ð >Ð >Ð >Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5ð Ø#Ø04Ø>Bð	)ð )ð )ð )ð )ðZ Ø#Ø59Ø>Bð	ð ð ð ð ð> 15Ø>Bðð ð ð ð ðD 6:Ø>Bðð ð ð ð ð6 Ø04Ø>Bð	5ð 5ð 5ð 5ð 5ð: Ø59Ø>Bð	;ð ;ð ;ð ;ð ;ð,  $Ø04Ø>Bð	/ð /ð /ð /ð /ð /ð@  $Ø04Ø>Bð	/ð /ð /ð /ð /ð /ð /ð /r/   