
    hj                     V   d Z ddlmZmZmZmZ ddlmZmZm	Z	 ddl
mZmZ ddlmZmZmZmZ ddlmZmZ ddlmZmZ ddlmZ d	d
lZd	dlmZmZmZmZm Z m!Z!m"Z"  G d de          Z# G d d          Z$ G d d          Z% G d de          Z& G d d          Z' G d d          Z(d
S )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                      e Zd Zed             Zed             Zdddddddddddddee         dee         dee         dee         d	ee         d
eee	e
j                 e	e
j                 f                  deeej        ej        f                  deeeef                  deeeef                  deeeef                  deeeej        f                  dej        fdZdddddddddee         dee         dee         dee         deeeef                  deeeef                  deeeej        f                  dej        fdZddddddedee         deeeef                  deeeef                  deeeej        f                  dej        fdZddddddedee         deeeef                  deeeef                  deeeej        f                  dej        fdZdS )Agentsc                      t          |           S N)AgentsWithRawResponseselfs    ]/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/google/genai/_gaos/agents.pywith_raw_responsezAgents.with_raw_response   s    $T***    c                      t          |           S r    )AgentsWithStreamingResponser"   s    r$   with_streaming_responsezAgents.with_streaming_response#   s    *4000r&   Napi_versionid
base_agentsystem_instructiondescriptiontoolsbase_environmentextra_headersextra_query
extra_bodytimeoutr+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   returnc                  
 d}d}t           }d}|}|                     |          }|| j        j        }||}n|                     ||          }t          j        |t          j        ||||t          j
        |t          t          t          j                                    t          j
        |t          t          j                                               t          j        |          \  }}|                     dd||ddddd||	t          j        | j        j        j        	          | j        j        
