
    UEjy                       d Z ddlmZ ddlmZmZmZmZmZm	Z	m
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mZmZmZmZm Z m!Z! ddl"m#Z#m$Z$ ddl%mZ ddl&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z. ddl,m/Z0 eZ e1ddh      Z2 ed      Z3d<dZ4d<dZ5	 	 	 	 d=dZ6d>dZ7 G d d      Z8d?dZ9dZ:dZ;dZ<dZ=dZ>d@d Z?	 dA	 	 	 	 	 dBd!Z@	 dA	 	 	 	 	 dCd"ZA G d# d$e      ZB G d% d&e      ZC G d' d(e0      ZD G d) d*e.      ZE G d+ d,e      ZF G d- d.e      ZGdDd/ZHdEd0ZIdFd1ZJdGd2ZK e1d3 ej                  ej                  fD              ZNd4ZOdHd5ZPdId6ZQdId7ZRdJd8ZSdAdKd9ZTdLd:ZUdMd;ZVy)NzKHelpers for embedding the generated NextGen SDK in the Google GenAI client.    )annotations)TYPE_CHECKINGAnyMappingOptionalTypeVarUnioncastN   )GOOGLE_GENAI_API_REVISIONGoogleGenAISecurityProvider)AsyncAgents)Agents)AsyncInteractions)Interactions)_AsyncRawResponseAccessorProxy_RawResponseAccessorProxyasync_wrap_sdk_call	is_streamwrap_async_stream_errorswrap_sdk_callwrap_stream_errors)
AsyncGenAIGenAI)interactions)Security)BackoffStrategyRetryConfigeventstreaming)AsyncWebhooks)Webhookszlyria-3-pro-previewzlyria-3-clip-previewModelTc                |    | j                   j                  }|st        d      t        |      j	                  d      S )z?Returns the server URL from the parent Google GenAI API client.zBase URL must be set./)_http_optionsbase_url
ValueErrorstrrstrip)
api_client
server_urls     U/var/www/html/qr/venv/lib/python3.12/site-packages/google/genai/_gaos/google_genai.pyget_google_genai_server_urlr-   <   s7    ))22J011z?!!#&&    c                    | j                   j                  xs d}| j                  r6| j                  r*| j                  r| d| j                   d| j                   S |S )z@Returns the generated path parameter for the parent client mode. z
/projects/z/locations/)r%   api_versionvertexaiprojectlocation)r*   r1   s     r,   get_google_genai_api_versionr5   D   sc    **66<"Kz11j6I6Im:j&8&8%9*--.0	
 r.   c                L    | j                   j                  }|rt        |      S d S N)r%   headersdict)r*   r8   s     r,   !_get_google_genai_default_headersr:   O   s&     &&..G#4=--r.   c                6    t        | dd       }t        |dd       S )N_credentialsquota_project_id)getattr)r*   credentialss     r,   _get_google_genai_user_projectr@   V   s     *nd;K; 2D99r.   c                      e Zd ZddZddZy)_GoogleGenAIAccessTokenProviderc                    || _         y r7   )_api_client)selfr*   s     r,   __init__z(_GoogleGenAIAccessTokenProvider.__init__\   s
    %r.   c                6    | j                   j                         S r7   )rD   _access_token)rE   s    r,   __call__z(_GoogleGenAIAccessTokenProvider.__call___   s    --//r.   N)r*   r   returnNone)rJ   r(   )__name__
__module____qualname__rF   rI    r.   r,   rB   rB   [   s    &0r.   rB   c                    t        |       }| j                  rt        | j                  |      S | j                  r.| j                  s| j
                  rt        t        |       |      S |rt        |      S y )N)api_keydefault_headers)access_tokenrR   )rR   )r:   rQ   r   r2   r3   r4   r   rB   )r*   rR   s     r,   _get_google_genai_securityrT   c   st    7
