o
    Cji^T                     @  s0  d dl mZ d dlmZmZmZ d dlZddlmZm	Z	m
Z
mZ ddl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 dd
lmZmZ ddlmZmZ ddlm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( ertddl)m*Z*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Z0dS )    )annotations)TYPE_CHECKINGListOptionalN   )Runs	AsyncRunsRunsWithRawResponseAsyncRunsWithRawResponse)MessagesAsyncMessagesMessagesWithRawResponseAsyncMessagesWithRawResponse   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)ThreadThreadDeletedthread_create_paramsthread_update_paramsthread_create_and_run_params)make_request_options)Run)OpenAIAsyncOpenAIThreadsAsyncThreadsc                
         e Zd ZU ded< ded< ded< d4 fddZeedddedd5ddZdddedd6d d!Zeddded"d7d#d$Zdddedd8d&d'Z	eeeeeddded(	d9d2d3Z
  ZS ):r#   r   runsr   messagesThreadsWithRawResponsewith_raw_responseclientr!   returnNonec                   .   t  | t|| _t|| _t| | _d S N)super__init__r   r&   r   r'   r(   r)   selfr*   	__class__ |/var/www/html/Resume-Parser/resume-parser-inhouse/venv/lib/python3.10/site-packages/openai/resources/beta/threads/threads.pyr0   )      

zThreads.__init__Nr'   metadataextra_headersextra_query
extra_bodytimeout-List[thread_create_params.Message] | NotGivenr9   Optional[object] | NotGivenr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr   c             	   C  s<   ddi|pi }| j dt||dtjt||||dtdS )	  
        Create a thread.

        Args:
          messages: A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
              start the thread with.

          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
        OpenAI-Betaassistants=v1/threadsr'   r9   r:   r;   r<   r=   bodyoptionscast_to_postr   r   ThreadCreateParamsr   r   r2   r'   r9   r:   r;   r<   r=   r5   r5   r6   create/   s    zThreads.createrI   	thread_idstrc                C  2   ddi|pi }| j d| t||||dtdS )G  
        Retrieves a thread.

        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
        rE   rF   	/threads/rI   rL   rM   _getr   r   r2   rS   r:   r;   r<   r=   r5   r5   r6   retrieve_      zThreads.retriever9   r:   r;   r<   r=   c             	   C  s@   ddi|pi }| j d| td|itjt||||dtdS )  
        Modifies a thread.

        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
        rE   rF   rW   r9   rI   rJ   rO   r   r   ThreadUpdateParamsr   r   r2   rS   r9   r:   r;   r<   r=   r5   r5   r6   update   s   zThreads.updater   c                C  rU   )D  
        Delete a thread.

        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
        rE   rF   rW   rI   rX   _deleter   r   r[   r5   r5   r6   delete   r]   zThreads.delete	instructionsr9   modelthreadtoolsr:   r;   r<   r=   assistant_idri   Optional[str] | NotGivenrj   rk   .thread_create_and_run_params.Thread | NotGivenrl   <Optional[List[thread_create_and_run_params.Tool]] | NotGivenr    c       
      
   C  sD   ddi|pi }| j dt||||||dtjt|||	|
dtdS )  
        Create a thread and run it in one request.

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

          instructions: Override the default system message 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.

          thread: If no thread is provided, an empty thread will be created.

          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
        rE   rF   /threads/runsrm   ri   r9   rj   rk   rl   rI   rJ   rO   r   r   ThreadCreateAndRunParamsr   r    r2   rm   ri   r9   rj   rk   rl   r:   r;   r<   r=   r5   r5   r6   create_and_run   s$   2zThreads.create_and_run)r*   r!   r+   r,   r'   r>   r9   r?   r:   r@   r;   rA   r<   rB   r=   rC   r+   r   rS   rT   r:   r@   r;   rA   r<   rB   r=   rC   r+   r   rS   rT   r9   r?   r:   r@   r;   rA   r<   rB   r=   rC   r+   r   rS   rT   r:   r@   r;   rA   r<   rB   r=   rC   r+   r   rm   rT   ri   rn   r9   r?   rj   rn   rk   ro   rl   rp   r:   r@   r;   rA   r<   rB   r=   rC   r+   r    __name__
__module____qualname____annotations__r0   r   rR   r\   rc   rg   rw   __classcell__r5   r5   r3   r6   r#   $   L   
 	6$-$c                
      r%   ):r$   r   r&   r   r'   AsyncThreadsWithRawResponser)   r*   r"   r+   r,   c                   r-   r.   )r/   r0   r   r&   r   r'   r   r)   r1   r3   r5   r6   r0     r7   zAsyncThreads.__init__Nr8   r>   r9   r?   r:   r@   r;   rA   r<   rB   r=   rC   r   c             	     sD   ddi|pi }| j dt||dtjt||||dtdI dH S )rD   rE   rF   rG   rH   rI   rJ   NrN   rQ   r5   r5   r6   rR     s    zAsyncThreads.createrI   rS   rT   c                  :   ddi|pi }| j d| t||||dtdI dH S )rV   rE   rF   rW   rI   rX   NrY   r[   r5   r5   r6   r\   H     zAsyncThreads.retriever^   c             	     sH   ddi|pi }| j d| td|itjt||||dtdI dH S )r_   rE   rF   rW   r9   rI   rJ   Nr`   rb   r5   r5   r6   rc   h  s   zAsyncThreads.updater   c                  r   )rd   rE   rF   rW   rI   rX   Nre   r[   r5   r5   r6   rg     r   zAsyncThreads.deleterh   rm   ri   rn   rj   rk   ro   rl   rp   r    c       
      
     sL   ddi|pi }| j dt||||||dtjt|||	|
dtdI dH S )rq   rE   rF   rr   rs   rI   rJ   Nrt   rv   r5   r5   r6   rw     s&   2zAsyncThreads.create_and_run)r*   r"   r+   r,   rx   ry   rz   r{   r|   r}   r5   r5   r3   r6   r$     r   c                   @     e Zd ZdddZdS )	r(   threadsr#   r+   r,   c                 C  X   t |j| _t|j| _t|j| _t|j| _t|j| _t|j| _t|j	| _	d S r.   )
r	   r&   r   r'   r   rR   r\   rc   rg   rw   r2   r   r5   r5   r6   r0     "   
zThreadsWithRawResponse.__init__N)r   r#   r+   r,   r~   r   r   r0   r5   r5   r5   r6   r(         r(   c                   @  r   )	r   r   r$   r+   r,   c                 C  r   r.   )
r
   r&   r   r'   r   rR   r\   rc   rg   rw   r   r5   r5   r6   r0     r   z$AsyncThreadsWithRawResponse.__init__N)r   r$   r+   r,   r   r5   r5   r5   r6   r     r   r   )1
__future__r   typingr   r   r   httpxr&   r   r   r	   r
   r'   r   r   r   r   _typesr   r   r   r   r   _utilsr   	_resourcer   r   	_responser   r   
types.betar   r   r   r   r   _base_clientr   types.beta.threadsr    _clientr!   r"   __all__r#   r$   r(   r   r5   r5   r5   r6   <module>   s*    j j