fd
d|          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t3          |t          j                  r|g df}d }t5          | j        |pdddt7          | j        j        t8          j                  t=          |d                    }|                     ||d |dk    |          }|dk    rl|dk    rt          j         nt          j!        }tE          tF           |||d| tI          |          | j        j%        &                    d                               S 	  ||          S # tN          $ r?}t          j(        | j        j%        d         tI          |          ||           Y d}~dS d}~ww xY w)!d  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,   r-   r.   r/   r0   r1   r+   bodyPOST/{api_version}/agentsT
user-agentapplication/jsonr+   c                  V    t          j        j        dddt          j                   S NFjson)r4   r   serialize_request_bodyr;   r   Agentr4   requests   r$   <lambda>zAgents.create.<locals>.<lambda>{   *    (DeUFFLZ) ) ) r&   methodpathbase_urlurl_variablesrH   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                    t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           
N4XX*zAPI error occurredrh   defaultr?   F)validatezUnexpected response receivedr   match_responsestream_to_textr   GenAiDefaultErrorr   r   rF   http_reshttp_res_texts     r$   _speakeasy_parse_responsez0Agents.create.<locals>._speakeasy_parse_response       #HeS99  % 4X > >.((M   #HeS99  % 4X > >.((M   #Hi9KLL W.v|XPUVVVV*+I8TTTr&    CreateAgentsyncmode	executionconfigrN   operation_idoauth2_scopessecurity_sourceresponsec                 0    t          j        ddg|           S Nrk   rh   r   match_status_codescs    r$   rI   zAgents.create.<locals>.<lambda>       5+CUENTU+V+V r&   	streaminghook_ctxrH   is_error_status_codestreamretry_configparsedbuffered_hooksrawparserr|   
client_refr   hooks))r   _coerce_timeout_mssdk_configurationr[   _get_urlr   CreateAgentRequestr   rF   r   get_pydantic_modelr   r   	AgentToolBaseEnvironmentr   consume_response_mode_build_requestCreateAgentGlobalsglobalsr+   rX   r   RetryConfigBackoffStrategy
isinstancer   r   r   Securityr	   
do_requestStreamedAPIResponseAPIResponser   r   r   __dict__get	Exceptionraise_parse_errorr#   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   rN   rO   retries
server_urlrU   r[   _speakeasy_response_modereqr   rv   _speakeasy_hook_ctxrt   _speakeasy_response_cls
parse_exc_rH   s             `               @r$   createzAgents.create'   s   H 7<
$,,W55
/:J!!HH}}X}==H+#%#5'.uhtFDT?U6VWW!&!9$hv/E&F" "	 	 	
 
 
 2B1W2
 2
. , !!('"&$(%)* 2%*. 2:F   +4! ! ! ! ! #!+ " 
 
0 e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U  *)^&1&/  %*BfUUU	
 	
 	
 ??(!V!V+{:% # 
 
 $x// ,{:: !44%1 $
 '' 4##34GHH09==hGG  
 
 
	,,X666 	 	 	.&/9&':;;	        	s   "
J- -
K674K11K6r+   	page_size
page_tokenparentr2   r3   r5   r   r   r   c                   d}d}	t           }
d}|}|                     |          }|| j        j        }||}n|                     ||	          }t          j        ||||          }t          j        |          \  }}| 	                    dd||	|ddddd||t          j
        | j        j        j        	          | j        j        d|
          }|
t           k    rM| j        j        t           ur| j        j        }
n-t          j        dt          j        dddd          dd          }
d}t%          |
t          j                  r|
g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |          }|dk    rl|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d                              S 	  ||          S # t@          $ r?}t          j!        | j        j        d         t;          |          ||           Y d}~dS d}~ww xY w)   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=   FTr>   r?   r@   rL   rM   rN   rO   rH   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rd   c                    t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   )r   rp   rq   r   rr   r   r   AgentListResponsers   s     r$   rv   z.Agents.list.<locals>._speakeasy_parse_response  s    #HeS99  % 4X > >.((M   #HeS99  % 4X > >.((M   #Hi9KLL .,h    *+I8TTTr&   rx   
ListAgentsrz   r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   zAgents.list.<locals>.<lambda>=  r   r&   r   r   r   r   r   r   )"r   r   r   r[   r   r   ListAgentsRequestr   r   r   ListAgentsGlobalsr   r+   rX   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   r2   r3   r5   rN   rO   r   r   rU   r[   rH   r   r   r   rv   r   rt   r   r   s                          r$   listzAgents.list   sN   * 7<
$,,W55
/:J!!HH}}X}==H*#!	
 
 
 2B1W2
 2
. , !!('"'$(%)* 2%*- 2:F   +4"!% " 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U$ *)^%1&/  %*BfUUU	
 	
 	
 ??(!V!V+{:% # 
 
 $x// ,{:: !44%1 $
 '' 4##34GHH09==hGG  
 
 
	,,X666 	 	 	.&/9&':;;	        	s   *
H5 5
I>?4I99I>r+   r2   r3   r5   c                   d}d}t           }d}	|}
|                     |          }|| j        j        }|	|	}n|                     ||          }t          j        ||          }t          j        |
          \  }}
| 	                    dd|||ddddd|
|t          j
        | j        j        j        	          | j        j        d|
          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t%          |t          j                  r|g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |          }|dk    rl|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d                              S 	  ||          S # t@          $ r?}t          j!        | j        j        d         t;          |          ||           Y d}~dS d}~ww xY w) u  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}FTr>   r?   r@   r   r\   r]   r^   r_   r`   ra   rb   rd   c                    t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   ro   rs   s     r$   rv   z-Agents.get.<locals>._speakeasy_parse_response  rw   r&   rx   GetAgentrz   r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   zAgents.get.<locals>.<lambda>  r   r&   r   r   r   r   r   r   )"r   r   r   r[   r   r   GetAgentRequestr   r   r   GetAgentGlobalsr   r+   rX   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r#   r,   r+   r2   r3   r5   rN   rO   r   r   rU   r[   rH   r   r   r   rv   r   rt   r   r   s                        r$   r   z
Agents.get\  sH   " 7<
$,,W55
/:J!!HH}}X}==H(#
 
 

 2B1W2
 2
. , !!-'"'$(%)* 2%*+ 2:F   +4"!% " 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U  *)^#1&/  %*BfUUU	
 	
 	
 ??(!V!V+{:% # 
 
 $x// ,{:: !44%1 $
 '' 4##34GHH09==hGG  
 
 
	,,X666 	 	 	.&/9&':;;	        	   (
H3 3
I<=4I77I<c                   d}d}t           }d}	|}
|                     |          }|| j        j        }|	|	}n|                     ||          }t          j        ||          }t          j        |
          \  }}
| 	                    dd|||ddddd|
|t          j
        | j        j        j        	          | j        j        d|
          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t%          |t          j                  r|g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |          }|dk    rl|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d                              S 	  ||          S # t@          $ r?}t          j!        | j        j        d         t;          |          ||           Y d}~dS d}~ww xY w) p  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   FTr>   r?   r@   r   r\   r]   r^   r_   r`   ra   rb   rd   c                    t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          r*t          j        |           }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   )r   rp   rq   r   rr   r   r   Emptyrs   s     r$   rv   z0Agents.delete.<locals>._speakeasy_parse_response.  s    #HeS99  % 4X > >.((M   #HeS99  % 4X > >.((M   #Hi9KLL . &5    *+I8TTTr&   rx   DeleteAgentrz   r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   zAgents.delete.<locals>.<lambda>M  r   r&   r   r   r   r   r   r   )"r   r   r   r[   r   r   DeleteAgentRequestr   r   r   DeleteAgentGlobalsr   r+   rX   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   s                        r$   deletezAgents.delete  sH   " 7<