CO&&+
 	

 
 2 2j6I6I*8D+
 	

 88r.      i  i@  i0u  c           
     :   t        | dd      }|t        |dd      nd}||nt        dz   }t        }t        }t        }d}d}||j
                  t        |j
                  dz        }|j                  t        |j                  dz        }|j                  |j                  }|j                  t        |j                  dz        }|j                  r"|j                  D 	cg c]  }	t        |	       }}	t        dt        |||t        |      d||	      S c c}	w )
al  Maps parent `HttpOptions.retry_options` onto a `RetryConfig`.

    `attempts` becomes the retry count (an unset `attempts` falls back to the
    default retry count). The delay-shaping options (`initial_delay`,
    `max_delay`, `exp_base`, `jitter`) and `http_status_codes` are honored when
    provided, each defaulting to the built-in behavior when omitted.
    retry_optionsNattemptsr   i  zattempt-count-backoff)	jitter_msT)max_retriesstatus_codes_override)r>   _DEFAULT_MAX_RETRIES_DEFAULT_INITIAL_INTERVAL_MS_DEFAULT_MAX_INTERVAL_MS_DEFAULT_EXPONENTinitial_delayint	max_delayexp_basejitterhttp_status_codesr(   r   r   _MAX_ELAPSED_TIME_MS)
http_optionsoptionsrX   rZ   initial_intervalmax_intervalexponentrY   r[   codes
             r,   _translate_retry_configrm      s0    lOT:G5<5Hww
D1dH&2(8Lq8PK3+L HI   ,"7#8#84#?@(w00478L'''H>>%GNNT12I$$;B;T;T$U4SY$U!$U 	
 	3  %Vs   "Dc                    | j                   }t        t        |       |xs t        |       t	        |       t        |       t        | dd      |j                  t        |            }|S )?Builds a generated NextGen client from the parent GenAI client._httpx_clientN)securityr1   user_projectr+   client
timeout_msretry_config)	r%   r   rT   r5   r@   r-   r>   timeoutrm   r*   r1   rg   sdks       r,   build_google_genai_clientry      sc     ++L
+J7K#?
#K3J?.z:z?D9'',\:C Jr.   c                    | j                   }t        t        |       |xs t        |       t	        |       t        |       t        | dd      |j                  t        |            }|S )ro   _async_httpx_clientN)rq   r1   rr   r+   async_clientrt   ru   )	r%   r   rT   r5   r@   r-   r>   rv   rm   rw   s       r,   build_google_genai_async_clientr}      sd     ++L
+J7K#?
#K3J?.z:Z)>E'',\:C Jr.   c                  >    e Zd ZdZd fdZese fd       Ze fd       Zesddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ	es dddddddd		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fd
Z
esddddd	 	 	 	 	 	 	 	 	 	 	 d fdZesddddd	 	 	 	 	 	 	 	 	 	 	 d fdZ xZS  xZS )GeminiNextGenInteractionsa  Public interactions resource backed by the NextGen client.

    Subclasses the generated resource so newly generated methods (and the
    raw/streaming response wrappers) are exposed automatically. Only the
    methods that need legacy input/output normalization are overridden.

    Each override sits inside `if not TYPE_CHECKING:` so static type checkers
    see the inherited generated signature (full overload sets) rather than the
    runtime stub here.
    c                R    t        |      }t        | 	  |j                  |       y N)
