
    Oj                     0   S r SSKJrJrJrJr  SSKJrJrJ	r	  SSK
JrJr  SSKJrJrJrJr  SSKJrJr  SSKJrJr  SSKJr  S	S
KrS	SKJrJrJrJrJ r J!r!J"r"   " S S\5      r# " S S5      r$ " S S5      r% " S S\5      r& " S S5      r' " S S5      r(g
)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.   )errorsmodelstypesutils)AfterParseErrorContextHookContextResponseContext)AsyncBaseSDKBaseSDK)OptionalNullableUNSETagentsinteractions)agent	agenttool)get_security_from_envresponse_helpers)unmarshal_json_response    N)AnyIterableListMappingOptionalUnioncastc                   V   \ rS rSr\S 5       r\S 5       rSSSSSSSSSSSS.S\\   S\\   S\\   S	\\   S
\\   S\\	\
\R                     \
\R                     4      S\\	\R                  \R                   4      S\\\\4      S\\\\4      S\\\\4      S\\	\\R*                  4      S\R.                  4S jjrSSSSSSSS.S\\   S\\   S\\   S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R4                  4S jjrSSSSS.S\S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R.                  4S jjrSSSSS.S\S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R<                  4S jjrSr g)Agents   c                     [        U 5      $ N)AgentsWithRawResponseselfs    [/var/www/html/leaf-doctor-v1/venv/lib/python3.13/site-packages/google/genai/_gaos/agents.pywith_raw_responseAgents.with_raw_response   s    $T**    c                     [        U 5      $ r!   )AgentsWithStreamingResponser#   s    r%   with_streaming_responseAgents.with_streaming_response#   s    *400r(   Napi_versionid
base_agentsystem_instructiondescriptiontoolsbase_environmentextra_headersextra_query
extra_bodytimeoutr.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   returnc                L  ^
^ SnSn[         nSnUnU R                  U5      nUc  U R                  R                  nUb  UnOU R	                  X5      n[
        R                  " U[        R                  " UUUU[        R                  " U[        [        [        R                        5      [        R                  " U[        [        R                     5      S9S9m[        R                   " U5      u  nnU R#                  SSUUTSSSSSUU	[
        R$                  " U R                  R&                  R(                  S	9U R                  R*                  U
U4S
 jSUS9nU[         :X  ab  U R                  R,                  [         La  U R                  R,                  nO.[        R.                  " S[        R0                  " SSSS5      SSS9nSn[3        U[        R.                  5      (       a  U/ SQ4nS n[5        U R                  U=(       d    SSS[7        U R                  R*                  [8        R:                  5      [=        USS9S9nU R?                  UUS US:H  US9nUS:w  ak  US:X  a  [        R@                  O[        RB                  n[E        [F        U" UUSU [I        U5      U R                  RJ                  RM                  S5      S 95      $  U" U5      $ ! [N         aC  n[        RP                  " U R                  RJ                  S   [I        U5      UU5         SnAgSnAff = f)!  Creates a new Agent (Typed version for SDK).

:param api_version: Which version of the API to use.
:param id: The unique identifier for the agent.
:param base_agent: The base agent to extend.
:param system_instruction: System instruction for the agent.
:param description: Agent description for developers to quickly read and understand.
:param tools: The tools available to the agent.
:param base_environment: The environment configuration for the agent.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param extra_body: Additional JSON object fields to merge into request bodies.
:param timeout: Override the default request timeout configuration for this method in seconds
Nr/   r0   r1   r2   r3   r4   r.   bodyPOST/{api_version}/agentsT
user-agentapplication/jsonr.   c            	      f   > [         R                  " TR                  SSS[        R                  T S9$ NFjson)r7   r   serialize_request_bodyr>   r   Agentr7   requests   r%   <lambda>Agents.create.<locals>.<lambda>{   %    (D(DeUFFLLZ)r(   methodpathbase_urlurl_variablesrK   request_body_requiredrequest_has_path_paramsrequest_has_query_paramsuser_agent_headeraccept_header_valuehttp_headersextra_query_params_globalssecurityget_serialized_bodyallow_empty_value
timeout_msattempt-count-backoff  @     0u     max_retries4084094295XXc                    [         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      e
N4XX*zAPI error occurredrl   defaultrB   F)validatezUnexpected response receivedr   match_responsestream_to_textr   GenAiDefaultErrorr   r   rI   http_reshttp_res_texts     r%   _speakeasy_parse_response0Agents.create.<locals>._speakeasy_parse_response       ##HeS99 % 4 4X >..((  ##HeS99 % 4 4X >..((  ##Hi9KLL.v||XPUVV**+I8TTr(    CreateAgentsyncmode	executionconfigrR   operation_idoauth2_scopessecurity_sourceresponsec                 4    [         R                  " SS/U 5      $ Nro   rl   r   match_status_codescs    r%   rL   rM          5+C+CUENTU+Vr(   	streaminghook_ctxrK   is_error_status_codestreamretry_configparsedbuffered_hooksrawparserr   
client_refr   hooks))r   _coerce_timeout_mssdk_configurationr_   _get_urlr   CreateAgentRequestr   rI   r   get_pydantic_modelr   r   	AgentToolBaseEnvironmentr   consume_response_mode_build_requestCreateAgentGlobalsglobalsr.   r\   r   RetryConfigBackoffStrategy
isinstancer   r   r   Securityr	   
do_requestStreamedAPIResponseAPIResponser   r   r   __dict__get	Exceptionraise_parse_errorr$   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   rR   rS   retries
server_urlrY   r_   _speakeasy_response_modereqr   rz   _speakeasy_hook_ctxrx   _speakeasy_response_cls
parse_exc_rK   s             `               @r%   createAgents.create'   s)   H 7<
$,,W5
//::J!!H}}X=H++#%#5'..uhtFDTDT?U6VW!&!9!9$hv/E/E&F"	
 2B1W1W2
. , !!('"&$(%)* 2%*.. 22::FF ++44! #!+ " 
0 e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U  *))^&1&&// %*BfU	
 ??(!V+{:% # 
 $x/ ,{: !44%11 $
 ' 4##34GH0099==hG
 
	,X66 	..&&//9&':;	 	s   K 
L# 9LL#r.   	page_size
page_tokenparentr5   r6   r8   r   r   r   c                Z   SnSn	[         n
SnUnU R                  U5      nUc  U R                  R                  nUb  UnOU R	                  X5      n[
        R                  " UUUUS9n[        R                  " U5      u  pU R                  SSUU	USSSSSUU[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU
[         :X  ab  U R                  R                  [         La  U R                  R                  n
O.[        R                   " S[        R"                  " SSSS5      SSS9n
Sn[%        U
[        R                   5      (       a  U
/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9nUS:w  ak  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      S95      $  U" U5      $ ! [@         aC  n[        RB                  " U R                  R<                  S   [;        U5      UU5         SnAgSnAff = f) i  Lists all Agents.

:param api_version: Which version of the API to use.
:param page_size:
:param page_token:
:param parent:
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param timeout: Override the default request timeout configuration for this method in seconds
Nr.   r   r   r   GETr@   FTrA   rB   rC   rP   rQ   rR   rS   rK   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r^   r_   r`   ra   rb   rc   rd   re   rf   rh   c                    [         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      ern   )r   rt   ru   r   rv   r   r   AgentListResponserw   s     r%   rz   .Agents.list.<locals>._speakeasy_parse_response  s    ##HeS99 % 4 4X >..((  ##HeS99 % 4 4X >..((  ##Hi9KLL.,,h  **+I8TTr(   r}   
ListAgentsr   r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   Agents.list.<locals>.<lambda>=  r   r(   r   r   r   r   r   r   )"r   r   r   r_   r   r   ListAgentsRequestr   r   r   ListAgentsGlobalsr   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   r5   r6   r8   rR   rS   r   r   rY   r_   rK   r   r   r   rz   r   rx   r   r   s                          r%   listAgents.list   s   * 7<
$,,W5
//::J!!H}}X=H**#!	
 2B1W1W2
.  !!('"'$(%)* 2%*-- 22::FF ++44"!% " 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U$ *))^%1&&// %*BfU	
 ??(!V+{:% # 
 $x/ ,{: !44%11 $
 ' 4##34GH0099==hG
 
	,X66 	..&&//9&':;	 	s   I 
J*'9J%%J*r.   r5   r6   r8   c                V   SnSn[         nSn	Un
U R                  U5      nUc  U R                  R                  nU	b  U	nOU R	                  Xg5      n[
        R                  " UUS9n[        R                  " U
5      u  pU R                  SSUUUSSSSSU
U[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU[         :X  ab  U R                  R                  [         La  U R                  R                  nO.[        R                   " S[        R"                  " SSSS5      SSS9nSn[%        U[        R                   5      (       a  U/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9nUS:w  ak  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      S95      $  U" U5      $ ! [@         aC  n[        RB                  " U R                  R<                  S   [;        U5      UU5         SnAgSnAff = f) E  Gets a specific Agent.

:param id:
:param api_version: Which version of the API to use.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param timeout: Override the default request timeout configuration for this method in seconds
Nr.   r/   r   /{api_version}/agents/{id}FTrA   rB   rC   r   r`   ra   rb   rc   rd   re   rf   rh   c                    [         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      ern   rs   rw   s     r%   rz   -Agents.get.<locals>._speakeasy_parse_response  r|   r(   r}   GetAgentr   r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   Agents.get.<locals>.<lambda>  r   r(   r   r   r   r   r   r   )"r   r   r   r_   r   r   GetAgentRequestr   r   r   GetAgentGlobalsr   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.   r5   r6   r8   rR   rS   r   r   rY   r_   rK   r   r   r   rz   r   rx   r   r   s                        r%   r   
Agents.get\  s   " 7<
$,,W5
//::J!!H}}X=H((#

 2B1W1W2
.  !!-'"'$(%)* 2%*++ 22::FF ++44"!% " 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U  *))^#1&&// %*BfU	
 ??(!V+{:% # 
 $x/ ,{: !44%11 $
 ' 4##34GH0099==hG
 
	,X66 	..&&//9&':;	 	   I 
J(%9J##J(c                V   SnSn[         nSn	Un
U R                  U5      nUc  U R                  R                  nU	b  U	nOU R	                  Xg5      n[
        R                  " UUS9n[        R                  " U
5      u  pU R                  SSUUUSSSSSU
U[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU[         :X  ab  U R                  R                  [         La  U R                  R                  nO.[        R                   " S[        R"                  " SSSS5      SSS9nSn[%        U[        R                   5      (       a  U/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9nUS:w  ak  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      S95      $  U" U5      $ ! [@         aC  n[        RB                  " U R                  R<                  S   [;        U5      UU5         SnAgSnAff = f) @  Deletes an Agent.

:param id:
:param api_version: Which version of the API to use.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
:param timeout: Override the default request timeout configuration for this method in seconds
Nr   DELETEr   FTrA   rB   rC   r   r`   ra   rb   rc   rd   re   rf   rh   c                    [         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a-  [         R                  " U 5      n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      ern   )r   rt   ru   r   rv   r   r   Emptyrw   s     r%   rz   0Agents.delete.<locals>._speakeasy_parse_response.  s    ##HeS99 % 4 4X >..((  ##HeS99 % 4 4X >..((  ##Hi9KLL. &&5  **+I8TTr(   r}   DeleteAgentr   r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   Agents.delete.<locals>.<lambda>M  r   r(   r   r   r   r   r   r   )"r   r   r   r_   r   r   DeleteAgentRequestr   r   r   DeleteAgentGlobalsr   r.   r\   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   s                        r%   deleteAgents.delete  s   " 7<
$,,W5
//::J!!H}}X=H++#

 2B1W1W2
.  !!-'"'$(%)* 2%*.. 22::FF ++44"!% " 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U$ *))^&1&&// %*BfU	
 ??(!V+{:% # 
 $x/ ,{: !44%11 $
 ' 4##34GH0099==hG
 
	,X66 	..&&//9&':;	 	r    !__name__
__module____qualname____firstlineno__propertyr&   r+   r   strr   r   agents_agenttoolr   AgentToolParamagents_agentr   BaseEnvironmentParamr   r   floathttpxTimeoutr   rI   r   intr   r   r   r   r   r   __static_attributes__r   r(   r%   r   r      sW   + + 1 1 &* $(,0%)  5937269=)d c]d SM	d
 SMd %SMd c]d )334)889;
d #,..0Q0QQR
d"  S 12#d$ gc3h/0%d& WS#X./'d( %u}} 456)d* 
+dR &*#'$( $59379=M c]M C=	M
 SMM M  S 12M gc3h/0M %u}} 456M 
	!	!Mf &*59379=EE c]	E
  S 12E gc3h/0E %u}} 456E 
EV &*59379=GG c]	G
  S 12G gc3h/0G %u}} 456G 
		G Gr(   r   c                   &    \ rS rSrS\SS4S jrSrg)r"   im  sdkr9   Nc                 @   Xl         [        R                  " UR                  S5      U l        [        R                  " UR                  S5      U l        [        R                  " UR
                  S5      U l        [        R                  " UR                  S5      U l        g Nr5   )_sdkr   to_raw_response_wrapperr   r   r   r   r$   r   s     r%   __init__AgentsWithRawResponse.__init__n  so    	&>>JJ
 %<<SXXW	#;;CGG_U&>>JJ
r(   r  r   r   r   r   r   r   r   r   r   r  r   r   r(   r%   r"   r"   m  s    	
F 	
t 	
r(   r"   c                   &    \ rS rSrS\SS4S jrSrg)r*   iz  r   r9   Nc                 @   Xl         [        R                  " UR                  S5      U l        [        R                  " UR                  S5      U l        [        R                  " UR
                  S5      U l        [        R                  " UR                  S5      U l        g r  )r  r   to_streamed_response_wrapperr   r   r   r   r  s     r%   r  $AgentsWithStreamingResponse.__init__{  sy    	&CCJJ
 %AAHHo
	 $@@GG_
 'CCJJ
r(   r  r	  r   r(   r%   r*   r*   z  s    
F 
t 
r(   r*   c                   V   \ rS rSr\S 5       r\S 5       rSSSSSSSSSSSS.S\\   S\\   S\\   S	\\   S
\\   S\\	\
\R                     \
\R                     4      S\\	\R                  \R                   4      S\\\\4      S\\\\4      S\\\\4      S\\	\\R*                  4      S\R.                  4S jjrSSSSSSSS.S\\   S\\   S\\   S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R4                  4S jjrSSSSS.S\S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R.                  4S jjrSSSSS.S\S\\   S\\\\4      S\\\\4      S\\	\\R*                  4      S\R<                  4S jjrSr g)AsyncAgentsi  c                     [        U 5      $ r!   )AsyncAgentsWithRawResponser#   s    r%   r&   AsyncAgents.with_raw_response  s    )$//r(   c                     [        U 5      $ r!   ) AsyncAgentsWithStreamingResponser#   s    r%   r+   #AsyncAgents.with_streaming_response  s    /55r(   Nr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   c                6  ^
^#    SnSn[         nSnUnU R                  U5      nUc  U R                  R                  nUb  UnOU R	                  X5      n[
        R                  " U[        R                  " UUUU[        R                  " U[        [        [        R                        5      [        R                  " U[        [        R                     5      S9S9m[        R                   " U5      u  nnU R#                  SSUUTSSSSSUU	[
        R$                  " U R                  R&                  R(                  S	9U R                  R*                  U
U4S
 jSUS9nU[         :X  ab  U R                  R,                  [         La  U R                  R,                  nO.[        R.                  " S[        R0                  " SSSS5      SSS9nSn[3        U[        R.                  5      (       a  U/ SQ4nS n[5        U R                  U=(       d    SSS[7        U R                  R*                  [8        R:                  5      [=        USS9S9nU R?                  UUS US:H  US9I Sh  vN nUS:w  a  US:X  a  [        R@                  O[        RB                  n[E        [F        U" UUSU [I        U5      U R                  RJ                  RM                  S5      U R                  RJ                  RM                  S 5      S!95      $  U" U5      I Sh  vN $  N N! [N         a|  n[        RP                  " U R                  RJ                  RM                  S 5      U R                  RJ                  RM                  S5      [I        U5      UU5      I Sh  vN     SnAgSnAff = f7f)"r;   Nr<   r=   r?   r@   TrA   rB   rC   c            	      f   > [         R                  " TR                  SSS[        R                  T S9$ rE   rG   rJ   s   r%   rL   $AsyncAgents.create.<locals>.<lambda>  rN   r(   rO   r`   ra   rb   rc   rd   re   rf   rh   c                   #    [         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      e N Nj7frn   r   rt   stream_to_text_asyncr   rv   r   r   rI   rw   s     r%   rz   5AsyncAgents.create.<locals>._speakeasy_parse_response       ##HeS99&+&@&@&J J..((  ##HeS99&+&@&@&J J..((  ##Hi9KLL.v||XPUVV**+I8TT !K
 !K#   7C8C4AC8C6A)C86C8r}   r~   asyncr   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   r    r   r(   r   r   r   r   r   _async_hooksr   r   r   r   r   r   async_hooks))r   r   r   r_   r   r   r   r   rI   r   r   r   r   r   r   r   r   _build_request_asyncr   r   r.   r\   r   r   r   r   r   r   r   r   r	   do_request_asyncAsyncStreamedAPIResponseAsyncAPIResponser   r   r   r   r   r   raise_parse_error_asyncr   s             `               @r%   r   AsyncAgents.create  s~    H 7<
$,,W5
//::J!!H}}X=H++#%#5'..uhtFDTDT?U6VW!&!9!9$hv/E/E&F"	
 2B1W1W2
. , ''('"&$(%)* 2%*.. 22::FF ++44! #!+ ( 
0 e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U  *))^&1&&// %*BgV	
 ..(!V+{:% / 
 
 $x/ ,{: !99%66 $
 ' 4##34GH0099==hG $ 6 6 ? ? C CN S 		28<<<5
4 = 	"::&&//33NC&&//33H=&':;  	s\   IN!L"BN<L LL NL 
NA,NN	NNNNr   r   r   r   c                D  #    SnSn	[         n
SnUnU R                  U5      nUc  U R                  R                  nUb  UnOU R	                  X5      n[
        R                  " UUUUS9n[        R                  " U5      u  pU R                  SSUU	USSSSSUU[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU
[         :X  ab  U R                  R                  [         La  U R                  R                  n
O.[        R                   " S[        R"                  " SSSS5      SSS9n
Sn[%        U
[        R                   5      (       a  U
/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9I Sh  vN nUS:w  a  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      S 95      $  U" U5      I Sh  vN $  N N! [@         a|  n[        RB                  " U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      [;        U5      UU5      I Sh  vN     SnAgSnAff = f7f)!r   Nr   r   r@   FTrA   rB   rC   r   r`   ra   rb   rc   rd   re   rf   rh   c                   #    [         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      e N Nj7frn   )r   rt   r  r   rv   r   r   r   rw   s     r%   rz   3AsyncAgents.list.<locals>._speakeasy_parse_response  s     ##HeS99&+&@&@&J J..((  ##HeS99&+&@&@&J J..((  ##Hi9KLL.,,h  **+I8TT !K
 !Kr  r}   r   r  r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   "AsyncAgents.list.<locals>.<lambda>  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   r(  r   s                          r%   r   AsyncAgents.list<  s&    * 7<
$,,W5
//::J!!H}}X=H**#!	
 2B1W1W2
.  ''('"'$(%)* 2%*-- 22::FF ++44"!% ( 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U$ *))^%1&&// %*BgV	
 ..(!V+{:% / 
 
 $x/ ,{: !99%66 $
 ' 4##34GH0099==hG $ 6 6 ? ? C CN S 		28<<<5
4 = 	"::&&//33NC&&//33H=&':;  	s\   G&L (J)BL J JJ L J 
L!A,LLLL LL r   c                @  #    SnSn[         nSn	Un
U R                  U5      nUc  U R                  R                  nU	b  U	nOU R	                  Xg5      n[
        R                  " UUS9n[        R                  " U
5      u  pU R                  SSUUUSSSSSU
U[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU[         :X  ab  U R                  R                  [         La  U R                  R                  nO.[        R                   " S[        R"                  " SSSS5      SSS9nSn[%        U[        R                   5      (       a  U/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9I Sh  vN nUS:w  a  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      S 95      $  U" U5      I Sh  vN $  N N! [@         a|  n[        RB                  " U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      [;        U5      UU5      I Sh  vN     SnAgSnAff = f7f)!r   Nr   r   r   FTrA   rB   rC   r   r`   ra   rb   rc   rd   re   rf   rh   c                   #    [         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      e N Nj7frn   r  rw   s     r%   rz   2AsyncAgents.get.<locals>._speakeasy_parse_response  r  r  r}   r   r  r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   !AsyncAgents.get.<locals>.<lambda>5  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   r(  r   s                        r%   r   AsyncAgents.get  s     " 7<
$,,W5
//::J!!H}}X=H((#

 2B1W1W2
.  ''-'"'$(%)* 2%*++ 22::FF ++44"!% ( 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U  *))^#1&&// %*BgV	
 ..(!V+{:% / 
 
 $x/ ,{: !99%66 $
 ' 4##34GH0099==hG $ 6 6 ? ? C CN S 		28<<<5
4 = 	"::&&//33NC&&//33H=&':;  	\   G$L&J'BLJ JJ LJ 
LA,LLLLLLc                @  #    SnSn[         nSn	Un
U R                  U5      nUc  U R                  R                  nU	b  U	nOU R	                  Xg5      n[
        R                  " UUS9n[        R                  " U
5      u  pU R                  SSUUUSSSSSU
U[
        R                  " U R                  R                  R                  S	9U R                  R                  SUS
9nU[         :X  ab  U R                  R                  [         La  U R                  R                  nO.[        R                   " S[        R"                  " SSSS5      SSS9nSn[%        U[        R                   5      (       a  U/ SQ4nS n['        U R                  U=(       d    SSS[)        U R                  R                  [*        R,                  5      [/        USS9S9nU R1                  UUS US:H  US9I Sh  vN nUS:w  a  US:X  a  [        R2                  O[        R4                  n[7        [8        U" UUSU [;        U5      U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      S 95      $  U" U5      I Sh  vN $  N N! [@         a|  n[        RB                  " U R                  R<                  R?                  S5      U R                  R<                  R?                  S5      [;        U5      UU5      I Sh  vN     SnAgSnAff = f7f)!r   Nr   r   r   FTrA   rB   rC   r   r`   ra   rb   rc   rd   re   rf   rh   c                   #    [         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a5  [         R                  " U 5      I S h  vN n[        R                  " SX5      e[         R                  " U SS5      (       a  [        [        R                  U SS9$ [        R                  " S	U 5      e N Nj7frn   )r   rt   r  r   rv   r   r   r   rw   s     r%   rz   5AsyncAgents.delete.<locals>._speakeasy_parse_response  s     ##HeS99&+&@&@&J J..((  ##HeS99&+&@&@&J J..((  ##Hi9KLL. &&5  **+I8TT !K
 !Kr  r}   r   r  r   r   c                 4    [         R                  " SS/U 5      $ r   r   r   s    r%   rL   $AsyncAgents.delete.<locals>.<lambda>  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   r(  r   s                        r%   r   AsyncAgents.deleteV  s     " 7<
$,,W5
//::J!!H}}X=H++#

 2B1W1W2
.  ''-'"'$(%)* 2%*.. 22::FF ++44"!% ( 
* e%%22%?00==+++))#tQ> !	 gu0011#%ABL	U$ *))^&1&&// %*BgV	
 ..(!V+{:% / 
 
 $x/ ,{: !99%66 $
 ' 4##34GH0099==hG $ 6 6 ? ? C CN S 		28<<<5
4 = 	"::&&//33NC&&//33H=&':;  	r6  r   r   r   r(   r%   r  r    sW   0 0 6 6 &* $(,0%)  5937269=)f c]f SM	f
 SMf %SMf c]f )334)889;
f #,..0Q0QQR
f"  S 12#f$ gc3h/0%f& WS#X./'f( %u}} 456)f* 
+fV &*#'$( $59379=O c]O C=	O
 SMO O  S 12O gc3h/0O %u}} 456O 
	!	!Oj &*59379=GG c]	G
  S 12G gc3h/0G %u}} 456G 
GZ &*59379=II c]	I
  S 12I gc3h/0I %u}} 456I 
		I Ir(   r  c                   &    \ rS rSrS\SS4S jrSrg)r  i  r   r9   Nc                 @   Xl         [        R                  " UR                  S5      U l        [        R                  " UR                  S5      U l        [        R                  " UR
                  S5      U l        [        R                  " UR                  S5      U l        g r  )r  r   async_to_raw_response_wrapperr   r   r   r   r  s     r%   r  #AsyncAgentsWithRawResponse.__init__  sy    	&DDJJ
 %BBHHo
	 $AAGG_
 'DDJJ
r(   r  r   r   r   r   r  r  r   r   r(   r%   r  r        
K 
D 
r(   r  c                   &    \ rS rSrS\SS4S jrSrg)r  i  r   r9   Nc                 @   Xl         [        R                  " UR                  S5      U l        [        R                  " UR                  S5      U l        [        R                  " UR
                  S5      U l        [        R                  " UR                  S5      U l        g r  )r  r   "async_to_streamed_response_wrapperr   r   r   r   r  s     r%   r  )AsyncAgentsWithStreamingResponse.__init__  sy    	&IIJJ
 %GGHHo
	 $FFGG_
 'IIJJ
r(   r  rA  r   r(   r%   r  r    rB  r(   r  ))__doc__r}   r   r   r   r   r   r   r   r	   basesdkr
   r   r   r   r   r   types.agentsr   r   r   r   r   r   utils.unmarshal_json_responser   r   typingr   r   r   r   r   r   r   r   r"   r*   r  r  r  r   r(   r%   <module>rL     s{   " H * * H H * @ @ N : B  F F FL	W L	^

 


 
"T	, T	n
 
"
 
r(   