$,,W55
/:J!!HH}}X}==H+#
 
 

 2B1W2
 2
. , !!-'"'$(%)* 2%*. 2:F   +4"!% " 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U$ *)^&1&/  %*BfUUU	
 	
 	
 ??(!V!V+{:% # 
 
 $x// ,{:: !44%1 $
 '' 4##34GHH09==hGG  
 
 
	,,X666 	 	 	.&/9&':;;	        	r   __name__
__module____qualname__propertyr%   r)   r   strr   r   agents_agenttoolr   AgentToolParamagents_agentr   BaseEnvironmentParamr   r   floathttpxTimeoutr   rF   r   intr   r   r   r   r   r    r&   r$   r   r      s       + + X+ 1 1 X1 &* $(,0%)  5937269=)d d d c]d SM	d
 SMd %SMd c]d )34)89;
d #,.0QQR
d"  S 12#d$ gc3h/0%d& WS#X./'d( %u} 456)d* 
+d d d dR &*#'$( $59379=M M M c]M C=	M
 SMM M  S 12M gc3h/0M %u} 456M 
	!M M M Mf &*59379=E E EE c]	E
  S 12E gc3h/0E %u} 456E 
E E E EV &*59379=G G GG c]	G
  S 12G gc3h/0G %u} 456G 
	G G G G G Gr&   r   c                       e Zd ZdeddfdZdS )r!   sdkr6   Nc                    || _         t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        d S Nr2   )_sdkr   to_raw_response_wrapperr   r   r   r   r#   r   s     r$   __init__zAgentsWithRawResponse.__init__n  sq    	&>J
 
 %<SXWW	#;CG_UU&>J
 
r&   r   r   r   r   r   r   r&   r$   r!   r!   m  s6        	
F 	
t 	
 	
 	
 	
 	
 	
r&   r!   c                       e Zd ZdeddfdZdS )r(   r   r6   Nc                    || _         t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        d S r   )r   r   to_streamed_response_wrapperr   r   r   r   r   s     r$   r   z$AgentsWithStreamingResponse.__init__{  s    	&CJ
 
 %AHo
 
	 $@G_
 
 'CJ
 
r&   r   r   r&   r$   r(   r(   z  s6        
F 
t 
 
 
 
 
 
r&   r(   c                      e Zd Zed             Zed             Zdddddddddddddee         dee         dee         dee         d	ee         d
eee	e
j                 e	e
j                 f                  deeej        ej        f                  deeeef                  deeeef                  deeeef                  deeeej        f                  dej        fdZdddddddddee         dee         dee         dee         deeeef                  deeeef                  deeeej        f                  dej        fdZddddddedee         deeeef                  deeeef                  deeeej        f                  dej        fdZddddddedee         deeeef                  deeeef                  deeeej        f                  dej        fdZdS )AsyncAgentsc                      t          |           S r    )AsyncAgentsWithRawResponser"   s    r$   r%   zAsyncAgents.with_raw_response  s    )$///r&   c                      t          |           S r    ) AsyncAgentsWithStreamingResponser"   s    r$   r)   z#AsyncAgents.with_streaming_response  s    /555r&   Nr*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   c                  
K   d}d}t           }d}|}|                     |          }|| j        j        }||}n|                     ||          }t          j        |t          j        ||||t          j
        |t          t          t          j                                    t          j
        |t          t          j                                               t          j        |          \  }}|                     dd||ddddd||	t          j        | j        j        j        	          | j        j        