parent_refry   superrF   sdk_configurationrE   r*   rx   	__class__s      r,   rF   z"GeminiNextGenInteractions.__init__   %    '
3..3?r.   c                *    t        t        |         S r7   r   r   with_raw_responserE   r   s    r,   r   z+GeminiNextGenInteractions.with_raw_response       ,UW-FGGr.   c                *    t        t        |         S r7   r   r   with_streaming_responser   s    r,   r   z1GeminiNextGenInteractions.with_streaming_response       ,UW-LMMr.   Nrequestr1   extra_headersextra_query
extra_bodyrv   c          	        |[|rt        t              t        |      }t        t        
|   ||||||      }	|rt        |	      rt        |	      S |	S t        |	      S t        |j                  d      d      }t        |      }t        t        
|   fd|it        t        |      ||||d}	|rt        |	      rt        |	      S |	S t        |	      S Nr   streamFdefaultr1   )r   r   r   rv   )	TypeError_REQUEST_AND_BODY_ERROR_request_streamr   r   creater   r   %_add_output_properties_if_interaction_optional_boolget_normalize_create_bodyr
   r   rE   r   r1   r   r   r   rv   bodyr   responser   s             r,   r   z GeminiNextGenInteractions.create   s     "#$;<<(1(GN# +"/ +)#  *1(;;#O<XFF#DHHX$6FF)$/D$' sD/ ,'%H X&-h778BBr.   Fr1   include_inputlast_event_idr   r   r   rv   c               X   t        t        |d            }	t        t        |   ||t        |      t        |      |	|||	      }
|	rAt        |
      s|
S t        t        j                  t        j                     t        |
            S t        t        j                  t        |
            S NFr   )idr1   r   r   r   r   r   rv   )boolr   r   r   r   _optional_strr   r
   r   Streamr   InteractionSSEEventr   Interactionr   rE   r   r1   r   r   r   r   r   rv   stream_boolr   r   s              r,   r   zGeminiNextGenInteractions.get   s     ~feDEK$',];+M:"+'
H  *#O")),*J*JK&x0  ((*OPX*Y r.   r1   r   r   rv   c               x    t        t        j                  t        t	        t
        |   |||||                  S N)r   r1   r   r   rv   )r
   r   r   r   r   r   cancelrE   r   r1   r   r   rv   r   s         r,   r   z GeminiNextGenInteractions.cancelG  sA     ((5!$/&3$/ '	 r.   c               6    t        t        |   |||||      S r   r   r   deleter   s         r,   r   z GeminiNextGenInteractions.delete_  s(     !'+' r.   r*   r   )r   r   r1   Optional[str]r   Optional[Mapping[str, str]]r   Optional[Mapping[str, Any]]r   r   rv   %Optional[Union[float, httpx.Timeout]]r   r   rJ   XUnion[interactions.Interaction, eventstreaming.Stream[interactions.InteractionSSEEvent]])r   r(   r1   r   r   r   r   r   r   r   r   r   r   r   rv   r   rJ   r   r   r(   r1   r   r   r   r   r   rv   r   rJ   zinteractions.Interactionr   r(   r1   r   r   r   r   r   rv   r   rJ   r   rL   rM   rN   __doc__rF   r   propertyr   r   r   r   r   r   __classcell__r   s   @r,   r   r      s   	@ 		H 
	H 
	N 
	N   )-9=7;6:=A0	C 0	C '	0	C
 70	C 50	C 40	C ;0	C 0	C
0	Cf 
 *.!%!%9=7;=A$	$	 '	$	
 $	 $	 $	 7$	 5$	 ;$	
$	L 
 *.9=7;=A		 '		
 7	 5	 ;	 &	. 
 *.9=7;=A		 '		
 7	 5	 ;	 	 	 r.   r   c                  >    e Zd ZdZd fdZese fd       Ze fd       Zesddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ	es dddddddd		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fd
Z
esddddd	 	 	 	 	 	 	 	 	 	 	 d fdZesddddd	 	 	 	 	 	 	 	 	 	 	 d fdZ xZS  xZS )AsyncGeminiNextGenInteractionsz@Async public interactions resource backed by the NextGen client.c                R    t        |      }t        | 	  |j                  |       y r   r}   r   rF   r   r   s      r,   rF   z'AsyncGeminiNextGenInteractions.__init__u  %    -j9..3?r.   c                *    t        t        |         S r7   r   r   r   r   s    r,   r   z0AsyncGeminiNextGenInteractions.with_raw_responsez      1%'2KLLr.   c                *    t        t        |         S r7   r   r   r   r   s    r,   r   z6AsyncGeminiNextGenInteractions.with_streaming_response~      1%'2QRRr.   Nr   c          	       K   |c|rt        t              t        |      }t        t        
|   ||||||       d {   }	|rt        |	      rt        |	      S |	S t        |	      S t        |j                  d      d      }t        |      }t        t        
|   fd|it        t        |      ||||d d {   }	|rt        |	      rt        |	      S |	S t        |	      S 7 7 +wr   )r   r   r   r   r   r   r   r   r   r   r   r   r
   r   r   s             r,   r   z%AsyncGeminiNextGenInteractions.create  s     "#$;<<(1!4GN# +"/ +)#"   *7AA#O<XFF#DHHX$6FF)$/D0' sD/ ,'% H X&3H==8BB="s#   <C,C( A>C,>C*?*C,*C,Fr   c               t  K   t        t        |d            }	t        t        |   ||t        |      t        |      |	|||	       d {   }
