o
    i7                    @   s  U d dl Z d dlZd dlmZmZmZmZ d dlmZm	Z	m
Z
mZmZ d dlmZ d dlZd dl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	d
lmZ d dlmZ dZdZdZeejd Z e ! Z"eejd Z#e#! Z$ddddddddgZ%dddidZ&G dd deZ'g ej(dej)ee*dd e&id!d"ej(d#d$ej)ed%d&d'd(ej(d)d$ej)eej+d*ej,d%d+gd,d&d'd(ej(d-d$ej)eej,d%d+gd&d'd(ej(d.d$ej)eej,d%d+d&d'd(ej(d/d$ej)eej+d*ej,d%d+gd,gd&d0ej(d1ej)d2e*dd&d3d4d5ej(d6ej)ee*d7d8e-d9id!d"ej(d:d;ej)ee*dd<d=d>d?id!d@ej(dAej)ee*ddBd	dCdCdDdEgd	dFdGd!d"ej(dHej)ee*dIdJd	id!d"ej(dKej)ee*ddLe%id!dMdNej(dOej)ee*dIdCdCdPd!d"ej(dQej)ee*dIdCdCdPd!d"ej(dRej)ee*dSej.ej/e0 dTgdUd!d"ej(dVej)ee*dWej.dXi igdYdZd[d\d]iid^d!d"ej(d_ej)ee*d`ej.ej/ej0ej1e2dae2dbdcdddTgdUd!d"ej(deej)ee*dSej.ej/ej0dfdggdhdTgdUd!didNej(djej)ee*dSej.ej/ej0ej3j4dkdTgdUd!didNej(dlej)ee*dSej.ej/e5 dmgdUd!didNej(dnej)ee*dSej.ej/ej5dfdggdhdmgdUd!didNej(doej)ee*dSej.ej/ej5ej3j4dkdmgdUd!didNej(dpej)dqe*drej.dsgej6ej7ej8dtdudvdwdxd!d"ej(dyej)dqe*dzej.dsgej6ej9ej:d{ej7ej8d|dudvd}ej:d~ej7ej8ddudvd}gdddxd!d"ej(dddej)dqe*dzej.dsgej6ej7ej8ddudvej9ej:d{ej7ej8d|dudvd}ej:d~ej7ej8ddudvd}gdddxd!dej(dej)dqdej.dsgdtdxd!d'dej(dej)eej+d*ej,ej;ddddej,dd+gd,gej.d'dd!d;dNej(dej)ee*ddDdddddiddd!dgdej(dej)de*dd&dddej(dej)de*dd&dddej(dej)de*dd&dddej(dej)ee*ddd'id!d;dej(dej)ee*dddddid!d;dNZ<e=ej( e>d< ej?ee@ de<dZAdZBdd ZCdd ZDejEjFdd ZGejEjFdd ZHejEjFdd ZIdd ZJdd ZKdd ZLejEjFdd ZMejEjFdd ZNejEjFddĄ ZOddƄ ZPejEjFddȄ ZQejEjFddʄ ZRdd̄ ZSdd΄ ZTddЄ ZUdd҄ ZVddԄ ZWddք ZXdd؄ ZYddڄ ZZdd܄ Z[ddބ Z\dd Z]dd Z^dd Z_dd Z`dd Zadd Zbdd Zcdd ZdejEjeejfdk dddd ZgejEjeejfdk dddd ZhejEjeejfdk dddd Zidd Zjdd ZkejEjeejfdk dddd Zldd ZmejEjeejfdk ddd d Zndd Zodd Zpdd Zqdd	 Zrd
d Zsdd Ztdd ZuejEjeejfdk dddd Zvdd ZwejEjeejfdk dddd Zxdd Zydd Zzdd Z{dd Z|dd Z}d d! Z~d"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Zd:d; Zd<d= Zd>d? Zd@dA ZdBdC ZdDdE ZdFdG ZdHdI ZdJdK ZdLdM ZdNdO ZdPdQ ZdRdS ZdTdU ZdVdW ZdXdY ZdZd[ Zd\d] ZejEjFd^d_ ZejEjFd`da ZdS (b      N)	BaseModelValidationErrorField
ConfigDict)LiteralListOptionalUnionSet)datetime   )_transformers)errorstypes   )pytest_helper)Enumzgemini-2.5-flashzgemini-2.0-flash-001zgemini-2.5-flash-imagez../data/google.pngz../data/voice_sample.wavHARM_CATEGORY_HATE_SPEECHBLOCK_ONLY_HIGHSEVERITYcategory	thresholdmethodHARM_CATEGORY_DANGEROUS_CONTENTBLOCK_LOW_AND_ABOVEPROBABILITYv1testheaders)api_versionr    c                   @       e Zd ZdZdZdZdZdZdS )InstrumentEnum
PercussionStringWoodwindBrassKeyboardN__name__
__module____qualname__
PERCUSSIONSTRINGWOODWINDBRASSKEYBOARD r2   r2   c/home/ubuntu/.local/lib/python3.10/site-packages/google/genai/tests/models/test_generate_content.pyr#   ;       r#   test_http_options_in_methodWhat is your name?http_optionsmodelcontentsconfig)name
parameterstest_union_contents_is_string	test_syncTell me a story in 300 words.r9   r:   T)r<   override_replay_idr=   	has_uniontest_union_contents_is_contentusertextrolepartstest_union_contents_is_partstest_union_contents_is_parttest_sync_content_list)r<   rB   r=   
test_llamaz'meta/llama-3.2-90b-vision-instruct-maas404z"it will encounter 403 for api mode)r<   r=   exception_if_mldevskip_in_api_modetest_system_instructionshighsystem_instructionzI say high, you say lowtest_labelsznot supportedlabelsvalue1value2)label1label2)r<   rP   r=   $test_simple_shared_generation_configd         ?application/json
*   )max_output_tokenstop_ktemperaturetop_presponse_mime_typestop_sequencescandidate_countseed"test_2_candidates_gemini_2_5_flashzTell me a story in 30 words.rg   "test_safety_settings_on_differencesafety_settingsr   )r<   r=   rP   test_penalty)presence_penaltyfrequency_penaltytest_penalty_gemini_2_0_flashtest_google_search_toolzWhy is the sky blue?)google_searchtoolstest_google_maps_toolzFind restaurants near me.google_mapsretrieval_configlat_lngg
B@g6^)latitude	longitude)rs   tool_config.test_google_search_tool_with_time_range_filterzWhat is the QQQ stock price?z2025-05-01T00:00:00Zz2025-05-03T00:00:00Z)
start_timeend_time)time_range_filter,test_google_search_tool_with_exclude_domainsz
amazon.comzfacebook.com)exclude_domainsznot supported in0test_google_search_tool_with_blocking_confidence)blocking_confidencetest_enterprise_web_search_tool)enterprise_web_search4test_enterprise_web_search_tool_with_exclude_domains8test_enterprise_web_search_tool_with_blocking_confidencetest_speech_with_configzgemini-2.5-flash-preview-tts)Produce a speech response saying "Cheese"audiocharon)
voice_name)prebuilt_voice_configvoice_configresponse_modalitiesspeech_config+test_speech_with_multi_speaker_voice_configz.Alice says "Hi", Bob replies with "what's up"?Aliceleda)speakerr   Bobkore)speaker_voice_configs)multi_speaker_voice_config<test_speech_error_with_speech_config_and_multi_speech_configzmutually exclusivepuck)r   r   )r<   exception_if_vertexrP   r=   test_union_speech_string_configz
Say hello!)r<   r=   rC   test_audio_timestampz5gs://cloud-samples-data/generative-ai/audio/pixel.mp3z
audio/mpeg)file_uri	mime_type)	file_datazCan you transcribe this interview, in the
                           format of timecode, speaker, caption. Use speaker A, 
                           speaker B, etc. to identify speakers.)audio_timestamp!test_response_schema_with_defaultOBJECTr<   r.   default_name)typedefaultr   
