o
    ùT·jE  ã                   @  sP  d dl mZ d dl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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&m'Z' ddl(m)Z) ddgZ*G dd„ deƒZ+G dd„ deƒZ,G dd„ dƒZ-G dd„ dƒZ.G dd„ dƒZ/G dd„ dƒZ0dS )é    )ÚannotationsN)ÚList)ÚLiteralé   )Ú_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)ÚAsyncPaginatorÚmake_request_options)Ústep_list_paramsÚstep_retrieve_params)ÚRunStep)ÚRunStepIncludeÚStepsÚ
AsyncStepsc                   @  óx   e Zd ZdZed(dd„ƒZed)dd„ƒZe d	¡e	d
d
d
e
dœd*dd„ƒZe d	¡e	e	e	e	e	d
d
d
e
dœ	d+d&d'„ƒZd
S ),r   ú4Build Assistants that can call models and use tools.ÚreturnÚStepsWithRawResponsec                 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
        )r#   ©Úself© r(   úk/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/beta/threads/runs/steps.pyÚwith_raw_response   ó   zSteps.with_raw_responseÚStepsWithStreamingResponsec                 C  r$   ©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&   r(   r(   r)   Úwith_streaming_response'   ó   zSteps.with_streaming_responseú>The Assistants API is deprecated in favor of the Responses APIN©ÚincludeÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚstep_idÚstrÚ	thread_idÚrun_idr2   úList[RunStepInclude] | Omitr3   úHeaders | Noner4   úQuery | Noner5   úBody | Noner6   ú(float | httpx2.Timeout | None | NotGivenr   c          	   
   C  s‚   |s	t d|›�ƒ‚|st d|›�ƒ‚|st d|›�ƒ‚ddi|p!i ¥}| jtd|||d�t||||td|itjƒd	d
id�td�S )áÿ  
        Retrieves a run step.

        Args:
          include: A list of additional fields to include in the response. Currently the only
              supported value is `step_details.tool_calls[*].file_search.results[*].content`
              to fetch the file search result content.

              See the
              [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
              for more information.

          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
        ú8Expected a non-empty value for `thread_id` but received ú5Expected a non-empty value for `run_id` but received ú6Expected a non-empty value for `step_id` but received úOpenAI-Betaúassistants=v2ú2/threads/{thread_id}/runs/{run_id}/steps/{step_id}©r9   r:   r7   r2   Úbearer_authT©r3   r4   r5   r6   ÚqueryÚsecurity©ÚoptionsÚcast_to)Ú
ValueErrorÚ_getr   r   r   r   ÚStepRetrieveParamsr   ©	r'   r7   r9   r:   r2   r3   r4   r5   r6   r(   r(   r)   Úretrieve0   s0   #üúñzSteps.retrieve©	ÚafterÚbeforer2   ÚlimitÚorderr3   r4   r5   r6   rU   ú
str | OmitrV   rW   ú
int | OmitrX   úLiteral['asc', 'desc'] | OmitúSyncCursorPage[RunStep]c       
         C  ó|   |s	t 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 ©aÙ  
        Returns a list of run steps belonging to a run.

        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,
              starting with obj_foo, your subsequent call can include before=obj_foo in order
              to fetch the previous page of the list.

          include: A list of additional fields to include in the response. Currently the only
              supported value is `step_details.tool_calls[*].file_search.results[*].content`
              to fetch the file search result content.

              See the
              [file search tool documentation](https://developers.openai.com/api/docs/guides/tools-file-search#retrieval-customization)
              for more information.

          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
        rA   rB   rD   rE   z(/threads/{thread_id}/runs/{run_id}/steps)r9   r:   )rU   rV   r2   rW   rX   rH   TrI   )ÚpagerM   Úmodel)	rO   Ú_get_api_listr   r   r   r   r   r   ÚStepListParams©r'   r:   r9   rU   rV   r2   rW   rX   r3   r4   r5   r6   r(   r(   r)   Úlistl   ó4   6ûø