|	rAt        |
      s|
S t        t        j                  t        j                     t        |
            S t        t        j                  t        |
            S 7 jwr   )r   r   r   r   r   r   r   r
   r   AsyncStreamr   r   r   r   r   r   s              r,   r   z"AsyncGeminiNextGenInteractions.get  s      ~feDEK0',];+M:"+'
 
H  *#O"..|/O/OP,X6  ((*OPX*Y %
s   AB8B6A+B8r   c                  K   t        t        j                  t        t	        t
        |   |||||       d {               S 7 wr   )r
   r   r   r   r   r   r   r   s         r,   r   z%AsyncGeminiNextGenInteractions.cancel  sO      ((5-$/&3$/ ' 	 s   6AAAc               R   K   t        t        |   |||||       d {   S 7 wr   r   r   r   r   s         r,   r   z%AsyncGeminiNextGenInteractions.delete  s6      -'+'   s   '%'r   )r   r   r1   r   r   r   r   r   r   r   rv   r   r   r   rJ   ]Union[interactions.Interaction, eventstreaming.AsyncStream[interactions.InteractionSSEEvent]])r   r(   r1   r   r   r   r   r   r   r   r   r   r   r   rv   r   rJ   r   r   r   r   r   s   @r,   r   r   r  s   J@ 		M 
	M 
	S 
	S   )-9=7;6:=A0	C 0	C '	0	C
 70	C 50	C 40	C ;0	C 0	C
0	Cf 
 *.!%!%9=7;=A$	$	 '	$	
 $	 $	 $	 7$	 5$	 ;$	
$	L 
 *.9=7;=A		 '		
 7	 5	 ;	 &	. 
 *.9=7;=A		 '		
 7	 5	 ;	 	 	 r.   r   c                       e Zd ZdZd fdZesBe fd       Ze fd       Zd fdZ	d fdZ
d fdZd fdZd fd	Zd fd
Zd fdZ xZS  xZS )GeminiNextGenWebhooksa8  Public webhooks resource backed by the NextGen client.

    Subclasses the generated resource so every public method is wrapped in
    `wrap_sdk_call`, translating per-operation `GenAiError` raises into the
    status-code `APIError` hierarchy exposed at the
    `google.genai._interactions` import surface.
    c                R    t        |      }t        | 	  |j                  |       y r   r   r   s      r,   rF   zGeminiNextGenWebhooks.__init__  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z'GeminiNextGenWebhooks.with_raw_response  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z-GeminiNextGenWebhooks.with_streaming_response  r   r.   c                2    t        t        |   g|i |S r7   r   r   r   rE   argskwargsr   s      r,   r   zGeminiNextGenWebhooks.create        A$A&AAr.   c                2    t        t        |   g|i |S r7   r   r   listr   s      r,   r   zGeminiNextGenWebhooks.list#       ????r.   c                2    t        t        |   g|i |S r7   r   r   r   r   s      r,   r   zGeminiNextGenWebhooks.get&       >t>v>>r.   c                2    t        t        |   g|i |S r7   )r   r   updater   s      r,   r   zGeminiNextGenWebhooks.update)  r   r.   c                2    t        t        |   g|i |S r7   r   r   s      r,   r   zGeminiNextGenWebhooks.delete,  r   r.   c                2    t        t        |   g|i |S r7   )r   r   rotate_signing_secretr   s      r,   r   z+GeminiNextGenWebhooks.rotate_signing_secret/  s     !>PPPPr.   c                2    t        t        |   g|i |S r7   )r   r   pingr   s      r,   r   zGeminiNextGenWebhooks.ping2  r   r.   r   r   r   r   r   rJ   r   rL   rM   rN   r   rF   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r,   r   r   
  sq    @ 		H 
	H 
	N 
	N	B	@	?	B	B	Q	@ 	@7 r.   r   c                       e Zd ZdZd fdZesBe fd       Ze fd       Zd fdZ	d fdZ
