
    Oj                       d dl mZ d dlmZmZmZ d dlmZ d dl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mZ dd	lmZ dd
lmZmZ ddlmZmZ ddlm Z m!Z! ddl"m#Z#m$Z$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z, ddl-m.Z.m/Z/ ddl0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE ddlFmGZG ddlHmIZI ddgZJ G d de      ZK G d de      ZL G d d      ZM G d d       ZN G d! d"      ZO G d# d$      ZPy)%    )annotations)DictIterableOptional)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)agent_list_paramsagent_create_paramsagent_update_params   )VaultsAsyncVaultsVaultsWithRawResponseAsyncVaultsWithRawResponseVaultsWithStreamingResponse AsyncVaultsWithStreamingResponse)AsyncPaginatormake_request_options)SessionsAsyncSessionsSessionsWithRawResponseAsyncSessionsWithRawResponseSessionsWithStreamingResponse"AsyncSessionsWithStreamingResponse)Agent)EnvironmentsAsyncEnvironmentsEnvironmentsWithRawResponse AsyncEnvironmentsWithRawResponse!EnvironmentsWithStreamingResponse&AsyncEnvironmentsWithStreamingResponse)AgentDeleted)AgentTextParam)AgentReasoningParam)MultiAgentConfigParam)PersistedAgentToolParamAgentsAsyncAgentsc                     e Zd Zedd       Zedd       Zedd       Zedd       Zedd       Ze	e	e	e	e	e	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddde
d		 	 	 	 	 	 	 	 	 	 	 dd
Ze	e	e	e	e	e	e	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZe	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddde
d		 	 	 	 	 	 	 	 	 	 	 ddZy)r9   c                ,    t        | j                        S N)r.   _clientselfs    z/var/www/origus_pro_usr/data/www/origus.pro/core/.venv/lib/python3.12/site-packages/openai/resources/beta/agents/agents.pyenvironmentszAgents.environments6   s    DLL))    c                ,    t        | j                        S r=   )r   r>   r?   s    rA   vaultszAgents.vaults:   s    dll##rC   c                ,    t        | j                        S r=   )r'   r>   r?   s    rA   sessionszAgents.sessions>   s    %%rC   c                    t        |       S a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )AgentsWithRawResponser?   s    rA   with_raw_responsezAgents.with_raw_responseB   s     %T**rC   c                    t        |       S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )AgentsWithStreamingResponser?   s    rA   with_streaming_responsezAgents.with_streaming_responseL   s     +400rC   Ninstructionsmetadatamulti_agentname	reasoningservice_tiertexttoolsextra_headersextra_query
extra_bodytimeoutc                   ddi|
xs i }
| j                  dt        |||||||||	d	t        j                        t	        |
|||ddi      t
              S )	  Creates a reusable agent without storing credentials.

        See
        [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).

        Args:
          model: The model to use for the agent. The requested model name is preserved.

          instructions: Additional instructions appended to the agent's default base instructions. Omit
              or set to null to add no custom instructions.

          metadata: Up to 16 string key-value pairs, with keys up to 64 and values up to 512
              characters. Omission or null defaults to an empty map.

          multi_agent: Configuration for creating and coordinating subagents. Subagent tools are
              disabled by default.

          name: A human-readable name for the agent. Omission or null leaves the agent unnamed.

          reasoning: Configuration for model reasoning. Omission uses the model's default effort.

          service_tier: The service tier used for model requests. Defaults to `auto`.

              - `auto` - Selects the service tier automatically.
              - `default` - Uses the default service tier.
              - `flex` - Uses the flex service tier.
              - `priority` - Uses the priority service tier.
              - `fast` - Uses the fast service tier.

          text: Configuration for generated text. Defaults to the `text` format and medium
              verbosity.

          tools: Tools available to the agent. Defaults to an empty list.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        OpenAI-Beta	agents=v1/agents	modelrQ   rR   rS   rT   rU   rV   rW   rX   bearer_authTrY   rZ   r[   r\   securitybodyoptionscast_to)_postr   r   AgentCreateParamsr&   r-   r@   rc   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   s                 rA   createzAgents.createU   s    z 'M8KMzz "$0 (#. !*$0 "
 $55 )+'%'. /  
 	
