o
    ¨Ý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(   úc/var/www/html/chatgpt/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©ÚoptionsZ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   rT   ú
str | OmitrU   rV   ú
int | OmitrW   ú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:   )rT   rU   r2   rV   rW   rH   TrI   )ÚpagerM   Úmodel)	rN   Ú_get_api_listr   r   r   r   r   r   ÚStepListParams©r'   r:   r9   rT   rU   r2   rV   rW   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   rT   rX   rU   rX   r2   r;   rV   rY   rW   rZ   r3   r<   r4   r=   r5   r>   r6   r?   r"   r[   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r*   r.   Útyping_extensionsÚ
deprecatedr   r   rR   rc   r(   r(   r(   r)   r      ó0    	ô;ñc                   @  r    ),r   r!   r"   ÚAsyncStepsWithRawResponsec                 C  r$   r%   )rn   r&   r(   r(   r)   r*   Â   r+   zAsyncSteps.with_raw_responseÚAsyncStepsWithStreamingResponsec                 C  r$   r-   )ro   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   )rN   rO   r   r   r   r   rP   r   rQ   r(   r(   r)   rR   Õ   s2   €#üúñzAsyncSteps.retrieverS   rT   rX   rU   rV   rY   rW   rZ   ú1AsyncPaginator[RunStep, AsyncCursorPage[RunStep]]c       
         C  r\   r]   )	rN   r`   r   r   r   r   r   r   ra   rb   r(   r(   r)   rc     rd   zAsyncSteps.list)r"   rn   )r"   ro   re   )r:   r8   r9   r8   rT   rX   rU   rX   r2   r;   rV   rY   rW   rZ   r3   r<   r4   r=   r5   r>   r6   r?   r"   rp   rf   r(   r(   r(   r)   r   ¿   rm   c                   @  ó   e Zd Zddd„ZdS )	r#   Ústepsr   r"   ÚNonec                 C  ó&   || _ t |j¡| _t |j¡| _d S ©N)Ú_stepsr   Zto_raw_response_wrapperrR   rc   ©r'   rr   r(   r(   r)   Ú__init__e  ó   ÿÿÿÿzStepsWithRawResponse.__init__N©rr   r   r"   rs   ©rg   rh   ri   rx   r(   r(   r(   r)   r#   d  ó    r#   c                   @  rq   )	rn   rr   r   r"   rs   c                 C  rt   ru   )rv   r   Zasync_to_raw_response_wrapperrR   rc   rw   r(   r(   r)   rx   u  ry   z"AsyncStepsWithRawResponse.__init__N©rr   r   r"   rs   r{   r(   r(   r(   r)   rn   t  r|   rn   c                   @  rq   )	r,   rr   r   r"   rs   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S ru   )rv   r   rR   rc   rw   r(   r(   r)   rx   …  ó   ÿÿÿÿz#StepsWithStreamingResponse.__init__Nrz   r{   r(   r(   r(   r)   r,   „  r|   r,   c                   @  rq   )	ro   rr   r   r"   rs   c                 C  r~   ru   )rv   r   rR   rc   rw   r(   r(   r)   rx   •  r   z(AsyncStepsWithStreamingResponse.__init__Nr}   r{   r(   r(   r(   r)   ro   ”  r|   ro   )1Ú
__future__r   rk   Útypingr   r   Zhttpx2Ú r   Ú_typesr   r   r	   r
   r   r   r   Z_utilsr   r   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.threads.runsr   r   Z types.beta.threads.runs.run_stepr   Z(types.beta.threads.runs.run_step_includer   Ú__all__r   r   r#   rn   r,   ro   r(   r(   r(   r)   Ú<module>   s2   $ & &