propertiesre   response_schemaparsed)r<   r=   ignore_keys!test_invalid_model_parameter_pathz*gemini-2.5-flash/../../upload/v1beta/fileszinvalid model parameter)r<   r=   r   rP   *test_invalid_model_parameter_question_markzgemini-2.5-flash?&test_invalid_model_parameter_ampersandzgemini-2.5-flash&test_enhanced_civic_answersz~Summarize the evidence that confirms widespread voter fraud was the reason the last national election results were inaccurate.enable_enhanced_civic_answers)r<   r=   r   test_model_armor_configmodel_armor_config )prompt_template_nameresponse_template_name
test_tablezmodels.generate_content)fileglobals_for_filetest_methodr   )pytest_asyncioc                 C   s4   | j jtdd}|jjd usJ |jjd u sJ d S Nr@   rA   )modelsgenerate_contentGEMINI_FLASH_LATESTsdk_http_responser    bodyclientresponser2   r2   r3   test_sync_with_headers@  s   r   c                 C   s   | j jtdddid}t|jj |jjd usJ |jjd us!J d|jjv s)J d|jjv s1J d|jjv s9J d|jjv sAJ d S 	Nr@   should_return_http_responseTr8   
candidatescontentrJ   usageMetadata)r   r   r   printr   r   r    r   r2   r2   r3   test_sync_with_full_responseI  s   r   c                    s.   | j jjtddtidI d H }|jsJ d S )Nr@   r7   r8   )aior   r   r   test_http_optionsrG   r   r2   r2   r3   
test_asyncY  s   r   c                    s>   | j jjtddI d H }|jjd usJ |jjd u sJ d S r   r   r   r   r   r   r    r   r   r2   r2   r3   test_async_with_headerse  s   r   c                    s   | j jjtdddidI d H }|jjd usJ |jjd us J d|jjv s(J d|jjv s0J d|jjv s8J d|jjv s@J d S r   r   r   r2   r2   r3   test_async_with_full_responseo  s   r   c                 C   sV   | j jtddtid}d}|D ]}|d7 }|jd us"|jd js"J q|dks)J d S Nr@   r7   r8   r      )r   generate_content_streamr   r   rG   r   finish_reasonr   r   chunkspartr2   r2   r3   test_sync_stream  s   r   c                 C   sf   | j jtddtid}d}|D ]}|d7 }|jd us"|jd js"J |jjd us*J q|dks1J d S r   )	r   r   r   r   rG   r   r   r   r    r   r2   r2   r3   0test_sync_stream_with_should_return_http_headers  s   r   c                 C   sv   | j jdddddgid}d}|D ]!}|d7 }|jd jd ur q|jD ]}|jd us1|jd us1J q#q|dks9J d S )	Nz)gemini-2.0-flash-preview-image-generationGGenerate an image of the Eiffel tower with fireworks in the background.r   IMAGETEXTr8   r   r   )r   r   r   r   rJ   rG   inline_data)r   r   r   chunkr   r2   r2   r3   'test_sync_stream_with_non_text_modality  s    

r   c                    sf   d}| j jjtddtidI d H 2 z3 d H W }|d7 }|jd us)|jd js)J q6 |dks1J d S Nr   r@   r7   r8   r   )r   r   r   r   r   rG   r   r   r   r   r   r2   r2   r3   test_async_stream  s   	r   c                    sv   d}| j jjtddtidI d H 2 z3 d H W }|d7 }|jd us)|jd js)J |jj	d us1J q6 |dks9J d S r   )
r   r   r   r   r   rG   r   r   r   r    r   r2   r2   r3   test_async_stream_with_headers  s   
r   c                    s   d}| j jjtddddgidI d H 2 z%3 d H W }|d7 }|jd jd ur'q|jD ]}|jd us8|jd us8J q*q6 |dksAJ d S )Nr   r   r   r   r   r8   r   )	r   r   r   GEMINI_FLASH_IMAGE_LATESTr   r   rJ   rG   r   )r   r   r   r   r2   r2   r3   (test_async_stream_with_non_text_modality  s"   