rC   rY   rZ   r[   r\   c                   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	      S )
  Retrieves a reusable agent by ID.

        See
        [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        7Expected a non-empty value for `agent_id` but received r_   r`   /agents/{agent_id}agent_idrd   Tre   ri   rj   
ValueError_getr   r&   r-   r@   ru   rY   rZ   r[   r\   s         rA   retrievezAgents.retrieve   sr    2 VW_Vbcdd&M8KMyy.B(+'%'.   

 
	
rC   rQ   rR   rc   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   c                   |st        d|      ddi|xs i }| j                  t        d|      t        ||||||||	|
d	t        j
                        t        ||||ddi	      t        
      S )  Updates a reusable agent.

        See
        [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).

        Args:
          instructions: Additional instructions appended to the agent's default base instructions. Omit
              to leave unchanged.

          metadata: Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it.
              Up to 16 string key-value pairs, with keys up to 64 and values up to 512
              characters.

          model: The model to use for the agent. The requested model name is preserved.

          multi_agent: Configuration for creating and coordinating subagents.

          name: A replacement name. Omit to leave unchanged, or pass null to clear it.

          reasoning: Configuration for model reasoning. Omit to keep the current settings; pass
              `null` to reset to the model's default effort.

          service_tier: The service tier used for model requests.

              - `auto` - Selects the service tier automatically.
              - `default` - Uses the default service tier.
              - `flex` - Uses the flex service tier.
              - `priority` - Uses the priority service tier.
              - `fast` - Uses the fast service tier.

          text: Configuration for text generated by the agent.

          tools: Tools available to the agent.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rr   r_   r`   rs   rt   	rQ   rR   rc   rS   rT   rU   rV   rW   rX   rd   Tre   rg   )rx   rk   r   r   r   AgentUpdateParamsr&   r-   r@   ru   rQ   rR   rc   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   s                  rA   updatezAgents.update   s    | VW_Vbcdd&M8KMzz.B $0 ("#. !*$0 "
 $55 )+'%'. /  
 	
