o
    ùT·jW8  ã                   @  sh  d dl 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 ddlmZmZmZmZmZmZmZ dd	lmZmZ dd
lmZmZmZ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- ddl.m/Z/ ddl0m1Z1 ddgZ2G dd„ de#ƒZ3G dd„ de$ƒZ4G dd„ dƒZ5G dd„ dƒZ6G dd„ dƒZ7G dd„ dƒZ8dS )é    )Úannotations)ÚLiteralNé   )Ú_legacy_responseé   )ÚItemsÚ
AsyncItemsÚItemsWithRawResponseÚAsyncItemsWithRawResponseÚItemsWithStreamingResponseÚAsyncItemsWithStreamingResponse)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transform)ÚTurnsÚ
AsyncTurnsÚTurnsWithRawResponseÚAsyncTurnsWithRawResponseÚTurnsWithStreamingResponseÚAsyncTurnsWithStreamingResponse)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)ÚSubagent)Úsubagent_list_paramsÚ	SubagentsÚAsyncSubagentsc                   @  óv   e Zd Zed(dd„ƒZed)dd„ƒZed*d	d
„ƒZed+dd„ƒZdddedœd,dd„Z	e
e
e
dddedœd-d&d'„ZdS ).r'   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r0   ú|/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/beta/agents/sessions/subagents/subagents.pyÚitems(   ó   
zSubagents.itemsr   c                 C  r+   r,   )r   r-   r.   r0   r0   r1   Úturns,   r3   zSubagents.turnsÚSubagentsWithRawResponsec                 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
        )r5   r.   r0   r0   r1   Úwith_raw_response0   ó   zSubagents.with_raw_responseÚSubagentsWithStreamingResponsec                 C  r6   ©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
        )r:   r.   r0   r0   r1   Úwith_streaming_response:   ó   z!Subagents.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚsubagent_idÚstrÚ