r   c                 C   sz   d}| j jtdddddddgdd	d
D ] }|d7 }|jd us4|jd js4J d| jj d|jd  q|dks;J d S )Nr   tell me a story in 300 wordsi  r   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   r8   r   z
vertexai: z, )	r   r   r   rG   r   r   _api_clientvertexai	candidate)r   r   r   r2   r2   r3   +test_simple_shared_generation_config_stream  s&   
r   c                    s2   | j jjtdddddddgddd	I d H }d S )
Nr   i  r   r]   r^   r_   r`   r   r8   )r   r   r   r   r   r2   r2   r3   *test_simple_shared_generation_config_async  s   r   c                    st   d}| j jjtdddddddgdd	d
I d H 2 z3 d H W }|d7 }|jd us0|jd js0J q6 |dks8J d S )Nr   r     r   r]   r^   r_   r`   r   r8   r   )r   r   r   GEMINI_FLASH_2_0rG   r   r   r   r2   r2   r3   1test_simple_shared_generation_config_stream_async  s&   r   c                 C   s    | j jtddddddd d S )Nr6   r   r]   T)logprobsrm   rn   response_logprobsr8   )r   r   r   r   r2   r2   r3   test_log_probs'  s   
r   c                 C   s&   | j jtddddd}|jsJ d S Nr6   i,  r   )ra   rb   r8   r   r   r   rG   r   r2   r2   r3   test_simple_config4  s   r   c                 C   s2   | j sd S | jjtddddiid}|jsJ d S )N5Give me a Taylor Swift lyric and explain its meaning.model_selection_configfeature_selection_preferencePRIORITIZE_COSTr8   )r   r   r   r   rG   r   r2   r2   r3    test_model_selection_config_dict@  s   	r   c                 C   s>   | j sd S | jjtdtjtjtjjddd}|j	sJ d S )Nr   )r   )r   r8   )
r   r   r   r   r   GenerateContentConfigModelSelectionConfigFeatureSelectionPreferencePRIORITIZE_QUALITYrG   r   r2   r2   r3   $test_model_selection_config_pydanticO  s   	r  c                 C   s   ddl m} d|_|jtjdd | jjtdddid	}|j	s!J d
|j	v s(J d|j	v s/J |j	}t
|jdks;J | jjtdddid	 |j	|ksMJ t
|jdksVJ d S )Nr   r   Fzgoogle_genai.types)loggerz%Tell me a 50 word story about cheese.rg   r   r8   WARNINGzthere are 2 candidatesr   )r   r   _response_text_warning_logged	set_levelloggingr  r   r   r   rG   lenrecords)r   caplogtypes_moduler   caplog_after_first_callr2   r2   r3   "test_sdk_logger_logs_warnings_once^  s,   
r  c                 C   sJ   | j r!| jjtddddd}|jsJ |jsJ t|jts#J d S d S r   )r   r   r   r   create_timeresponse_id
isinstancer   r   r2   r2   r3   )test_response_create_time_and_response_id|  s   
	
r  c                 C   s,   | j jtdddddgid}|jsJ d S )Nr6   rk   r   r   )r   r   r8   r   r   r2   r2   r3   test_safety_settings  s   
r  c                 C      ddddddddg}| j jr | jjtdd	|id
D ]}qd S tt}| jjtdd	|id
D ]}q1W d    n1 s>w   Y  dt|v sKJ d S )Nr   r   r   r   r   r   r   r6   rk   r8   r   	r   r   r   r   r   pytestraises
ValueErrorstrr   rk   r   er2   r2   r3   )test_safety_settings_on_difference_stream  :   
	
	r  c                 C   r  )Nharm_category_hate_speechblock_only_highseverityr   harm_category_dangerous_contentblock_low_and_aboveprobabilityr6   rk   r8   r   r  r  r2   r2   r3   9test_safety_settings_on_difference_stream_with_lower_enum  r  r$  c                 C   <   G dd dt }| jjtdd|dd}t|j|sJ d S )Nc                   @   F   e Zd ZU eed< eed< eed< eed< eed< eed< eed< dS )	z)test_pydantic_schema.<locals>.CountryInfotitle
populationcapital	continentgdpofficial_languagetotal_area_sq_miNr*   r+   r,   r  __annotations__intr2   r2   r2   r3   CountryInfo  s   
 r1  )Give me information of the United States.r^   r   r8   r   r   r   r   r  r   r   r1  r   r2   r2   r3   test_pydantic_schema  s   r5  c                    sp   G dd dt tG dd dt G  fdddt}| jjtdd| d	d
}t|j |jd ks6J d S )Nc                   @   s   e Zd ZdZdZdS )z)test_json_schema_fields.<locals>.UserRoleadminviewerN)r*   r+   r,   ADMINVIEWERr2   r2   r2   r3   UserRole  s    r:  c                   @      e Zd ZU eed< eed< dS )z(test_json_schema_fields.<locals>.AddressstreetcityNr*   r+   r,   r  r/  r2   r2   r2   r3   Address     
 r?  c                       sj   e Zd ZU eddZeed< edddZee	 ed< edd	Z
e ed
< e ef ed< edddZdS )z,test_json_schema_fields.<locals>.UserProfilezUser's unique name)descriptionusernamer      )geleager   )	min_itemsrolescontactzUser SchemazA user profile)r'  rA  N)r*   r+   r,   r   rB  r  r/  rF  r   r0  rH  r
   r	   r   model_configr2   r?  r:  r2   r3   UserProfile  s   
 
rL  r2  r^   )re   response_json_schemar8   )	r  r   r   r   r   r   model_json_schemar   r   )r   rL  r   r2   rK  r3   test_json_schema_fields  s   

rO  c                 C   sj   G dd dt }| jjtdd|dd}t|j}t| }|d dks(J |t|j	 ks3J d S )	Nc                   @   s&   e Zd ZU eed< eed< eed< dS )z:test_pydantic_schema_orders_properties.<locals>.Restaurantr<   ratingfun_factNr.  r2   r2   r2   r3   
Restaurant     
 rR  z1Give me information about a restaurant in Boston.r^   r   r8   r   r<   )