fd
d|          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t3          |t          j                  r|g df}d }t5          | j        |pdddt7          | j        j        t8          j                  t=          |d                    }|                     ||d |dk    |           d{V }|dk    r|dk    rt          j         nt          j!        }tE          tF           |||d| tI          |          | j        j%        &                    d          | j        j%        &                    d           !                    S 	  ||           d{V S # tN          $ rp}t          j(        | j        j%        &                    d           | j        j%        &                    d          tI          |          ||           d{V  Y d}~dS d}~ww xY w)"r8   Nr9   r:   r<   r=   Tr>   r?   r@   c                  V    t          j        j        dddt          j                   S rB   rD   rG   s   r$   rI   z$AsyncAgents.create.<locals>.<lambda>  rJ   r&   rK   r\   r]   r^   r_   r`   ra   rb   rd   c                   K   t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   r   rp   stream_to_text_asyncr   rr   r   r   rF   rs   s     r$   rv   z5AsyncAgents.create.<locals>._speakeasy_parse_response        #HeS99 &+&@&J&J J J J J J J.((M   #HeS99 &+&@&J&J J J J J J J.((M   #Hi9KLL W.v|XPUVVVV*+I8TTTr&   rx   ry   asyncr{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   z$AsyncAgents.create.<locals>.<lambda>  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   rF   r   r   r   r   r   r   r   r   _build_request_asyncr   r   r+   rX   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   zAsyncAgents.create  sH     H 7<
$,,W55
/:J!!HH}}X}==H+#%#5'.uhtFDT?U6VWW!&!9$hv/E&F" "	 	 	
 
 
 2B1W2
 2
. , ''('"&$(%)* 2%*. 2:F   +4! ! ! ! ! #!+ ( 
 
0 e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U  *)^&1&/  %*BgVVV	
 	
 	
 ..(!V!V+{:% / 
 
 
 
 
 
 
 
 $x// ,{:: !99%6 $
 '' 4##34GHH09==hGG $ 6 ? C CN S S    		228<<<<<<<<< 	 	 	":&/33NCC&/33H==&':;;              	s   K 
M#A%MMr   r   r   r   c                  K   d}d}	t           }
d}|}|                     |          }|| j        j        }||}n|                     ||	          }t          j        ||||          }t          j        |          \  }}| 	                    dd||	|ddddd||t          j
        | j        j        j        	          | j        j        d|
          }|
t           k    rM| j        j        t           ur| j        j        }
n-t          j        dt          j        dddd          dd          }
d}t%          |
t          j                  r|
g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |           d{V }|dk    r|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d          | j        j                            d                               S 	  ||           d{V S # t@          $ rp}t          j!        | j        j                            d          | j        j                            d          t;          |          ||           d{V  Y d}~dS d}~ww xY w)!r   Nr   r   r=   FTr>   r?   r@   r   r\   r]   r^   r_   r`   ra   rb   rd   c                   K   t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   )r   rp   r  r   rr   r   r   r   rs   s     r$   rv   z3AsyncAgents.list.<locals>._speakeasy_parse_response  s     #HeS99 &+&@&J&J J J J J J J.((M   #HeS99 &+&@&J&J J J J J J J.((M   #Hi9KLL .,h    *+I8TTTr&   rx   r   r  r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   z"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+   rX   r   r   r   r   r   r   r   r   r   r	   r  r  r  r   r   r   r   r   r   r  r   s                          r$   r   zAsyncAgents.list<  s     * 7<
$,,W55
/:J!!HH}}X}==H*#!	
 
 
 2B1W2
 2
. , ''('"'$(%)* 2%*- 2:F   +4"!% ( 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U$ *)^%1&/  %*BgVVV	
 	
 	
 ..(!V!V+{:% / 
 
 
 
 
 
 
 
 $x// ,{:: !99%6 $
 '' 4##34GHH09==hGG $ 6 ? C CN S S    		228<<<<<<<<< 	 	 	":&/33NCC&/33H==&':;;              	s   I! !
K+A%KKr   c                  K   d}d}t           }d}	|}
|                     |          }|| j        j        }|	|	}n|                     ||          }t          j        ||          }t          j        |
          \  }}
| 	                    dd|||ddddd|
|t          j
        | j        j        j        	          | j        j        d|
          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t%          |t          j                  r|g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |           d{V }|dk    r|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d          | j        j                            d                               S 	  ||           d{V S # t@          $ rp}t          j!        | j        j                            d          | j        j                            d          t;          |          ||           d{V  Y d}~dS d}~ww xY w)!r   Nr   r   r   FTr>   r?   r@   r   r\   r]   r^   r_   r`   ra   rb   rd   c                   K   t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   r  rs   s     r$   rv   z2AsyncAgents.get.<locals>._speakeasy_parse_response  r  r&   rx   r   r  r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   z!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+   rX   r   r   r   r   r   r   r   r   r   r	   r  r  r  r   r   r   r   r   r   r  r   s                        r$   r   zAsyncAgents.get  s     " 7<
$,,W55
/:J!!HH}}X}==H(#
 
 

 2B1W2
 2
. , ''-'"'$(%)* 2%*+ 2:F   +4"!% ( 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U  *)^#1&/  %*BgVVV	
 	
 	
 ..(!V!V+{:% / 
 
 
 
 
 
 
 
 $x// ,{:: !99%6 $
 '' 4##34GHH09==hGG $ 6 ? C CN S S    		228<<<<<<<<< 	 	 	":&/33NCC&/33H==&':;;              	   I 
K)A%KKc                  K   d}d}t           }d}	|}
|                     |          }|| j        j        }|	|	}n|                     ||          }t          j        ||          }t          j        |
          \  }}