session_idr?   úHeaders | Noner@   úQuery | NonerA   úBody | NonerB   ú(float | httpx2.Timeout | None | NotGivenr%   c             	   C  s`   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�S )áË  Retrieves a subagent belonging to this session.

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

        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
        ú9Expected a non-empty value for `session_id` but received ú:Expected a non-empty value for `subagent_id` but received úOpenAI-Betaú	agents=v1ú5/agents/sessions/{session_id}/subagents/{subagent_id}©rE   rC   Úbearer_authT©r?   r@   rA   rB   Úsecurity©ÚoptionsÚcast_to©Ú
ValueErrorÚ_getr   r$   r%   ©r/   rC   rE   r?   r@   rA   rB   r0   r0   r1   ÚretrieveC   s$   ÿûõzSubagents.retrieve©ÚafterÚlimitÚorderr?   r@   rA   rB   r]   ú
str | Omitr^   ú
int | Omitr_   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[Subagent]c          	      C  ód   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�tt t||||t|||dœtjƒddid	�td
�S ©aa  Lists subagents in a session, including nested and closed subagents.

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

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

          limit: The maximum number of resources to return, between 1 and 100. Defaults to 20.

          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
        rK   rM   rN   z'/agents/sessions/{session_id}/subagents)rE   )r]   r^   r_   rQ   T)r?   r@   rA   rB   ÚqueryrS   )ÚpagerU   Úmodel)	rX   Ú_get_api_listr   r!   r%   r$   r   r&   ÚSubagentListParams©	r/   rE   r]   r^   r_   r?   r@   rA   rB   r0   r0   r1   Úlistp   ó,   %
ýúóîzSubagents.list)r*   r   )r*   r   )r*   r5   )r*   r:   ©rC   rD   rE   rD   r?   rF   r@   rG   rA   rH   rB   rI   r*   r%   )rE   rD   r]   r`   r^   ra   r_   rb   r?   rF   r@   rG   rA   rH   rB   rI   r*   rc   ©Ú__name__Ú
__module__Ú__qualname__r   r2   r4   r8   r<   r   r[   r   rl   r0   r0   r0   r1   r'   '   ó,    	ö1ôc                   @  r)   ).r(   r*   r   c                 C  r+   r,   )r   r-   r.   r0   r0   r1   r2   ¯   r3   zAsyncSubagents.itemsr   c                 C  r+   r,   )r   r-   r.   r0   r0   r1   r4   ³   r3   zAsyncSubagents.turnsÚAsyncSubagentsWithRawResponsec                 C  r6   r7   )rt   r.   r0   r0   r1   r8   ·   r9   z AsyncSubagents.with_raw_responseÚ#AsyncSubagentsWithStreamingResponsec                 C  r6   r;   )ru   r.   r0   r0   r1   r<   Á   r=   z&AsyncSubagents.with_streaming_responseNr>   rC   rD   rE   r?   rF   r@   rG   rA   rH   rB   rI   r%   c             	   Ã  sh   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�I dH S )rJ   rK   rL   rM   rN   rO   rP   rQ   TrR   rT   NrW   rZ   r0   r0   r1   r[   Ê   s&   €ÿûõzAsyncSubagents.retriever\   r]   r`   r^   ra   r_   rb   ú3AsyncPaginator[Subagent, AsyncCursorPage[Subagent]]c          	      C  rd   re   )	rX   ri   r   r"   r%   r$   r   r&   rj   rk   r0   r0   r1   rl   ÷   rm   zAsyncSubagents.list)r*   r   )r*   r   )r*   rt   )r*   ru   rn   )rE   rD   r]   r`   r^   ra   r_   rb   r?   rF   r@   rG   rA   rH   rB   rI   r*   rv   ro   r0   r0   r0   r1   r(   ®   rs   c                   @  ó2   e Zd Zddd„Zeddd	„ƒZeddd„ƒZdS )r5   Ú	subagentsr'   r*   ÚNonec                 C  ó&   || _ t |j¡| _t |j¡| _d S r,   )Ú
_subagentsr   Úto_raw_response_wrapperr[   rl   ©r/   rx   r0   r0   r1   Ú__init__6  ó   ÿ
ÿz!SubagentsWithRawResponse.__init__r	   c                 C  ó   t | jjƒS r,   )r	   r{   r2   r.   r0   r0   r1   r2   @  ó   zSubagentsWithRawResponse.itemsr   c                 C  r€   r,   )r   r{   r4   r.   r0   r0   r1   r4   D  r�   zSubagentsWithRawResponse.turnsN©rx   r'   r*   ry   )r*   r	   )r*   r   ©rp   rq   rr   r~   r   r2   r4   r0   r0   r0   r1   r5   5  ó    

r5   c                   @  rw   )rt   rx   r(   r*   ry   c                 C  rz   r,   )r{   r   Úasync_to_raw_response_wrapperr[   rl   r}   r0   r0   r1   r~   J  r   z&AsyncSubagentsWithRawResponse.__init__r
   c                 C  r€   r,   )r
   r{   r2   r.   r0   r0   r1   r2   T  r�   z#AsyncSubagentsWithRawResponse.itemsr   c                 C  r€   r,   )r   r{   r4   r.   r0   r0   r1   r4   X  r�   z#AsyncSubagentsWithRawResponse.turnsN©rx   r(   r*   ry   )r*   r
   )r*   r   rƒ   r0   r0   r0   r1   rt   I  r„   rt   c                   @  rw   )r:   rx   r'   r*   ry   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S r,   )r{   r   r[   rl   r}   r0   r0   r1   r~   ^  ó   ÿ
ÿz'SubagentsWithStreamingResponse.__init__r   c                 C  r€   r,   )r   r{   r2   r.   r0   r0   r1   r2   h  r�   z$SubagentsWithStreamingResponse.itemsr   c                 C  r€   r,   )r   r{   r4   r.   r0   r0   r1   r4   l  r�   z$SubagentsWithStreamingResponse.turnsNr‚   )r*   r   )r*   r   rƒ   r0   r0   r0   r1   r:   ]  r„   r:   c                   @  rw   )ru   rx   r(   r*   ry   c                 C  r‡   r,   )r{   r    r[   rl   r}   r0   r0   r1   r~   r  rˆ   z,AsyncSubagentsWithStreamingResponse.__init__r   c                 C  r€   r,   )r   r{   r2   r.   r0   r0   r1   r2   |  r�   z)AsyncSubagentsWithStreamingResponse.itemsr   c                 C  r€   r,   )r   r{   r4   r.   r0   r0   r1   r4   €  r�   z)AsyncSubagentsWithStreamingResponse.turnsNr†   )r*   r   )r*   r   rƒ   r0   r0   r0   r1   ru   q  r„   ru   )9Ú
__future__r   Útyping_extensionsr   Úhttpx2Ú r   r2   r   r   r	   r
   r   r   Ú_typesr   r   r   r   r   r   r   Ú_utilsr   r   Úturns.turnsr   r   r   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r    Ú
paginationr!   r"   Ú_base_clientr#   r$   Útypes.beta.subagentr%   Útypes.beta.agents.sessionsr&   Ú__all__r'   r(   r5   rt   r:   ru   r0   r0   r0   r1   Ú<module>   s0    $   