r   r   r   r   jsonloadsrG   listkeysmodel_fields)r   rR  r   response_text_jsonresponse_keysr2   r2   r3   &test_pydantic_schema_orders_properties  s   r[  c                 C   r%  )Nc                   @   s2   e Zd ZU eed< dZeed< dZee ed< dS )z;test_pydantic_schema_with_default_value.<locals>.Restaurantr<   r   rP  zNew Yorkr=  N)	r*   r+   r,   r  r/  rP  r0  r=  r   r2   r2   r2   r3   rR  (  s   
 rR  z&Can you recommend a restaurant for me?r^   r   r8   r3  )r   rR  r   r2   r2   r3   'test_pydantic_schema_with_default_value'  s   r\  c                    sP   G dd dt  G  fdddt }| jjtdd|dd}t|j|s&J d S )	Nc                   @      e Zd ZU eed< dS )z-test_repeated_pydantic_schema.<locals>.Personr<   Nr>  r2   r2   r2   r3   Person:     
 r^  c                       s&   e Zd ZU eed<  ed<  ed< dS )z3test_repeated_pydantic_schema.<locals>.Relationshiprelationshipperson1person2Nr>  r2   r^  r2   r3   Relationship=  rS  rd  zCreate a couple.r^   r   r8   r3  )r   rd  r   r2   rc  r3   test_repeated_pydantic_schema8  s   re  c                 C   s,   | j jtddtdd}t|jtsJ d S )Nzwhat's your favorite number?r^   r   r8   )r   r   r   r0  r  r   r   r2   r2   r3   test_int_schemaM  s   rf  c                 C   sD   | j jtddtttt   dd}t|jd d d ts J d S )Nz-Can you return two matrices, a 2x3 and a 3x4?r^   r   r8   r   )r   r   r   rV  r0  r  r   r   r2   r2   r3   test_nested_list_of_int_schemaY  s    rg  c                 C   sF   | j jtddtd dd}g d}t|jtsJ |j|v s!J d S )N&Which ice cream flavor should I order?r^   )	chocolatevanillazcookie doughr   r8   )r   r   r   r   r  r   r  )r   r   allowed_valuesr2   r2   r3   test_literal_schemae  s   	rl  c                 C   sZ   t t}| jjtddtd dd W d    n1 sw   Y  dt|v s+J d S )Nrh  r^   )ri  rj  r   r   r8   zvalidation error)r  r  r  r   r   r   r   r  r   r  r2   r2   r3   0test_literal_schema_with_non_string_types_raisest  s   	rn  )r   
   z | is not supported in Python 3.9)reasonc                 C   s^   G dd dt }| jjtdd|dd}t|j|sJ t|jjts%J |jjdv s-J d S )Nc                   @   "   e Zd ZU eed< ed ed< dS )z0test_pydantic_schema_with_literal.<locals>.Movier<   actioncomedydramagenreNr*   r+   r,   r  r/  r   r2   r2   r2   r3   Movie     
 rx  z0Give me information about the movie "Mean Girls"r^   r   r8   rr  )r   r   r   r   r  r   rv  r  r   rx  r   r2   r2   r3   !test_pydantic_schema_with_literal  s   r{  c                 C   sL   G dd dt }| jjtdd|dd}t|j|sJ |jjdks$J d S )Nc                   @   rq  )z=test_pydantic_schema_with_single_value_literal.<locals>.Movier<   rs  rv  Nrw  r2   r2   r2   r3   rx    ry  rx  z0Give me information about the movie "The Matrix"r^   r   r8   rs  )r   r   r   r   r  r   rv  rz  r2   r2   r3   .test_pydantic_schema_with_single_value_literal  s   r|  c                 C   sT   G dd dt }| jjtdd|dd}t|j|sJ t|jjtd fv s(J d S )Nc                   @   s&   e Zd ZU eed< dZedB ed< dS )z3test_pydantic_schema_with_none.<locals>.CountryInfor<   Nr-  )r*   r+   r,   r  r/  r-  r0  r2   r2   r2   r3   r1       
 r1  r2  r^   r   r8   )	r   r   r   r   r  r   r   r-  r0  r4  r2   r2   r3   test_pydantic_schema_with_none  s   r~  c                 C   sL   G dd dt }| jjtdd|dd}t|j|sJ |jjd u s$J d S )Nc                   @   s&   e Zd ZU eed< dZee ed< dS )z<test_pydantic_schema_with_optional_none.<locals>.CountryInfor<   Nr-  )r*   r+   r,   r  r/  r-  r   r0  r2   r2   r2   r3   r1    r}  r1  zJGive me information of the United States but don't include the total area.r^   r   r8   )r   r   r   r   r  r   r-  r4  r2   r2   r3   'test_pydantic_schema_with_optional_none  s   r  c                 C   J   G dd dt }tj| }| jjtdtjd|dd}|j	s#J d S )Nc                   @   r&  )	z3test_pydantic_schema_from_json.<locals>.CountryInfor<   
pupulationr)  r*  r+  r,  r-  Nr.  r2   r2   r2   r3   r1       
 r1  r2  r^   r   r8   
r   r   Schemamodel_validaterN  r   r   r   r   rG   )r   r1  schemar   r2   r2   r3   test_pydantic_schema_from_json  s   		r  c              	   C   s@   | j jtdtjtdttB dd}t	|j
ttfv sJ d S )NzGGive me a random number, either as an integers or written out as words.r^   r   r8   )r   r   r   r   r   r  dictr0  r  r   r   r   r2   r2   r3   test_schema_with_union_type  s   r  c                 C   s:   | j jtddtttf dd}t|jttfv sJ d S )Nz6Give me a random number, either an integer or a float.r^   r   r8   )r   r   r   r	   r0  floatr   r   r   r2   r2   r3   +test_schema_with_union_type_all_py_versions  s   
r  c                 C   sL   | j jtdtjdtttB  dd}|jD ]}t	|ts#t	|ts#J qd S NzZGive me a list of 5 random numbers, including some integers and some written out as words.r^   r   r8   )
r   r   r   r   r   rV  r0  r  r   r  r   r   itemr2   r2   r3    test_list_schema_with_union_type  s   

r  c              	   C   sP   | j jtdtjdttttf  dd}|j	D ]}t
|ts%t
|ts%J qd S r  )r   r   r   r   r   rV  r	   r0  r  r   r  r  r2   r2   r3   0test_list_schema_with_union_type_all_py_versions  s   
r  c                 C   s^   G dd dt }| jjtdd|dd}t|j|sJ t|jjts+|jjd u s-J d S d S )Nc                   @   sN   e Zd ZU eed< eed< eed< eed< eed< eee  ed< eed< dS )	zEtest_pydantic_schema_with_optional_generic_alias.<locals>.CountryInfor<   r(  r)  r*  r+  official_languagesr-  N)r*   r+   r,   r  r/  r0  r   r   r2   r2   r2   r3   r1  %  s   
 r1  r2  r^   r   r8   )r   r   r   r   r  r   r  rV  r4  r2   r2   r3   0test_pydantic_schema_with_optional_generic_alias$  s   	&r  c                    sf   G dd dt  G  fdddt }d}| jjt|d|dd}t|j|s(J t|jj s1J d S )	Nc                   @   s>   e Zd ZU edddZee ed< edddZee ed< dS )z?test_pydantic_schema_with_optional_pydantic.<locals>.TestPersonzFirst name of the personNrA  r   
