
    q[i                        U d Z ddlZddlZddlmZ ddlmZ ddlmZ ded	e	fd
Z
 ej                  d ej                  d ej                  d       ej                  d      gddddddiid             ej                  d ej                  d ej                  d      ddd      d       ej                  d ej                  d ej                  d      ddd      d       ej                  d ej                  d  ej                  d      ddddddiidd!      d       ej                  d" ej                  d  ej                  d      d#d$i      d%       ej                  d& ej                  d' ej                  d      d#d$i      d%       ej                  d( ej                  d  ej                  ej                   j#                  d)*      ej                   j%                  d+d,-      g.      gddddddiid      d%       ej                  d/ ej                  d  ej                  ej                   j'                   e
d0      d12      g.      gd#d$i      d%       ej                  d3 ej                  d  ej                  ej                   j#                  d4*      g.       ej                  ej                   j#                  d5*      g.      g6      d7d%8      g	Zeej                     ed9<    ej.                  e e       d:e;      Zej6                  j8                  d<        Zej6                  j8                  d=        Zy)>z Tests for models.embedContent().    N   )_transformers)types   )pytest_helperrelative_pathreturnc                 "   t         j                  j                  t         j                  j                  t         j                  j	                  t
              |             }t        |d      5 }|j                         cd d d        S # 1 sw Y   y xY w)Nrb)ospathabspathjoindirname__file__openread)r   abs_file_pathfiles      e/mnt/data/GridWatch/venv/lib/python3.12/site-packages/google/genai/tests/models/test_embed_content.py_get_bytes_from_filer      s_    ''//ggll277??8,m<- M4  D99;  s   +BBtest_multi_texts_with_configgemini-embedding-001What is your name?zI am a model.
   
test_titleRETRIEVAL_DOCUMENTheaderstest)output_dimensionalitytitle	task_typehttp_optionsmodelcontentsconfig)name
parameters6test_single_text_with_mime_type_not_supported_in_mldevz
text/plain)r    	mime_typezparameter is not supported)r(   r)   exception_if_mldev:test_single_text_with_auto_truncate_not_supported_in_mldevT)r    auto_truncate)test_vertex_new_api_text_only_with_configgemini-embedding-2-exp-11-2025)r    r!   r"   r#   r.   test_vertex_new_api_text_onlyr    d   404test_vertex_new_api_maasz>publishers/intfloat/models/multilingual-e5-large-instruct-maas(test_vertex_new_api_gcs_image_and_configz&Similar things to the following image:)textz?gs://cloud-samples-data/generative-ai/image/a-man-and-a-dog.pngz	image/png)file_urir+   )partstest_vertex_new_api_inline_pdfz../data/story.pdfzapplication/pdf)datar+   *test_vertex_new_api_list_of_contents_errorhelloworld)r%   r&   supports)r(   r)   exception_if_vertexr,   
test_tablezmodels.embed_content)r   globals_for_filetest_methodr@   c                 |   K   | j                   j                  j                  ddddi       d {   }|sJ y 7 	w)Nr   r   r    r   r$   )aiomodelsembed_contentclientresponses     r   
test_asyncrJ      sF     ::$$22"#%r* 3  (
 
/s   .<:
<c                    K   | j                   sy | j                  j                  j                  dt	        j
                  d      ddi       d {   }|sJ y 7 	w)Nr0   r   r    r   r$   )vertexairD   rE   rF   t
t_contentsrG   s     r   test_async_new_apirO      sZ     	
::$$22,||01%r* 3  (
 
/s   AAA
A)__doc__r   pytest r   rM   r   r   strbytesr   TestTableItemEmbedContentParameters	t_contentrN   ContentPart	from_textfrom_uri
from_bytesr@   list__annotations__setupr   globals
pytestmarkmarkasynciorJ   rO        r   <module>rf      s  $ ' 	  "      M+/5//(01O,
 *,%1	2!	
$  ME/5//(!Q\\"67)+)
 8  MI/5//(!Q\\"67)+!%
 8  M8/5//2!Q\\"67)+%1	2! "&
 8!$  M,/5//2!Q\\"67'
 !  M'/5//P!Q\\"67'
 !  M7/5//2

,,!I -  

++%f&1 , 	
 *,%1	2!	
2 !7:  M-/5//2

--!56I!J&7 . 	 (
" !'*  M9/5//2UZZ%9%9w%9%G$HIUZZ%9%9w%9%G$HI
 ' SU1
D,,- Un !]  	Y&	
    re   