rC   afterlimitorderrY   rZ   r[   r\   c                   ddi|xs i }| j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S 	a*  Lists reusable agents in the current project.

        See
        [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).

        Args:
          after: Return resources after this resource ID in the selected order.

          limit: The maximum number of resources to return.

          order: The order in which resources are returned. Defaults to `desc`.

              - `asc` - Returns resources in ascending order.
              - `desc` - Returns resources in descending order.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        r_   r`   ra   )r   r   r   rd   T)rY   rZ   r[   r\   queryrf   )pageri   rc   )_get_api_listr   r-   r&   r   r   AgentListParamsr@   r   r   r   rY   rZ   r[   r\   s           rA   listzAgents.list0  s    H 'M8KM!!&(+'%%!&!&!&
 &55 (. % " 
 	
rC   c                   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	      S )
  Deletes a reusable agent.

        See
        [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rr   r_   r`   rs   rt   rd   Tre   rv   rx   _deleter   r&   r4   rz   s         rA   deletezAgents.deletej  sr    2 VW_Vbcdd&M8KM||.B(+'%'. !  

 
	
rC   )returnr.   )r   r   )r   r'   )r   rJ   )r   rN   rc   strrQ   Optional[str] | OmitrR   Optional[Dict[str, str]] | OmitrS   &Optional[MultiAgentConfigParam] | OmitrT   r   rU   $Optional[AgentReasoningParam] | OmitrV   GOptional[Literal['auto', 'default', 'flex', 'priority', 'fast']] | OmitrW   Optional[AgentTextParam] | OmitrX   2Optional[Iterable[PersistedAgentToolParam]] | OmitrY   Headers | NonerZ   Query | Noner[   Body | Noner\   (float | httpx2.Timeout | None | NotGivenr   r-   ru   r   rY   r   rZ   r   r[   r   r\   r   r   r-   ru   r   rQ   r   rR   r   rc   
str | OmitrS   r   rT   r   rU   r   rV   r   rW   r   rX   r   rY   r   rZ   r   r[   r   r\   r   r   r-   )r   r   r   Optional[int] | Omitr   Literal['asc', 'desc'] | OmitrY   r   rZ   r   r[   r   r\   r   r   zSyncCursorPage[Agent]ru   r   rY   r   rZ   r   r[   r   r\   r   r   r4   __name__
__module____qualname__r   rB   rE   rG   rK   rO   r   r   rn   r{   r   r   r    rC   rA   r9   r9   5   s   * * $ $ & & + + 1 1 .248>B%):>`d04DH )-$("&<E#V
 V
 +	V

 2V
 <V
 #V
 8V
 ^V
 .V
 BV
 &V
 "V
   !V
" :#V
$ 
%V
| )-$("&<E&
&
 &&
 "&
  &
 :&
 
&
X .248 >B%):>`d04DH )-$("&<E%Y
Y
 +	Y

 2Y
 Y
 <Y
 #Y
 8Y
 ^Y
 .Y
 BY
 &Y
  "!Y
"  #Y
$ :%Y
& 
'Y
| !&*/3 )-$("&<E8
 8
 $	8

 -8
 &8
 "8
  8
 :8
 
8
@ )-$("&<E&
&
 &&
 "&
  &
 :&
 
&
rC   c                     e Zd Zedd       Zedd       Zedd       Zedd       Zedd       Ze	e	e	e	e	e	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddde
d		 	 	 	 	 	 	 	 	 	 	 dd
Ze	e	e	e	e	e	e	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZe	e	e	ddde
d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddde
d		 	 	 	 	 	 	 	 	 	 	 ddZy)r:   c                ,    t        | j                        S r=   )r/   r>   r?   s    rA   rB   zAsyncAgents.environments  s     ..rC   c                ,    t        | j                        S r=   )r    r>   r?   s    rA   rE   zAsyncAgents.vaults  s    4<<((rC   c                ,    t        | j                        S r=   )r(   r>   r?   s    rA   rG   zAsyncAgents.sessions  s    T\\**rC   c                    t        |       S rI   )AsyncAgentsWithRawResponser?   s    rA   rK   zAsyncAgents.with_raw_response  s     *$//rC   c                    t        |       S rM   ) AsyncAgentsWithStreamingResponser?   s    rA   rO   z#AsyncAgents.with_streaming_response  s     055rC   NrP   c                  K   ddi|
xs i }
| j                  dt        |||||||||	d	t        j                         d{   t	        |
|||ddi      t
        	       d{   S 7 '7 w)
r^   r_   r`   ra   rb   Nrd   Tre   rg   )rk   r   r   rl   r&   r-   rm   s                 rA   rn   zAsyncAgents.create  s     z 'M8KMZZ,"$0 (#. !*$0 "
 $55  )+'%'. /   
 
 	

s#   >A, A(
"A,#A*$A,*A,ro   c                  K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	       d
{   S 7 w)rq   rr   r_   r`   rs   rt   rd   Tre   rv   Nrw   rz   s         rA   r{   zAsyncAgents.retrieve  s     2 VW_Vbcdd&M8KMYY.B(+'%'.   

 

 
	
 

   AAAAr|   c                 K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||||||	|
d	t        j
                         d{   t        ||||dd	i
      t               d{   S 7 '7 w)r~   rr   r_   r`   rs   rt   r   Nrd   Tre   rg   )rx   rk   r   r   r   r   r&   r-   r   s                  rA   r   zAsyncAgents.update3  s     | VW_Vbcdd&M8KMZZ.B,$0 ("#. !*$0 "
 $55  )+'%'. /   
 
 	

s$   ABB
"B>B?BBr   c                   ddi|xs i }| j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S r   )r   r   r-   r&   r   r   r   r   s           rA   r   zAsyncAgents.list  s    H 'M8KM!! '(+'%%!&!&!&
 &55 (. % " 
 	
rC   c                  K   |st        d|      ddi|xs i }| j                  t        d|      t        ||||ddi      t        	       d
{   S 7 w)r   rr   r_   r`   rs   rt   rd   Tre   rv   Nr   rz   s         rA   r   zAsyncAgents.delete  s     2 VW_Vbcdd&M8KM\\.B(+'%'. ! " 

 

 
	
 

r   )r   r/   )r   r    )r   r(   )r   r   )r   r   r   r   r   )r   r   r   r   r   r   rY   r   rZ   r   r[   r   r\   r   r   z-AsyncPaginator[Agent, AsyncCursorPage[Agent]]r   r   r   rC   rA   r:   r:     s   / / ) ) + + 0 0 6 6 .248>B%):>`d04DH )-$("&<E#V
 V
 +	V

 2V
 <V
 #V
 8V
 ^V
 .V
 BV
 &V
 "V
   !V
" :#V
$ 
%V
| )-$("&<E&
&
 &&
 "&
  &
 :&
 
&
X .248 >B%):>`d04DH )-$("&<E%Y
Y
 +	Y

 2Y
 Y
 <Y
 #Y
 8Y
 ^Y
 .Y
 BY
 &Y
  "!Y
"  #Y
$ :%Y
& 
'Y
| !&*/3 )-$("&<E8
 8
 $	8

 -8
 &8
 "8
  8
 :8
 
78
@ )-$("&<E&
&
 &&
 "&
  &
 :&
 
&
rC   c                  J    e Zd ZddZedd       Zedd       Zed	d       Zy)
rJ   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r=   )_agentsr	   to_raw_response_wrapperrn   r{   r   r   r   r@   agentss     rA   __init__zAgentsWithRawResponse.__init__  s    &>>MM
 )@@OO
 '>>MM
 %<<KK
	 '>>MM
rC   c                @    t        | j                  j                        S r=   )r0   r   rB   r?   s    rA   rB   z"AgentsWithRawResponse.environments  s    *4<<+D+DEErC   c                @    t        | j                  j                        S r=   )r!   r   rE   r?   s    rA   rE   zAgentsWithRawResponse.vaults	  s    $T\\%8%899rC   c                @    t        | j                  j                        S r=   )r)   r   rG   r?   s    rA   rG   zAgentsWithRawResponse.sessions  s    &t||'<'<==rC   Nr   r9   r   None)r   r0   )r   r!   )r   r)   r   r   r   r   r   rB   rE   rG   r   rC   rA   rJ   rJ     sE    
& F F : : > >rC   rJ   c                  J    e Zd ZddZedd       Zedd       Zed	d       Zy)
r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y r=   )r   r	   async_to_raw_response_wrapperrn   r{   r   r   r   r   s     rA   r   z#AsyncAgentsWithRawResponse.__init__  s    &DDMM
 )FFOO
 'DDMM
 %BBKK
	 'DDMM
rC   c                @    t        | j                  j                        S r=   )r1   r   rB   r?   s    rA   rB   z'AsyncAgentsWithRawResponse.environments&  s    /0I0IJJrC   c                @    t        | j                  j                        S r=   )r"   r   rE   r?   s    rA   rE   z!AsyncAgentsWithRawResponse.vaults*  s    )$,,*=*=>>rC   c                @    t        | j                  j                        S r=   )r*   r   rG   r?   s    rA   rG   z#AsyncAgentsWithRawResponse.sessions.  s    +DLL,A,ABBrC   Nr   r:   r   r   )r   r1   )r   r"   )r   r*   r   r   rC   rA   r   r     sG    
& K K ? ? C CrC   r   c                  J    e Zd ZddZedd       Zedd       Zed	d       Zy)
rN   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r=   )r   r   rn   r{   r   r   r   r   s     rA   r   z$AgentsWithStreamingResponse.__init__4  sp    2MM
 5OO
 3MM
 1KK
	 3MM
rC   c                @    t        | j                  j                        S r=   )r2   r   rB   r?   s    rA   rB   z(AgentsWithStreamingResponse.environmentsG  s    01J1JKKrC   c                @    t        | j                  j                        S r=   )r#   r   rE   r?   s    rA   rE   z"AgentsWithStreamingResponse.vaultsK  s    *4<<+>+>??rC   c                @    t        | j                  j                        S r=   )r+   r   rG   r?   s    rA   rG   z$AgentsWithStreamingResponse.sessionsO  s    ,T\\-B-BCCrC   Nr   )r   r2   )r   r#   )r   r+   r   r   rC   rA   rN   rN   3  sI    
& L L @ @ D DrC   rN   c                  J    e Zd ZddZedd       Zedd       Zed	d       Zy)
r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r=   )r   r   rn   r{   r   r   r   r   s     rA   r   z)AsyncAgentsWithStreamingResponse.__init__U  sp    8MM
 ;OO
 9MM
 7KK
	 9MM
rC   c                @    t        | j                  j                        S r=   )r3   r   rB   r?   s    rA   rB   z-AsyncAgentsWithStreamingResponse.environmentsh  s    5dll6O6OPPrC   c                @    t        | j                  j                        S r=   )r$   r   rE   r?   s    rA   rE   z'AsyncAgentsWithStreamingResponse.vaultsl  s    /0C0CDDrC   c                @    t        | j                  j                        S r=   )r,   r   rG   r?   s    rA   rG   z)AsyncAgentsWithStreamingResponse.sessionsp  s    1$,,2G2GHHrC   Nr   )r   r3   )r   r$   )r   r,   r   r   rC   rA   r   r   T  sI    
& Q Q E E I IrC   r   )Q
__future__r   typingr   r   r   typing_extensionsr   httpx2 r	   _typesr
   r   r   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   r   r   vaults.vaultsr   r    r!   r"   r#   r$   _base_clientr%   r&   sessions.sessionsr'   r(   r)   r*   r+   r,   types.beta.agentr-   environments.environmentsr.   r/   r0   r1   r2   r3   types.beta.agent_deletedr4   types.beta.agent_text_paramr5    types.beta.agent_reasoning_paramr6   #types.beta.multi_agent_config_paramr7   %types.beta.persisted_agent_tool_paramr8   __all__r9   r:   rJ   r   rN   r   r   rC   rA   <module>r      s    # + + %  ! L L L L L ' ; Z : V V  B  '  6 : D I M]
#[
_ [
|
[
" [
|
> >BC CBD DBI IrC   