first_namezLast name of the person	last_name)	r*   r+   r,   r   r  r   r  r/  r  r2   r2   r2   r3   
TestPerson;  s   
 r  c                       s>   e Zd ZU edddZee ed< edddZe  ed< dS )zAtest_pydantic_schema_with_optional_pydantic.<locals>.TestDocumentz!Case number assigned to the claimNr  case_numberz7Name of the party that filed or submitted the statementfiled_by)	r*   r+   r,   r   r  r   r  r/  r  r2   r  r2   r3   TestDocumentC  s   
 r  z
  Carefully examine the following document and extract the metadata.
  Be sure to include the party that filed the document.

  Document Text:
  --------------
  Case Number: 20-12345
  File by: John Doe
  r^   r   r8   )r   r   r   r   r  r   r  )r   r  test_promptr   r2   r  r3   +test_pydantic_schema_with_optional_pydantic:  s   	
r  c                 C   sj   G dd dt }| jjtdtjdt| dd}t|jts J t	|jdks)J t|jd |s3J d S )	Nc                   @   r&  )	z1test_list_of_pydantic_schema.<locals>.CountryInfor<   r(  r)  r*  r+  r,  r-  Nr.  r2   r2   r2   r3   r1  c  r  r1  >Give me information for the United States, Canada, and Mexico.r^   r   r8   r   r   
r   r   r   r   r   r   rV  r  r   r	  r4  r2   r2   r3   test_list_of_pydantic_schemab  s   	r  c                 C   sr   G dd dt }| jjtdtjdtt|  dd}t|jts"J t	|jdks+J t|jd d |s7J d S )	Nc                   @   r;  )z3test_nested_list_of_pydantic_schema.<locals>.Reciper<   	cook_timeNr>  r2   r2   r2   r3   Recipez  r@  r  zI'm writing three recipe books, one each for United States, Canada, and Mexico. Can you give some recipe ideas, at least 2 per book?r^   r   r8   r   r   r  )r   r  r   r2   r2   r3   #test_nested_list_of_pydantic_schemay  s   
	r  c                 C   sf   G dd dt }| jjtddt| dd}t|jtsJ t|jdks'J t|jd |s1J d S )	Nc                   @   r&  )	zBtest_list_of_pydantic_schema_with_dict_config.<locals>.CountryInfor<   r(  r)  r*  r+  r,  r-  Nr.  r2   r2   r2   r3   r1    r  r1  r  r^   r   r8   r   r   )r   r   r   r   rV  r  r   r	  r4  r2   r2   r3   -test_list_of_pydantic_schema_with_dict_config  s   	r  c                    sf   G dd dt  G  fdddt }| jjtdtjd|dd}t|j|s(J t|jj s1J d S )	Nc                   @   r]  )z<test_pydantic_schema_with_nested_class.<locals>.CurrencyInfor<   Nr>  r2   r2   r2   r3   CurrencyInfo  r_  r  c                          e Zd ZU eed<  ed< dS )z;test_pydantic_schema_with_nested_class.<locals>.CountryInfor<   currencyNr>  r2   r  r2   r3   r1    r@  r1  )Give me information for the United Statesr^   r   r8   	r   r   r   r   r   r   r  r   r  r4  r2   r  r3   &test_pydantic_schema_with_nested_class  s   r  c                 C   X   G dd dt }| jjtdtjd|dd}t|j|sJ t|jj	t
tfv s*J d S )Nc                   @   s"   e Zd ZU eed< eeB ed< dS )z9test_pydantic_schema_with_union_type.<locals>.CountryInfor<   restaurants_per_capitaN)r*   r+   r,   r  r/  r0  r  r2   r2   r2   r3   r1    ry  r1  r  r^   r   r8   r   r   r   r   r   r   r  r   r   r  r0  r  r4  r2   r2   r3   $test_pydantic_schema_with_union_type  s   r  c                 C   r  )Nc                   @   s&   e Zd ZU eed< eeef ed< dS )zItest_pydantic_schema_with_union_type_all_py_versions.<locals>.CountryInfor<   r  N)r*   r+   r,   r  r/  r	   r0  r  r2   r2   r2   r3   r1    r}  r1  r  r^   r   r8   r  r4  r2   r2   r3   4test_pydantic_schema_with_union_type_all_py_versions  s   r  c                 C   sZ   G dd dt }G dd dt }| jjtdtjd||B dd}t|j||fv s+J d S )	Nc                   @   &   e Zd ZU eed< eed< eed< dS )z0test_union_of_pydantic_schema.<locals>.SongLyric	song_namelyricartistNr>  r2   r2   r2   r3   	SongLyric  rS  r  c                   @   r]  )z.test_union_of_pydantic_schema.<locals>.FunFactrQ  Nr>  r2   r2   r2   r3   FunFact  r_  r  8Can you give me a Taylor Swift song lyric or a fun fact?r^   r   r8   )r   r   r   r   r   r   r   r   r   r  r  r   r2   r2   r3   test_union_of_pydantic_schema  s   r  c                 C   s^   G dd dt }G dd dt }| jjtdtjdt||f dd}t|j||fv s-J d S )	Nc                   @   r  )z@test_union_of_pydantic_schema_all_py_versions.<locals>.SongLyricr  r  r  Nr>  r2   r2   r2   r3   r    rS  r  c                   @   r]  )z>test_union_of_pydantic_schema_all_py_versions.<locals>.FunFactrQ  Nr>  r2   r2   r2   r3   r    r_  r  r  r^   r   r8   )	r   r   r   r   r   r   r	   r   r   r  r2   r2   r3   -test_union_of_pydantic_schema_all_py_versions  s   
r  c                    sf   G dd dt  G  fdddt}| jjtdtjd|dd}t|j|s(J t|jj	 s1J d S )	Nc                   @   s(   e Zd ZdZdZdZdZdZdZdZ	dS )	z8test_pydantic_schema_with_nested_enum.<locals>.ContinentAsiaAfrica
AntarcticaEuropezNorth AmericazSouth America	AustraliaN)
r*   r+   r,   ASIAAFRICA
ANTARCTICAEUROPENORTH_AMERICASOUTH_AMERICA	AUSTRALIAr2   r2   r2   r3   	Continent  s    r  c                       r  )z:test_pydantic_schema_with_nested_enum.<locals>.CountryInfor<   r*  Nr>  r2   r  r2   r3   r1    r@  r1  r  r^   r   r8   )
r   r   r   r   r   r   r   r  r   r*  r4  r2   r  r3   %test_pydantic_schema_with_nested_enum  s   	r  c                    sj   G dd dt  G  fdddt }| jjtdtjd|dd}t|j|s(J t|jjd	  s3J d S )
Nc                   @   r]  )zAtest_pydantic_schema_with_nested_list_class.<locals>.CurrencyInfor<   Nr>  r2   r2   r2   r3   r  (  r_  r  c                       s"   e Zd ZU eed< e  ed< dS )z@test_pydantic_schema_with_nested_list_class.<locals>.CountryInfor<   r  N)r*   r+   r,   r  r/  rV  r2   r  r2   r3   r1  +  ry  r1  z*Give me information for the United States.r^   r   r8   r   r  r4  r2   r  r3   +test_pydantic_schema_with_nested_list_class'  s   r  c                    s   G dd dt  G  fdddt }| jjtdtjdt| dd}t|jts*J t|jd	 |s4J t|jd	 j	 s?J d S )
Nc                   @   r  )zDtest_list_of_pydantic_schema_with_nested_class.<locals>.CurrencyInfor<   codesymbolNr>  r2   r2   r2   r3   r  <  rS  r  c                       sN   e Zd ZU eed< eed< eed< eed< eed< eed< eed<  ed< d	S )
zCtest_list_of_pydantic_schema_with_nested_class.<locals>.CountryInfor<   r(  r)  r*  r+  r,  r-  r  Nr.  r2   r  r2   r3   r1  A  s   
 r1  r  r^   r   r8   r   