ñìz
Steps.list)r"   r#   )r"   r,   ©r7   r8   r9   r8   r:   r8   r2   r;   r3   r<   r4   r=   r5   r>   r6   r?   r"   r   )r:   r8   r9   r8   rU   rY   rV   rY   r2   r;   rW   rZ   rX   r[   r3   r<   r4   r=   r5   r>   r6   r?   r"   r\   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r*   r.   Útyping_extensionsÚ
deprecatedr   r   rS   rd   r(   r(   r(   r)   r      ó0    	ô;ñc                   @  r    ),r   r!   r"   ÚAsyncStepsWithRawResponsec                 C  r$   r%   )ro   r&   r(   r(   r)   r*   Â   r+   zAsyncSteps.with_raw_responseÚAsyncStepsWithStreamingResponsec                 C  r$   r-   )rp   r&   r(   r(   r)   r.   Ì   r/   z"AsyncSteps.with_streaming_responser0   Nr1   r7   r8   r9   r:   r2   r;   r3   r<   r4   r=   r5   r>   r6   r?   r   c          	   
   Ã  s�   �|s
t d|›�ƒ‚|st d|›�ƒ‚|st d|›�ƒ‚ddi|p"i ¥}| jtd|||d�t||||td|itjƒI d	H d
did�td�I d	H S )r@   rA   rB   rC   rD   rE   rF   rG   r2   NrH   TrI   rL   )rO   rP   r   r   r   r   rQ   r   rR   r(   r(   r)   rS   Õ   s2   €#üúñzAsyncSteps.retrieverT   rU   rY   rV   rW   rZ   rX   r[   ú1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]c       
         C  r]   r^   )	rO   ra   r   r   r   r   r   r   rb   rc   r(   r(   r)   rd     re   zAsyncSteps.list)r"   ro   )r"   rp   rf   )r:   r8   r9   r8   rU   rY   rV   rY   r2   r;   rW   rZ   rX   r[   r3   r<   r4   r=   r5   r>   r6   r?   r"   rq   rg   r(   r(   r(   r)   r   ¿   rn   c                   @  ó   e Zd Zddd„ZdS )	r#   Ústepsr   r"   ÚNonec                 C  ó&   || _ t |j¡| _t |j¡| _d S ©N)Ú_stepsr   Úto_raw_response_wrapperrS   rd   ©r'   rs   r(   r(   r)   Ú__init__e  ó   ÿÿÿÿzStepsWithRawResponse.__init__N©rs   r   r"   rt   ©rh   ri   rj   rz   r(   r(   r(   r)   r#   d  ó    r#   c                   @  rr   )	ro   rs   r   r"   rt   c                 C  ru   rv   )rw   r   Úasync_to_raw_response_wrapperrS   rd   ry   r(   r(   r)   rz   u  r{   z"AsyncStepsWithRawResponse.__init__N©rs   r   r"   rt   r}   r(   r(   r(   r)   ro   t  r~   ro   c                   @  rr   )	r,   rs   r   r"   rt   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S rv   )rw   r   rS   rd   ry   r(   r(   r)   rz   …  ó   ÿÿÿÿz#StepsWithStreamingResponse.__init__Nr|   r}   r(   r(   r(   r)   r,   „  r~   r,   c                   @  rr   )	rp   rs   r   r"   rt   c                 C  r�   rv   )rw   r   rS   rd   ry   r(   r(   r)   rz   •  r‚   z(AsyncStepsWithStreamingResponse.__init__Nr€   r}   r(   r(   r(   r)   rp   ”  r~   rp   )1Ú
__future__r   rl   Útypingr   r   Úhttpx2Ú r   Ú_typesr   r   r	   r
   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.threads.runsr   r   Ú types.beta.threads.runs.run_stepr   Ú(types.beta.threads.runs.run_step_includer   Ú__all__r   r   r#   ro   r,   rp   r(   r(   r(   r)   Ú<module>   s2   $ & &