d fdZd fdZd fd	Zd fd
Zd fdZ xZS  xZS )AsyncGeminiNextGenWebhooksz<Async public webhooks resource backed by the NextGen client.c                R    t        |      }t        | 	  |j                  |       y r   r   r   s      r,   rF   z#AsyncGeminiNextGenWebhooks.__init__9  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z,AsyncGeminiNextGenWebhooks.with_raw_response>  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z2AsyncGeminiNextGenWebhooks.with_streaming_responseB  r   r.   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   r   r   s      r,   r   z!AsyncGeminiNextGenWebhooks.createF  &     ,UW^MdMfMMMM   %#%c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   r   r   s      r,   r   zAsyncGeminiNextGenWebhooks.listI  &     ,UW\KDKFKKKKr   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   r   r   s      r,   r   zAsyncGeminiNextGenWebhooks.getL  &     ,UW[J4J6JJJJr   c                N   K   t        t        |   g|i | d {   S 7 wr7   )r   r   r   r   s      r,   r   z!AsyncGeminiNextGenWebhooks.updateO  r   r   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   s      r,   r   z!AsyncGeminiNextGenWebhooks.deleteR  r   r   c                N   K   t        t        |   g|i | d {   S 7 wr7   )r   r   r   r   s      r,   r   z0AsyncGeminiNextGenWebhooks.rotate_signing_secretU  s6     ,-048>   r   c                N   K   t        t        |   g|i | d {   S 7 wr7   )r   r   r   r   s      r,   r   zAsyncGeminiNextGenWebhooks.pingZ  r  r   r   r   r   r   s   @r,   r   r   6  so    F@ 		M 
	M 
	S 
	S	N	L	K	N	N	
	L 	L; r.   r   c                       e Zd ZdZd	 fdZes0e fd       Ze fd       Zd
 fdZ	d
 fdZ
d
 fdZd
 fdZ xZS  xZS )GeminiNextGenAgentsa6  Public agents resource backed by the NextGen client.

    Subclasses the generated resource so every public method is wrapped in
    `wrap_sdk_call`, translating per-operation `GenAiError` raises into the
    status-code `APIError` hierarchy exposed at the
    `google.genai._interactions` import surface.
    c                R    t        |      }t        | 	  |j                  |       y r   r   r   s      r,   rF   zGeminiNextGenAgents.__init__g  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z%GeminiNextGenAgents.with_raw_responsel  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z+GeminiNextGenAgents.with_streaming_responsep  r   r.   c                2    t        t        |   g|i |S r7   r   r   s      r,   r   zGeminiNextGenAgents.createt  r   r.   c                2    t        t        |   g|i |S r7   r   r   s      r,   r   zGeminiNextGenAgents.listw  r   r.   c                2    t        t        |   g|i |S r7   r   r   s      r,   r   zGeminiNextGenAgents.getz  r   r.   c                2    t        t        |   g|i |S r7   r   r   s      r,   r   zGeminiNextGenAgents.delete}  r   r.   r   r   rL   rM   rN   r   rF   r   r   r   r   r   r   r   r   r   r   s   @r,   r
  r
  ^  s_    @ 		H 
	H 
	N 
	N	B	@	?	B 	B% r.   r
  c                       e Zd ZdZd	 fdZes0e fd       Ze fd       Zd
 fdZ	d
 fdZ