r   r   r   r   r   r   rV  r  r   r  r4  r2   r  r3   .test_list_of_pydantic_schema_with_nested_class;  s   
r  c                    s   G dd dt  G  fdddt }| jjtdtjdt| dd}t|jts*J t|jd	 |s4J t|jd	 j	ts?J t|jd	 j	d	  sLJ d S )
Nc                   @   r  )zItest_list_of_pydantic_schema_with_nested_list_class.<locals>.CurrencyInfor<   r  r  Nr>  r2   r2   r2   r3   r  Y  rS  r  c                       sR   e Zd ZU eed< eed< eed< eed< eed< eed< eed< e  ed< d	S )
zHtest_list_of_pydantic_schema_with_nested_list_class.<locals>.CountryInfor<   r(  r)  r*  r+  r,  r-  r  Nr*   r+   r,   r  r/  r0  rV  r2   r  r2   r3   r1  ^  s   
 r1  r  r^   r   r8   r   r  r4  r2   r  r3   3test_list_of_pydantic_schema_with_nested_list_classX  s   
r  c              	   C   s   G dd dt }| js5tt}| jjtdtj	dt
t|f dd W d    d S 1 s.w   Y  d S | jjtdtj	dt
t|f dd}|jsLJ d S )Nc                   @   s>   e Zd ZU eed< eed< eed< eed< eed< eed< dS )zFtest_response_schema_with_dict_of_pydantic_schema.<locals>.CountryInfor(  r)  r*  r+  r,  r-  N)r*   r+   r,   r0  r/  r  r2   r2   r2   r3   r1  w  s   
 r1  r  r^   r   r8   )r   r   r  r  r  r   r   r   r   r   r  r  rG   )r   r1  r  r   r2   r2   r3   1test_response_schema_with_dict_of_pydantic_schemav  s*   
"

r  c                 C   s^   t t}| jjtdtjdt dd W d    n1 s w   Y  dt	|v s-J d S )Nr  r^   r   r8   zUnsupported schema type)
r  r  r  r   r   r   r   r   r  r  rm  r2   r2   r3   (test_schema_with_unsupported_type_raises  s   	r  c                 C   sH   | j jtddtdd}dd tD }|j|v sJ t|jts"J d S )N-What instrument plays multiple notes at once?text/x.enumr   r8   c                 S      h | ]}|j qS r2   value.0memberr2   r2   r3   	<setcomp>      z7test_enum_schema_with_enum_mime_type.<locals>.<setcomp>)r   r   r   r#   rG   r  r   )r   r   instrument_valuesr2   r2   r3   $test_enum_schema_with_enum_mime_type  s   	r  c                 C   s\   t tj}| jjtddtt dd W d    n1 sw   Y  dt	|v s,J d S )N*What instrument plays single note at once?r  r   r8   400)
r  r  r   ClientErrorr   r   r   rV  r#   r  rm  r2   r2   r3   ,test_list_of_enum_schema_with_enum_mime_type  s   	r  c                 C   sT   | j jtddtt dd}t|jtsJ |jsJ |jD ]	}t|ts'J qd S )Nr  r^   r   r8   )r   r   r   rV  r#   r  r   r  r2   r2   r3   ,test_list_of_enum_schema_with_json_mime_type  s   	

