
    f j
                      d dl mZ d dlmZmZmZ 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 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+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 ddl9m:Z:m;Z;m<Z<m=Z=m>Z> ddgZ? G d de!          Z@ G d de"          ZA G d d          ZB G d d          ZC G d d          ZD G d d           ZEdS )!    )annotations)IterableOptionaloverload)partial)LiteralN   )_legacy_response   )Steps
AsyncStepsStepsWithRawResponseAsyncStepsWithRawResponseStepsWithStreamingResponseAsyncStepsWithStreamingResponse)	NOT_GIVENBodyQueryHeadersNotGiven)required_argsmaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)StreamAsyncStream)SyncCursorPageAsyncCursorPage)AssistantToolParamAssistantStreamEvent)AsyncPaginatormake_request_options)AssistantEventHandlerAssistantEventHandlerTAssistantStreamManagerAsyncAssistantEventHandlerAsyncAssistantEventHandlerTAsyncAssistantStreamManager)Runrun_list_paramsrun_create_paramsrun_update_paramsrun_submit_tool_outputs_paramsRuns	AsyncRunsc                     e Zd ZedPd            ZedQd            ZedRd            Zeeeeeeeddded	
dSd             Z	eeeeeeddded!	dTd$            Z	eeeeeeddded!	dUd'            Z	 e
dgddg          eeeeeeddded	
dVd)            Z	ddded*dWd,Zeddded-dXd.Zeeeeddded/dYd8Zddded*dWd9Zeeeeeeddded!	dZd;            Zeeeeeeddded!	d[d?            Zeeeeedddded@
d\dCZeedddedDd]dG            Zeddded*d^dH            Zeddded*d_dI            Z e
d
dEgg dJ          edddedDd`dK            Zeddded*dadL            Zeddded*dbdM            ZddddedNdcdOZdS )dr2   returnr   c                *    t          | j                  S N)r   _clientselfs    {C:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\openai/resources/beta/threads/runs/runs.pystepsz
Runs.steps8   s    T\"""    RunsWithRawResponsec                     t          |           S r7   )r>   r9   s    r;   with_raw_responsezRuns.with_raw_response<   s    "4(((r=   RunsWithStreamingResponsec                     t          |           S r7   )rA   r9   s    r;   with_streaming_responsezRuns.with_streaming_response@   s    (...r=   N
additional_instructionsinstructionsmetadatamodelstreamtoolsextra_headersextra_query
extra_bodytimeout	thread_idstrassistant_idrE   Optional[str] | NotGivenrF   rG   Optional[object] | NotGivenrH   rI   #Optional[Literal[False]] | NotGivenrJ   1Optional[Iterable[AssistantToolParam]] | NotGivenrK   Headers | NonerL   Query | NonerM   Body | NonerN   'float | httpx.Timeout | None | NotGivenr-   c                   dS a  
        Create a run.

        Args:
          assistant_id: The ID of the
              [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
              execute this run.

          additional_instructions: Appends additional instructions at the end of the instructions for the run. This
              is useful for modifying the behavior on a per-run basis without overriding other
              instructions.

          instructions: Overrides the
              [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant)
              of the assistant. This is useful for modifying the behavior on a per-run basis.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format. Keys
              can be a maximum of 64 characters long and values can be a maxium of 512
              characters long.

          model: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
              be used to execute this run. If a value is provided here, it will override the
              model associated with the assistant. If not, the model associated with the
              assistant will be used.

          stream: If `true`, returns a stream of events that happen during the Run as server-sent
              events, terminating when the Run enters a terminal state with a `data: [DONE]`
              message.

          tools: Override the tools the assistant can use for this run. This is useful for
              modifying the behavior on a per-run basis.

          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
        N r:   rO   rQ   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   s                r;   createzRuns.createD   
    x 	r=   	rE   rF   rG   rH   rJ   rK   rL   rM   rN   Literal[True]Stream[AssistantStreamEvent]c                   dS a  
        Create a run.

        Args:
          assistant_id: The ID of the
              [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
              execute this run.

          stream: If `true`, returns a stream of events that happen during the Run as server-sent
              events, terminating when the Run enters a terminal state with a `data: [DONE]`
              message.

          additional_instructions: Appends additional instructions at the end of the instructions for the run. This
              is useful for modifying the behavior on a per-run basis without overriding other
              instructions.

          instructions: Overrides the
              [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant)
              of the assistant. This is useful for modifying the behavior on a per-run basis.

          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format. Keys
              can be a maximum of 64 characters long and values can be a maxium of 512
              characters long.

          model: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
              be used to execute this run. If a value is provided here, it will override the
              model associated with the assistant. If not, the model associated with the
              assistant will be used.

          tools: Override the tools the assistant can use for this run. This is useful for
              modifying the behavior on a per-run basis.

          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
        Nr\   r:   rO   rQ   rI   rE   rF   rG   rH   rJ   rK   rL   rM   rN   s                r;   r^   zRuns.create   r_   r=   bool"Run | Stream[AssistantStreamEvent]c                   dS rd   r\   re   s                r;   r^   zRuns.create   r_   r=   3Optional[Literal[False]] | Literal[True] | NotGivenc                  |st          d|          ddi|	pi }	|                     d| dt          |||||||dt          j                  t          |	|
||          t          |pdt          t                   	          S 
N8Expected a non-empty value for `thread_id` but received OpenAI-Betaassistants=v1	/threads//runsrQ   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   Fbodyoptionscast_torI   
stream_cls)	
ValueError_postr   r/   RunCreateParamsr&   r-   r   r$   r]   s                r;   r^   zRuns.create   s    &  	geXaeefff&QM<ORQzz(	((( $0/F$0 ("$"  "1  )+Q[el   ?U23'  
 
 	
r=   rr   run_idc          	         |st          d|          |st          d|          ddi|pi }|                     d| d| t          ||||          t                    S )	D  
        Retrieves a run.

        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
        rl   5Expected a non-empty value for `run_id` but received rm   rn   ro   /runs/rr   ru   rv   rx   _getr&   r-   r:   r{   rO   rK   rL   rM   rN   s          r;   retrievezRuns.retrieve*  s    0  	geXaeefff 	a_U[__```&QM<ORQyy1	1111(+Q[el     
 
 	
r=   rG   rK   rL   rM   rN   c          
         |st          d|          |st          d|          ddi|pi }|                     d| d| t          d|it          j                  t          ||||          t          	          S )
}  
        Modifies a run.

        Args:
          metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
              for storing additional information about the object in a structured format. Keys
              can be a maximum of 64 characters long and values can be a maxium of 512
              characters long.

          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
        rl   r~   rm   rn   ro   r   rG   rr   rt   ru   rv   )rx   ry   r   r0   RunUpdateParamsr&   r-   r:   r{   rO   rG   rK   rL   rM   rN   s           r;   updatezRuns.updateO  s    <  	geXaeefff 	a_U[__```&QM<ORQzz1	1111 *h!79J9Z[[(+Q[el     
 
 	
r=   afterbeforelimitorderrK   rL   rM   rN   r   str | NotGivenr   r   int | NotGivenr   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[Run]c                   |st          d|          ddi|pi }|                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S 	a  
        Returns a list of runs belonging to a thread.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          before: A cursor for use in pagination. `before` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include before=obj_foo in order to
              fetch the previous page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for 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
        rl   rm   rn   ro   rp   )r   r   r   r   )rK   rL   rM   rN   query)pageru   rH   )rx   _get_api_listr!   r-   r&   r   r.   RunListParams
r:   rO   r   r   r   r   rK   rL   rM   rN   s
             r;   listz	Runs.list{  s    V  	geXaeefff&QM<ORQ!!(	((($(+'%%!&"(!&!&	  $1    % " 
 
 	
r=   c          	         |st          d|          |st          d|          ddi|pi }|                     d| d| dt          ||||          t          	          S )
X  
        Cancels a run that is `in_progress`.

        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
        rl   r~   rm   rn   ro   r   /cancelrr   r   rx   ry   r&   r-   r   s          r;   cancelzRuns.cancel  s    0  	geXaeefff 	a_U[__```&QM<ORQzz8	88888(+Q[el     
 
 	
r=   -AssistantStreamManager[AssistantEventHandler]c                   dS Create a Run streamNr\   r:   rQ   rE   rF   rG   rH   rJ   rO   rK   rL   rM   rN   s               r;   create_and_streamzRuns.create_and_stream  	    & 	r=   event_handlerr(   .AssistantStreamManager[AssistantEventHandlerT]c                   dS r   r\   r:   rQ   rE   rF   rG   rH   rJ   rO   r   rK   rL   rM   rN   s                r;   r   zRuns.create_and_stream  	    ( 	r=   
rE   rF   rG   rH   rJ   r   rK   rL   rM   rN   AssistantEventHandlerT | None^AssistantStreamManager[AssistantEventHandler] | AssistantStreamManager[AssistantEventHandlerT]c               N   |st          d|          dd|rdndd|	pi }	t          | j        d| dt          |||||d	|d
t          j                  t          |	|
||          t          d	t          t                             }t          ||pt                                S r   rl   rn   zthreads.runs.create_and_streamtruefalserm   zX-Stainless-Stream-Helperz X-Stainless-Custom-Event-Handlerro   rp   Trq   rr   rs   r   )rx   r   ry   r   r/   rz   r&   r-   r   r$   r)   r'   )r:   rQ   rE   rF   rG   rH   rJ   rO   r   rK   rL   rM   rN   make_requests                 r;   r   zRuns.create_and_stream  s   &  	geXaeefff +)I:G0TW
 
 "	
 J(	((( $0/F$0 ("""  "1  )+Q[el   23)
 
 
, &l-BjShSjSjkkkkr=   rI   rK   rL   rM   rN   tool_outputs3Iterable[run_submit_tool_outputs_params.ToolOutput]c                   dS am  
        When a run has the `status: "requires_action"` and `required_action.type` is
        `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
        tool calls once they're all completed. All outputs must be submitted in a single
        request.

        Args:
          tool_outputs: A list of tools for which the outputs are being submitted.

          stream: If `true`, returns a stream of events that happen during the Run as server-sent
              events, terminating when the Run enters a terminal state with a `data: [DONE]`
              message.

          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
        Nr\   	r:   r{   rO   r   rI   rK   rL   rM   rN   s	            r;   submit_tool_outputszRuns.submit_tool_outputsB  
    H 	r=   c                   dS am  
        When a run has the `status: "requires_action"` and `required_action.type` is
        `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
        tool calls once they're all completed. All outputs must be submitted in a single
        request.

        Args:
          stream: If `true`, returns a stream of events that happen during the Run as server-sent
              events, terminating when the Run enters a terminal state with a `data: [DONE]`
              message.

          tool_outputs: A list of tools for which the outputs are being submitted.

          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
        Nr\   	r:   r{   rO   rI   r   rK   rL   rM   rN   s	            r;   r   zRuns.submit_tool_outputsh  r   r=   c                   dS r   r\   r   s	            r;   r   zRuns.submit_tool_outputs  r   r=   rO   rI   r   c          
     ,   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          ||dt          j                  t          ||||	          t          |pd
t          t                             S Nrl   r~   rm   rn   ro   r   /submit_tool_outputsr   rI   rr   Frs   )	rx   ry   r   r1   RunSubmitToolOutputsParamsr&   r-   r   r$   r   s	            r;   r   zRuns.submit_tool_outputs  s      	geXaeefff 	a_U[__```&QM<ORQzzE	EEEEE $0$  /I  )+Q[el   ?U23  
 
 	
r=   c                   dS m
        Submit the tool outputs from a previous run and stream the run to a terminal
        state.
        Nr\   r:   r   r{   rO   rK   rL   rM   rN   s           r;   submit_tool_outputs_streamzRuns.submit_tool_outputs_stream  	    $ 	r=   c                   dS r   r\   	r:   r   r{   rO   r   rK   rL   rM   rN   s	            r;   r   zRuns.submit_tool_outputs_stream  r   r=   r   rK   rL   rM   rN   c               r   |st          d|          |st          d|          dd|rdndd|pi }t          | j        d| d	| d
t          |ddt          j                  t          ||||          t          dt          t                             }	t          |	|pt                                S r   r~   rl   rn   z'threads.runs.submit_tool_outputs_streamr   r   r   ro   r   r   Tr   rr   rs   r   )rx   r   ry   r   r1   r   r&   r-   r   r$   r)   r'   
r:   r   r{   rO   r   rK   rL   rM   rN   requests
             r;   r   zRuns.submit_tool_outputs_stream  s   $  	a_U[__``` 	geXaeefff +)R:G0TW
 
 "	
 JE	EEEEE $0"  /I  )+Q[el   23
 
 
" &g]=eNcNeNeffffr=   )r5   r   )r5   r>   )r5   rA   rO   rP   rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rI   rT   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   r-   )rO   rP   rQ   rP   rI   ra   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   rb   )rO   rP   rQ   rP   rI   rf   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   rg   )rO   rP   rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rI   ri   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   rg   r{   rP   rO   rP   rK   rV   rL   rW   rM   rX   rN   rY   r5   r-   r{   rP   rO   rP   rG   rS   rK   rV   rL   rW   rM   rX   rN   rY   r5   r-   )rO   rP   r   r   r   r   r   r   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   r   r(   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   r{   rP   rO   rP   r   r   rI   rT   rK   rV   rL   rW   rM   rX   rN   rY   r5   r-   )r{   rP   rO   rP   rI   ra   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   rb   )r{   rP   rO   rP   rI   rf   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   rg   )r{   rP   rO   rP   r   r   rI   ri   rK   rV   rL   rW   rM   rX   rN   rY   r5   rg   )r   r   r{   rP   rO   rP   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r   r   r{   rP   rO   rP   r   r(   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r   r   r{   rP   rO   rP   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   __name__
__module____qualname__r   r<   r@   rC   r   r   r^   r   r   r   r   r   r   r   r   r\   r=   r;   r2   r2   7   s       # # # _# ) ) ) _) / / / _/  =F1:09*36?CL )-$("&;D!; ; ; ; ; X;z  =F1:09*3CL )-$("&;D!; ; ; ; ; X;z  =F1:09*3CL )-$("&;D!; ; ; ; ; X;z ]N#nh%?@@ =F1:09*3FOCL )-$("&;D!)
 )
 )
 )
 )
 A@)
d )-$("&;D#
 #
 #
 #
 #
 #
T 1: )-$("&;D*
 *
 *
 *
 *
 *
` !*!* )3< )-$("&;DA
 A
 A
 A
 A
 A
T )-$("&;D#
 #
 #
 #
 #
 #
J 
 =F1:09*3CL )-$("&;D     X( 
 =F1:09*3CL
 )-$("&;D!     X2 =F1:09*3CL7; )-$("&;D!2l 2l 2l 2l 2l 2lh  7@ )-$("&;D# # # # # X#J  )-$("&;D# # # # # X#J  )-$("&;D# # # # # X#J ]K02Y2Y2YZZ GP )-$("&;D"
 "
 "
 "
 "
 [Z"
H  )-$("&;D     X&  )-$("&;D     X4 8< )-$("&;D/g /g /g /g /g /g /g /gr=   c                     e Zd ZedPd            ZedQd            ZedRd            Zeeeeeeeddded	
dSd             Z	eeeeeeddded!	dTd$            Z	eeeeeeddded!	dUd'            Z	 e
dgddg          eeeeeeddded	
dVd)            Z	ddded*dWd,Zeddded-dXd.Zeeeeddded/dYd8Zddded*dWd9Zeeeeeeddded!	dZd;            Zeeeeeeddded!	d[d?            Zeeeeedddded@
d\dCZeedddedDd]dG            Zeddded*d^dH            Zeddded*d_dI            Z e
d
dEgg dJ          edddedDd`dK            Zeddded*dadL            Zeddded*dbdM            ZddddedNdcdOZdS )dr3   r5   r   c                *    t          | j                  S r7   )r   r8   r9   s    r;   r<   zAsyncRuns.steps5  s    $,'''r=   AsyncRunsWithRawResponsec                     t          |           S r7   )r   r9   s    r;   r@   zAsyncRuns.with_raw_response9  s    '---r=   AsyncRunsWithStreamingResponsec                     t          |           S r7   )r   r9   s    r;   rC   z!AsyncRuns.with_streaming_response=  s    -d333r=   NrD   rO   rP   rQ   rE   rR   rF   rG   rS   rH   rI   rT   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r-   c               
   K   dS r[   r\   r]   s                r;   r^   zAsyncRuns.createA        x 	r=   r`   ra   !AsyncStream[AssistantStreamEvent]c               
   K   dS rd   r\   re   s                r;   r^   zAsyncRuns.create  r   r=   rf   'Run | AsyncStream[AssistantStreamEvent]c               
   K   dS rd   r\   re   s                r;   r^   zAsyncRuns.create  r   r=   ri   c               $  K   |st          d|          ddi|	pi }	|                     d| dt          |||||||dt          j                   d {V t          |	|
||          t          |pdt          t                   	           d {V S rk   )	rx   ry   r   r/   rz   r&   r-   r    r$   r]   s                r;   r^   zAsyncRuns.create  s
     &  	geXaeefff&QM<ORQZZ(	(((,$0/F$0 ("$"  "1        )+Q[el   ?U"#78'   
 
 
 
 
 
 
 
 	
r=   rr   r{   c          	        K   |st          d|          |st          d|          ddi|pi }|                     d| d| t          ||||          t                     d	{V S )
r}   rl   r~   rm   rn   ro   r   rr   r   Nr   r   s          r;   r   zAsyncRuns.retrieve'  s      0  	geXaeefff 	a_U[__```&QM<ORQYY1	1111(+Q[el     
 
 
 
 
 
 
 
 	
r=   r   c          
       K   |st          d|          |st          d|          ddi|pi }|                     d| d| t          d|it          j                   d{V t          ||||	          t          
           d{V S )r   rl   r~   rm   rn   ro   r   rG   Nrr   r   )rx   ry   r   r0   r   r&   r-   r   s           r;   r   zAsyncRuns.updateL  s      <  	geXaeefff 	a_U[__```&QM<ORQZZ1	1111,j(-CEVEfgggggggg(+Q[el      
 
 
 
 
 
 
 
 	
r=   r   r   r   r   r   r   r   r   )AsyncPaginator[Run, AsyncCursorPage[Run]]c                   |st          d|          ddi|pi }|                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S r   )rx   r   r"   r-   r&   r   r.   r   r   s
             r;   r   zAsyncRuns.listx  s    V  	geXaeefff&QM<ORQ!!(	((( %(+'%%!&"(!&!&	  $1    % " 
 
 	
r=   c          	        K   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          ||||          t          	           d
{V S )r   rl   r~   rm   rn   ro   r   r   rr   r   Nr   r   s          r;   r   zAsyncRuns.cancel  s      0  	geXaeefff 	a_U[__```&QM<ORQZZ8	88888(+Q[el      
 
 
 
 
 
 
 
 	
r=   7AsyncAssistantStreamManager[AsyncAssistantEventHandler]c                   dS r   r\   r   s               r;   r   zAsyncRuns.create_and_stream  r   r=   r   r+   8AsyncAssistantStreamManager[AsyncAssistantEventHandlerT]c                   dS r   r\   r   s                r;   r   zAsyncRuns.create_and_stream  r   r=   r   "AsyncAssistantEventHandlerT | NonerAsyncAssistantStreamManager[AsyncAssistantEventHandler] | AsyncAssistantStreamManager[AsyncAssistantEventHandlerT]c               N   |st          d|          dd|rdndd|	pi }	|                     d| dt          |||||d	|d
t          j                  t          |	|
||          t          d	t          t                             }t          ||pt                                S r   )rx   ry   r   r/   rz   r&   r-   r    r$   r,   r*   )r:   rQ   rE   rF   rG   rH   rJ   rO   r   rK   rL   rM   rN   r   s                 r;   r   zAsyncRuns.create_and_stream  s   ,  	geXaeefff +)I:G0TW
 
 "	
 **(	((( $0/F$0 ("""  "1  )+Q[el   "#78'  
 
* +7-BoSmSoSoppppr=   r   r   r   c               
   K   dS r   r\   r   s	            r;   r   zAsyncRuns.submit_tool_outputsA        H 	r=   c               
   K   dS r   r\   r   s	            r;   r   zAsyncRuns.submit_tool_outputsg  r   r=   c               
   K   dS r   r\   r   s	            r;   r   zAsyncRuns.submit_tool_outputs  r   r=   r   c          
     H  K   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          ||dt          j                   d {V t          ||||	          t          |pd
t          t                              d {V S r   )	rx   ry   r   r1   r   r&   r-   r    r$   r   s	            r;   r   zAsyncRuns.submit_tool_outputs  s$       	geXaeefff 	a_U[__```&QM<ORQZZE	EEEEE,$0$  /I        )+Q[el   ?U"#78   
 
 
 
 
 
 
 
 	
r=   c                   dS r   r\   r   s           r;   r   z$AsyncRuns.submit_tool_outputs_stream  r   r=   c                   dS r   r\   r   s	            r;   r   z$AsyncRuns.submit_tool_outputs_stream  r   r=   r   c          
     r   |st          d|          |st          d|          dd|rdndd|pi }|                     d| d	| d
t          |ddt          j                  t          ||||          t          dt          t                             }	t          |	|pt                                S r   )rx   ry   r   r1   r   r&   r-   r    r$   r,   r*   r   s
             r;   r   z$AsyncRuns.submit_tool_outputs_stream  s   *  	a_U[__``` 	geXaeefff +)R:G0TW
 
 "	
 **E	EEEEE $0"  /I  )+Q[el   "#78  
 
  +7-BoSmSoSoppppr=   )r5   r   )r5   r   )r5   r   r   )rO   rP   rQ   rP   rI   ra   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rO   rP   rQ   rP   rI   rf   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rO   rP   rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rI   ri   rJ   rU   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   r   r   )rO   rP   r   r   r   r   r   r   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   r   r+   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )rQ   rP   rE   rR   rF   rR   rG   rS   rH   rR   rJ   rU   rO   rP   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   r   )r{   rP   rO   rP   rI   ra   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r{   rP   rO   rP   rI   rf   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r{   rP   rO   rP   r   r   rI   ri   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r   r   r{   rP   rO   rP   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r   r   r{   rP   rO   rP   r   r+   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   )r   r   r{   rP   rO   rP   r   r   rK   rV   rL   rW   rM   rX   rN   rY   r5   r   r   r\   r=   r;   r3   r3   4  s       ( ( ( _( . . . _. 4 4 4 _4  =F1:09*36?CL )-$("&;D!; ; ; ; ; X;z  =F1:09*3CL )-$("&;D!; ; ; ; ; X;z  =F1:09*3CL )-$("&;D!; ; ; ; ; X;z ]N#nh%?@@ =F1:09*3FOCL )-$("&;D!)
 )
 )
 )
 )
 A@)
d )-$("&;D#
 #
 #
 #
 #
 #
T 1: )-$("&;D*
 *
 *
 *
 *
 *
` !*!* )3< )-$("&;DA
 A
 A
 A
 A
 A
T )-$("&;D#
 #
 #
 #
 #
 #
J 
 =F1:09*3CL )-$("&;D     X( 
 =F1:09*3CL
 )-$("&;D!     X2 =F1:09*3CL<@ )-$("&;D!4q 4q 4q 4q 4q 4ql  7@ )-$("&;D# # # # # X#J  )-$("&;D# # # # # X#J  )-$("&;D# # # # # X#J ]K02Y2Y2YZZ GP )-$("&;D"
 "
 "
 "
 "
 [Z"
H  )-$("&;D     X&  )-$("&;D     X4 =A )-$("&;D1q 1q 1q 1q 1q 1q 1q 1qr=   c                  .    e Zd Zd	dZed
d            ZdS )r>   runsr2   r5   Nonec                |   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r7   )	_runsr
   to_raw_response_wrapperr^   r   r   r   r   r   r:   r  s     r;   __init__zRunsWithRawResponse.__init__6  s    
&>K
 
 )@M
 
 '>K
 
 %<I
 
	 '>K
 
 $4#K$$
 $
   r=   r   c                4    t          | j        j                  S r7   )r   r  r<   r9   s    r;   r<   zRunsWithRawResponse.stepsL  s    #DJ$4555r=   Nr  r2   r5   r  )r5   r   r   r   r   r  r   r<   r\   r=   r;   r>   r>   5  sH        
 
 
 
, 6 6 6 _6 6 6r=   r>   c                  .    e Zd Zd	dZed
d            ZdS )r   r  r3   r5   r  c                |   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r7   )	r  r
   async_to_raw_response_wrapperr^   r   r   r   r   r   r  s     r;   r  z!AsyncRunsWithRawResponse.__init__R  s    
&DK
 
 )FM
 
 'DK
 
 %BI
 
	 'DK
 
 $4#Q$$
 $
   r=   r   c                4    t          | j        j                  S r7   )r   r  r<   r9   s    r;   r<   zAsyncRunsWithRawResponse.stepsh  s    ()9:::r=   Nr  r3   r5   r  )r5   r   r
  r\   r=   r;   r   r   Q  sH        
 
 
 
, ; ; ; _; ; ;r=   r   c                  .    e Zd Zd	dZed
d            ZdS )rA   r  r2   r5   r  c                @   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r7   )r  r   r^   r   r   r   r   r   r  s     r;   r  z"RunsWithStreamingResponse.__init__n  s    
2K
 
 5M
 
 3K
 
 1I
 
	 3K
 
 $@$$
 $
   r=   r   c                4    t          | j        j                  S r7   )r   r  r<   r9   s    r;   r<   zRunsWithStreamingResponse.steps  s    )$**:;;;r=   Nr	  )r5   r   r
  r\   r=   r;   rA   rA   m  sH        
 
 
 
, < < < _< < <r=   rA   c                  .    e Zd Zd	dZed
d            ZdS )r   r  r3   r5   r  c                @   || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r7   )r  r   r^   r   r   r   r   r   r  s     r;   r  z'AsyncRunsWithStreamingResponse.__init__  s    
8K
 
 ;M
 
 9K
 
 7I
 
	 9K
 
 $F$$
 $
   r=   r   c                4    t          | j        j                  S r7   )r   r  r<   r9   s    r;   r<   z$AsyncRunsWithStreamingResponse.steps  s    .tz/?@@@r=   Nr  )r5   r   r
  r\   r=   r;   r   r     sN        
 
 
 
, A A A _A A Ar=   r   )F
__future__r   typingr   r   r   	functoolsr   typing_extensionsr   httpx r
   r<   r   r   r   r   r   r   _typesr   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
_streamingr   r    
paginationr!   r"   
types.betar#   r$   _base_clientr%   r&   lib.streamingr'   r(   r)   r*   r+   r,   types.beta.threadsr-   r.   r/   r0   r1   __all__r2   r3   r>   r   rA   r   r\   r=   r;   <module>r(     s   # " " " " " / / / / / / / / / /       % % % % % %  " " " " " "                B A A A A A A A A A A A A A         
 ) ( ( ( ( ( < < < < < < < < [ [ [ [ [ [ [ [ / / / / / / / / ; ; ; ; ; ; ; ; D D D D D D D D                                    ;
zg zg zg zg zg? zg zg zgz~q ~q ~q ~q ~q  ~q ~q ~qB6 6 6 6 6 6 6 68; ; ; ; ; ; ; ;8< < < < < < < <8A A A A A A A A A Ar=   