d
 fdZd
 fdZ xZS  xZS )AsyncGeminiNextGenAgentsz:Async public agents resource backed by the NextGen client.c                R    t        |      }t        | 	  |j                  |       y r   r   r   s      r,   rF   z!AsyncGeminiNextGenAgents.__init__  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z*AsyncGeminiNextGenAgents.with_raw_response  r   r.   c                *    t        t        |         S r7   r   r   s    r,   r   z0AsyncGeminiNextGenAgents.with_streaming_response  r   r.   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   s      r,   r   zAsyncGeminiNextGenAgents.create  r   r   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   s      r,   r   zAsyncGeminiNextGenAgents.list  r  r   c                N   K   t        t        |   g|i | d {   S 7 wr7   r  r   s      r,   r   zAsyncGeminiNextGenAgents.get  r  r   c                N   K   t        t        |   g|i | d {   S 7 wr7   r   r   s      r,   r   zAsyncGeminiNextGenAgents.delete  r   r   r   r   r  r   s   @r,   r  r    s^    D@ 		M 
	M 
	S 
	S	N	L	K	N 	N% r.   r  c                   t        |       }|| S t        |d      }t        |      }|s| S t        |d      r|j	                  |      S t        |t              ri ||S |j                         D ]  \  }}t        |||        |S )Nsteps