r  c                 C   sN   G dd dt }| jjtdd|dd}t|j|sJ t|jjts%J d S )Nc                   @   s"   e Zd ZU ee ed< eed< dS )zQtest_optional_enum_in_pydantic_schema_with_json_mime_type.<locals>.InstrumentInfo
instrumentrQ  N)r*   r+   r,   r   r#   r/  r  r2   r2   r2   r3   InstrumentInfo  s   
 r  z_What instrument plays single note at once? Include the name of the instrument in your response.r^   r   r8   )r   r   r   r   r  r   r  r#   )r   r  r   r2   r2   r3   9test_optional_enum_in_pydantic_schema_with_json_mime_type  s   	r  c                 C   sT   | j jtddtdd}|jdd}dd tD }||v s J t|jts(J d S )	Nr  r^   r   r8   "r   c                 S   r  r2   r  r  r2   r2   r3   r    r  z7test_enum_schema_with_json_mime_type.<locals>.<setcomp>)r   r   r   r#   rG   replacer  r   )r   r   removed_quotesr  r2   r2   r3   $test_enum_schema_with_json_mime_type  s   	r  c                 C   sH   G dd dt }| jjtdd|dd}dd |D }|j|v s"J d S )	Nc                   @   r"   )zDtest_non_string_enum_schema_with_enum_mime_type.<locals>.IntegerEnumr   r   r         Nr)   r2   r2   r2   r3   IntegerEnum  r4   r  r  r  r   r8   c                 S   s   h | ]}t |jqS r2   )r  r  r  r2   r2   r3   r    s    zBtest_non_string_enum_schema_with_enum_mime_type.<locals>.<setcomp>)r   r   r   r   rG   )r   r  r   r  r2   r2   r3   /test_non_string_enum_schema_with_enum_mime_type  s   	r  c                 C   d   | j jtddg dddiddiddiddiddiddiddidddd	d
}t|jts0J d S )Nr2  r^   r<   r(  r)  r*  r+  r,  r-  r   r.   INTEGERr   requiredr   r   r   r8   r   r   r   r  r   r  r   r2   r2   r3   test_json_schema  $   
	r  c                 C   r  )Nr2  r^   )r<   r  r)  r*  r+  r,  r-  r   stringintegerr   r  r   r8   r  r   r2   r2   r3    test_json_schema_with_lower_enum(  r  r  c                 C   s   | j jtddddddgdddd	d
dddddddddddgddgdddddddddddddgddgdgddiddd}t|jtsNJ d|jv sUJ t|jd ts_J d|jd d v sjJ d S ) NGive me a fruit basket.r^   r   Fruit Basket-A structured representation of a fruit basketfruitARRAY*An ordered list of the fruit in the basketzA piece of fruitAppleDescribes an appler.   zAlways 'apple'r   rA  z$The color of the apple (e.g., 'red'))r   colorr   r  r'  rA  r   r   property_orderingr  OrangeDescribes an orangezAlways 'orange'z'The size of the orange (e.g., 'medium'))r   sizer  )rA  any_ofr   rA  items)r   r'  rA  r  r   r   r8   r   )r   r   r   r  r   r  rV  r   r2   r2   r3   test_json_schema_with_any_ofH  sb   Br  c                 C   s"  t jt jjdddt jt jjdt jt jddt jjt jt jjddt jt jjd	dd
ddgddgdt jddt jjt jt jjddt jt jjddd
ddgddgdgddidgd}| jjtdt j	d|dd}t
|jtssJ d|jv szJ t
|jd tsJ d|jd d v sJ d S )Nr  r  r  r  r  r   zAlways "apple"r  z+The variety of apple (e.g., "Granny Smith"))r   varietyr   r  r  r  r  zAlways "orange"z+The variety of orange (e.g.,"Navel orange"))r  r	  )r   r'  rA  r   r  r  r^   r   r8   r   )r   r  Typer   r  r.   r   r   r   r   r  r   r  rV  )r   r   r   r2   r2   r3   test_schema_with_any_of  sh   &,r  c                 C   sr   t | tj( | jjdtdtj	dgtj
tjtjtdddddd	 W d    d S 1 s2w   Y  d S )
Nz?gemini-2.5-flash-preview-tts-voice-replication-rev22-2025-10-28r   r   z	audio/wav)voice_sample_audior   )replicated_voice_configr   r   r8   )r   r   r   r  r   r   t
t_contentsr   r   SpeechConfigVoiceConfigReplicatedVoiceConfigaudio_bytesr   r2   r2   r3   test_replicated_voice_config  s&   "r  c                 C   sr   | j jtddddiddiddiddiddiddiddidddd	d
}|D ]}|j}|D ]}|js5J q.q'd S )Nr2  r^   r   r.   r  r  r   )r   r   r   r8   )r   r   r   rJ   rG   )r   r   rrJ   pr2   r2   r3   test_json_schema_with_streaming  s,   	r  c                 C   sP   G dd dt }| jjtdd|dd}|D ]}|j}|D ]}|js$J qqd S )Nc                   @   r&  )	z8test_pydantic_schema_with_streaming.<locals>.CountryInfor<   r(  r)  r*  r+  r,  r-  Nr.  r2   r2   r2   r3   r1    r  r1  r2  r^   r   r8   )r   r   r   r   rJ   rG   )r   r1  r   r  rJ   r  r2   r2   r3   #test_pydantic_schema_with_streaming  s   		r  c                 C   r  )Nc                   @   *   e Zd ZU eed< eed< ee ed< dS )z"test_schema_from_json.<locals>.FoobarbazquxNr  r2   r2   r2   r3   Foo     
 r   Fill in the Foo.r^   r   r8   r  )r   r   r  r   r2   r2   r3   test_schema_from_json  s   	r#  c                 C   s:   G dd dt }| jjtdtjd| dd}|j d S )Nc                   @   r  )z*test_schema_from_model_schema.<locals>.Foor  r  r  Nr  r2   r2   r2   r3   r   .  r!  r   r"  r^   r   r8   )r   r   r   r   r   r   rN  rG   )r   r   r   r2   r2   r3   test_schema_from_model_schema,  s   
	r$  c                 C   s   G dd dt }| jr | jjtdtjd|dd}|jsJ d S t	t
}| jjtdtjd|dd W d    n1 s>w   Y  dt|v sKJ d S )Nc                   @   s.   e Zd ZU eed< eed< eeef ed< dS )z3test_schema_with_additional_properties.<locals>.Foor  r  r  N)r*   r+   r,   r  r/  r0  r  r2   r2   r2   r3   r   A  s   
 r   r6   r^   r   r8   z8additionalProperties is not supported in the Gemini API.)r   r   r   r   r   r   r   rG   r  r  r  r  )r   r   r   r  r2   r2   r3   &test_schema_with_additional_properties?  s,   	r%  c                 C   s<   dt dt fdd}| jjtdd|gid}d|jv sJ d S )	Nr=  returnc                 S   s   d|  dS )zReturns the weather in a city.zThe weather in z is sunny and 100 degrees.r2   )r=  r2   r2   r3   get_weather^  s   z"test_function.<locals>.get_weatherzEWhat is the weather like in Sunnyvale? Answer in very short sentence.rs   r8   100)r  r   r   r   rG   )r   r'  r   r2   r2   r3   test_function]  s   
r)  c                 C   sd   t t}| jjtdddid W d    n1 sw   Y  dt|v s(J dt|v s0J d S )NzWhat is your nameinput_that_does_not_existwhat_ever_valuer8   zExtra inputs are not permitted)r  r  r   r   r   r   r  rm  r2   r2   r3   &test_invalid_input_without_transformero  s   r,  c                 C   sT   t t}| jjtddid W d    n1 sw   Y  dt|jv s(J d S Ninvalid_keyinvalid_valuerA   r  r  r   r   r   r   r  r  rm  r2   r2   r3   (test_invalid_input_with_transformer_dict|  s   r1  c                 C   sV   t t}| jjtddigd W d    n1 sw   Y  dt|jv s)J d S r-  r0  rm  r2   r2   r3   (test_invalid_input_with_transformer_list  s   r2  c                 C   sN   t t}| jjddd W d    n1 sw   Y  dt|v s%J d S )Nr  r6   rA   r9   )r  r  r   r   r   r  rm  r2   r2   r3   'test_invalid_input_for_simple_parameter  s   r3  c              
   C   s   z| j jtdddgid W d S  tjyA } z%d|jv r#|jd }n|j}|d dks.J |d d	ks6J W Y d }~d S d }~ww )