| 	                    dd|||ddddd|
|t          j
        | j        j        j        	          | j        j        d|
          }|t           k    rM| j        j        t           ur| j        j        }n-t          j        dt          j        dddd          dd          }d}t%          |t          j                  r|g df}d }t'          | j        |pdddt)          | j        j        t*          j                  t/          |d                    }|                     ||d |dk    |           d{V }|dk    r|dk    rt          j        nt          j        }t7          t8           |||d| t;          |          | j        j                            d          | j        j                            d                               S 	  ||           d{V S # t@          $ rp}t          j!        | j        j                            d          | j        j                            d          t;          |          ||           d{V  Y d}~dS d}~ww xY w)!r   Nr   r   r   FTr>   r?   r@   r   r\   r]   r^   r_   r`   ra   rb   rd   c                   K   t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          r0t          j        |            d {V }t          j        d| |          t          j        | dd          rt          t          j        | d          S t          j        d	|           rj   )r   rp   r  r   rr   r   r   r   rs   s     r$   rv   z5AsyncAgents.delete.<locals>._speakeasy_parse_response  s     #HeS99 &+&@&J&J J J J J J J.((M   #HeS99 &+&@&J&J J J J J J J.((M   #Hi9KLL . &5    *+I8TTTr&   rx   r   r  r{   r~   c                 0    t          j        ddg|           S r   r   r   s    r$   rI   z$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+   rX   r   r   r   r   r   r   r   r   r   r	   r  r  r  r   r   r   r   r   r   r  r   s                        r$   r   zAsyncAgents.deleteV  s     " 7<
$,,W55
/:J!!HH}}X}==H+#
 
 

 2B1W2
 2
. , ''-'"'$(%)* 2%*. 2:F   +4"!% ( 
 
* e%2%??0=++)#tQ>> !	   gu011 	C#%A%A%ABL	U 	U 	U$ *)^&1&/  %*BgVVV	
 	
 	
 ..(!V!V+{:% / 
 
 
 
 
 
 
 
 $x// ,{:: !99%6 $
 '' 4##34GHH09==hGG $ 6 ? C CN S S    		228<<<<<<<<< 	 	 	":&/33NCC&/33H==&':;;              	r  r   r   r&   r$   r   r     s       0 0 X0 6 6 X6 &* $(,0%)  5937269=)f f f c]f SM	f
 SMf %SMf c]f )34)89;
f #,.0QQR
f"  S 12#f$ gc3h/0%f& WS#X./'f( %u} 456)f* 
+f f f fV &*#'$( $59379=O O O c]O C=	O
 SMO O  S 12O gc3h/0O %u} 456O 
	!O O O Oj &*59379=G G GG c]	G
  S 12G gc3h/0G %u} 456G 
G G G GZ &*59379=I I II c]	I
  S 12I gc3h/0I %u} 456I 
	I I I I I Ir&   r   c                       e Zd ZdeddfdZdS )r   r   r6   Nc                    || _         t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        d S r   )r   r   async_to_raw_response_wrapperr   r   r   r   r   s     r$   r   z#AsyncAgentsWithRawResponse.__init__  s    	&DJ
 
 %BHo
 
	 $AG_
 
 'DJ
 
r&   r   r   r   r   r   r   r&   r$   r   r     6        
K 
D 
 
 
 
 
 
r&   r   c                       e Zd ZdeddfdZdS )r   r   r6   Nc                    || _         t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        t          j        |j        d          | _        d S r   )r   r   "async_to_streamed_response_wrapperr   r   r   r   r   s     r$   r   z)AsyncAgentsWithStreamingResponse.__init__  s    	&IJ
 
 %GHo
 
	 $FG_
 
 'IJ
 
r&   r  r   r&   r$   r   r     r  r&   r   ))__doc__rx   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>r'     s  " H G * * * * * * * * * * * * H H H H H H H H H H * * * * * * * * @ @ @ @ @ @ @ @ @ @ @ @ N N N N N N N N : : : : : : : : B B B B B B  F F F F F F F F F F F F F F F F F FL	 L	 L	 L	 L	W L	 L	 L	^

 

 

 

 

 

 

 


 
 
 
 
 
 
 
"T	 T	 T	 T	 T	, T	 T	 T	n
 
 
 
 
 
 
 
"
 
 
 
 
 
 
 
 
 
r&   