model_copyr   )	_normalize_interaction_shape
_get_value_output_properties_from_stepshasattrr  
isinstancer9   itemssetattr)value
normalizedr  updatesnameoutput_values         r,   r   r     s    -e4Jz7+E+E2Gz<($$G$44*d#(*(((%mmo 0l
D,/0r.   c                   t        | d      }t        |t              r| S t        | d      }t        |t              r|t        vry t        | d      }t        |t              sg }|rd|dgng }t        | d      r| j                  |d d      S t        | t              ri | d|i}|j                  dd        |S t        | d|       t        | d      rt        | dd        | S )	Nr  modeloutputsmodel_outputtypecontentr  )r  r.  r  )
r!  r$  r   r(   _LEGACY_LYRIA_MODELSr#  r  r9   popr&  )r'  r  r-  r.  r(  s        r,   r   r     s    ug&E%ug&EeS!U2F%F	*Ggt$>En9:2Eul#4'HII%..w.
y$'E7E"ui y$'Lr.   c                   g }d}t        |       D ]  }t        |d      dk(  r nt        |d      dk7  r|r n(t        |d      }t        |t              s|r n`Id}t        |      D ]I  }t        |d      dk(  r2d}t        |d      }|j	                  t        |t
              r|nd       D|sGd} n |s n i }dj                  t        |            }	|	r|	|d	<   d }
d }d }t        |       D ]y  }t        |d      dk(  r nht        |d      dk7  r$t        |d      }t        |t              sAt        |      D ]+  }t        |d      }|d
k(  r|
|}
|dk(  r||}|dk(  s'|*|}- { |
|
|d<   |||d<   |||d<   |S )NFr1  
user_inputr/  r2  textTr0   output_textimageaudiovideooutput_imageoutput_audiooutput_video)reversedr!  r$  r   appendr(   join)r  
text_parts
collectingstepr2  should_stopitemr7  r)  r8  r<  r=  r>  content_types                 r,   r"  r"    s   JJ dF#|3dF#~5T9-'4(W% 	D$'61!
!$/!!*T3*?$RH"	 14 !G''(:./K!,LLL $dF#|3dF#~5T9-'4(W% 	$D%dF3Lw&<+?#w&<+?#w&<+?#	$$& ".".".Nr.   c                ^    t        | t              r| j                  |      S t        | |d       S r7   )r$  r9   r   r>   )r'  r*  s     r,   r!  r!    s)    %yy5$%%r.   c              #     K   | ]6  }|j                   j                         D ]  \  }}|j                  xs |  8 y wr7   )model_fieldsr%  alias).0r-  r*  fields       r,   	<genexpr>rN    sN       ))//1 	e 
KK4s   <>zScreate() accepts either request=... or individual body keyword arguments, not both.c                    t        |       t        z
  }|r)t        ddj                  t	        |            z   dz         | j                  d      }t        |      s| S i | dd|dgiS )Nz-create() got unexpected keyword argument(s): z, z<. Use extra_body=... to send additional request body fields.inputr6  r0  )set_CREATE_BODY_KEYSr   rA  sortedr   _is_content_list)r   unknowninput_values      r,   r   r   )  sy    $i++G;iiw()LM
 	
 ((7#KK(NdNG|LMNNr.   c                d    t        | t              xr t        |       xr t        d | D              S )Nc              3  2   K   | ]  }t        |        y wr7   )_is_content_block)rL  rF  s     r,   rN  z#_is_content_list.<locals>.<genexpr>=  s     :D!$':s   )r$  r   r   allr'  s    r,   rT  rT  9  s0    5$ 	;K	;:E::r.   c                >    t        | t              xr t        |        S r7   )r$  r9   _is_step_blockr[  s    r,   rY  rY  A  s    eT"@>%+@'@@r.   c                (    | j                  d      dv S )Nr1  >   thoughtr6  r/  function_callfunction_resultfile_search_callgoogle_maps_callurl_context_callfile_search_resultgoogle_maps_resultgoogle_search_callurl_context_resultcode_execution_callgoogle_search_resultmcp_server_tool_callcode_execution_resultmcp_server_tool_result)r   r[  s    r,   r]  r]  E  s    99V !  r.   c                *    t        | t              r| S |S r7   )r$  r   )r'  r   s     r,   r   r   [  s    %Nr.   c                (    t        | t              r| S y r7   )r$  r(   r[  s    r,   r   r   a  s    %r.   c                    t        | t              r| j                  d      nt        | dd       }t        |t              r|j                  d      nt        |dd       }t	        t        |d            S )Nr   r   Fr   )r$  r   r   r>   r   r   )r   r   r   s      r,   r   r   g  sl     gw' 	FWfd+ 	 dG$ 	T8T* 
 vu566r.   )r*   r   rJ   r(   )r*   r   rJ   zOptional[dict[str, str]])r*   r   rJ   r   )r*   r   rJ   Optional[Any])rg   r   rJ   r   r7   )r*   r   r1   r   rJ   r   )r*   r   r1   r   rJ   r   )r'  r   rJ   r   )r'  r   rJ   rq  )r  z	list[Any]rJ   dict[str, Any])r'  r   r*  r(   rJ   r   )r   rr  rJ   rr  )r'  r   rJ   r   )r'  rr  rJ   r   )r'  r   r   Optional[bool]rJ   rs  )r'  r   rJ   r   )r   r   rJ   r   )Wr   
__future__r   typingr   r   r   r   r   r	   r
   httpx_hooks.google_genai_authr   _GOOGLE_GENAI_API_REVISIONr   agentsr   GeneratedAsyncAgentsr   GeneratedAgentsr   r   GeneratedAsyncInteractionsr   GeneratedInteractionslib.compat_errorsr   r   r   r   r   r   r   rx   r   r   typestypes.securityr   utilsr   r   r   webhooksr    GeneratedAsyncWebhooksr!   GeneratedWebhooks	frozensetr3  r"   r-   r5   r:   r@   rB   rT   r\   r]   r^   r_   rf   rm   ry   r}   r   r   r   r   r
  r  r   r   r"  r!  CreateModelInteractionCreateAgentInteractionrR  r   r   rT  rY  r]  r   r   r   rO   r.   r,   <module>r     s  " R # N N N  8 - I ?   #  $ ? ? = 3 7  "79O!PQ 		'...:
0 0*    #    +^ 37"/
$ 37"/"^ 5 ^BU%? Up)@- )@X%L!7 %LP B/  BFN3 N:(6AH&   	++++   O A,7r.   