Nr6   r   AUDIOr8   errorr  r   statusINVALID_ARGUMENT)r   r   r   r   r  details)r   r  r8  r2   r2   r3   (test_catch_stack_trace_in_error_handling  s   
r9  c                 C   sx   G dd dt }| jjtddgdt| dd}d|jv sJ d	|jv s&J d|jd
 jv s0J d	|jd jv s:J d S )Nc                   @   r;  )z/test_multiple_strings.<locals>.SummaryResponsessummarypersonNr>  r2   r2   r2   r3   SummaryResponses  r@  r<  4Summarize Shakespeare's life work in a few sentencesSummarize Hemingway's life workr^   r   r8   Shakespeare	Hemingwayr   r   )r   r   r   r   rV  rG   r   r;  r   r<  r   r2   r2   r3   test_multiple_strings  s   rB  c                 C   s   G dd dt }| jjttjddtjddgdt| dd}d	|jv s'J d
|jv s.J d	|jd j	v s8J d
|jd j	v sBJ d S )Nc                   @   r;  )z-test_multiple_parts.<locals>.SummaryResponsesr:  r;  Nr>  r2   r2   r2   r3   r<    r@  r<  r=  rF   r>  r^   r   r8   r?  r@  r   r   )
r   r   r   r   r   PartrV  rG   r   r;  rA  r2   r2   r3   test_multiple_parts  s    
rD  c                 C   s  | j jtddtjjdddidtjjddd	idtjjdd
didtjjdd
didgtjtjtj	ddtj
tjjdtj
tjjdiddtj	ddtj
tjjdtj
tjjdiddgdgdd}d|jv skJ d|jv srJ d|jv syJ d|jv sJ d S )NzWhat is the weather in Boston?z What is the stock price of GOOG?r'  locationBoston)r<   argsget_stock_pricer  GOOGr   zIt is sunny and 100 degrees.)r<   r   zThe stock price is $100.zGet the weather in a city.)r   r   )r<   rA  r=   z Get the stock price of a symbol.)function_declarationsrr   r8   sunnyz100 degreesz$100)r   r   r   r   rC  from_function_callfrom_function_responser   ToolFunctionDeclarationr  r  r   r.   rG   r   r2   r2   r3   test_multiple_function_calls  sl   8rP  c                 C   s   dt jjtddg}| jjt|d}|j}|jsJ |j	sJ t
dd |j	D }|dgks0J t|j	d jt js<J |jsAJ |jsFJ t
d	d |jD }|d
dgksXJ d S )NzHello world.	image/pngdatar   rA   c                 S      g | ]}|j jqS r2   modalityr<   r  dr2   r2   r3   
<listcomp>8	      z2test_usage_metadata_part_types.<locals>.<listcomp>r   r   c                 S   rT  r2   rU  rW  r2   r2   r3   rY  A	  rZ  r   )r   rC  
from_bytesimage_bytesr   r   r   usage_metadatacandidates_token_countcandidates_tokens_detailssortedr  rV  MediaModalityprompt_token_countprompt_tokens_details)r   r:   r   r]  
modalitiesr2   r2   r3   test_usage_metadata_part_types'	  s2   



re  c              
   C   s   | j rd S z*| jjttjdtjjtddtjj	ddgdgtj
ddd	gd
ddD ]}q*W d S  tjyJ } z|jdks?J W Y d }~d S d }~ww NrE   rQ  rR  Make sky more beautiful.rF   rH   
text/plainr   r   make the sky more beautiful.re   r   rT   r8   zFDeveloper instruction is not enabled for models/gemini-2.5-flash-image)r   r   r   r   r   ContentrC  r[  r\  	from_textr   r   r  message)r   r   r  r2   r2   r3   test_error_handling_streamF	  s8   
rn  c              
   C   s   | j rd S z'| jjttjdtjjtddtjj	ddgdgtj
ddd	gd
dd W d S  tjyG } z|jdks<J W Y d }~d S d }~ww rf  )r   r   r   r   r   rk  rC  r[  r\  rl  r   r   r  rm  rm  r2   r2   r3   test_error_handling_unaryh	  s4   ro  c                 C   sP   | j jtdtjdddiidd}| jr |jjtjj	ksJ d S |jjr&J d S )NzWhat is 1 + 1?r    zX-Vertex-AI-LLM-Request-Type	dedicated)r7   r8   )
r   r   r   r   r   r   r]  traffic_typeTrafficTypePROVISIONED_THROUGHPUTr   r2   r2   r3   !test_provisioned_output_dedicated	  s   
rt  c              
      s   | j rd S z+| jjjttjdtjjt	ddtjj
ddgdgtjddd	gd
ddI d H  W d S  tjyL } z|jdksAJ W Y d }~d S d }~ww rf  )r   r   r   r   r   r   rk  rC  r[  r\  rl  r   r   r  rm  rm  r2   r2   r3   test_error_handling_unary_async	  s6   ru  c              
      s   | j rd S z3| jjjttjdtjjt	ddtjj
ddgdgtjddd	gd
ddI d H 2 z3 d H W }q/6 W d S  tjyT } zd|jv sIJ W Y d }~d S d }~ww )NrE   rQ  rR  rg  rF   rH   rh  r   r   ri  rj  r8   z$Developer instruction is not enabled)r   r   r   r   r   r   rk  rC  r[  r\  rl  r   r   r  rm  )r   r   r  r2   r2   r3    test_error_handling_stream_async	  s6   rv  )ospathlibpydanticr   r   r   r   typingr   r   r   r	   r
   r   r  rT  r  sysr   r   r  r   r   r   enumr   r   r   r   Path__file__parentIMAGE_PNG_FILE_PATH
read_bytesr\  AUDIO_WAV_FILE_PATHr  safety_settings_with_methodr   r#   TestTableItem_GenerateContentParametersr  rk  rC  	t_contentr   rN  GoogleSearchIntervalfromisoformatPhishBlockThresholdr   EnterpriseWebSearchr  r  PrebuiltVoiceConfigMultiSpeakerVoiceConfigSpeakerVoiceConfigFileDatar   rV  r/  setupglobals
pytestmarkpytest_pluginsr   r   markasyncior   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r$  r5  rO  r[  r\  re  rf  rg  rl  rn  skipifversion_infor{  r|  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r$  r%  r)  r,  r1  r2  r3  r9  rB  rD  rP  re  rn  ro  rt  ru  rv  r2   r2   r2   r3   <module>   s  
(
1?HT
_pz       &  8  O  `  q           #    6    X           
      '      ;      D      M      V      e      w	

	





##



(  I;			!?"!!