o
    Cjiy                     @  s   d dl mZ d dlZd dlmZmZmZ d dlmZ d dl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mZ dd
lmZmZ ddlmZ erZd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Z#dS )    )annotationsN)TYPE_CHECKINGUnionOptional)Literal   )Editedit_create_params)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)make_request_options)OpenAIAsyncOpenAIEdits
AsyncEditsc                
      P   e Zd ZU ded< d" fddZed	eeeed
d
d
edd#d d!Z  Z	S )$r   EditsWithRawResponsewith_raw_responseclientr   returnNonec                      t  | t| | _d S N)super__init__r   r   selfr   	__class__ m/var/www/html/Resume-Parser/resume-parser-inhouse/venv/lib/python3.10/site-packages/openai/resources/edits.pyr"         zEdits.__init__The Edits API is deprecated; please use Chat Completions instead.

https://openai.com/blog/gpt-4-api-general-availability#deprecation-of-the-edits-api
Ninputntemperaturetop_pextra_headersextra_query
extra_bodytimeoutinstructionstrmodelEUnion[str, Literal['text-davinci-edit-001', 'code-davinci-edit-001']]r,   Optional[str] | NotGivenr-   Optional[int] | NotGivenr.   Optional[float] | NotGivenr/   r0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGivenr   c       
      
   C  s4   | j dt||||||dtjt|||	|
dtdS )  
        Creates a new edit for the provided input, instruction, and parameters.

        Args:
          instruction: The instruction that tells the model how to edit the prompt.

          model: ID of the model to use. You can use the `text-davinci-edit-001` or
              `code-davinci-edit-001` model with this endpoint.

          input: The input text to use as a starting point for the edit.

          n: How many edits to generate for the input and instruction.

          temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
              make the output more random, while lower values like 0.2 will make it more
              focused and deterministic.

              We generally recommend altering this or `top_p` but not both.

          top_p: An alternative to sampling with temperature, called nucleus sampling, where the
              model considers the results of the tokens with top_p probability mass. So 0.1
              means only the tokens comprising the top 10% probability mass are considered.

              We generally recommend altering this or `temperature` but not both.

          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
        /editsr4   r6   r,   r-   r.   r/   r0   r1   r2   r3   bodyoptionscast_to_postr   r	   EditCreateParamsr   r   r$   r4   r6   r,   r-   r.   r/   r0   r1   r2   r3   r'   r'   r(   create   s"   4zEdits.create)r   r   r   r   r4   r5   r6   r7   r,   r8   r-   r9   r.   r:   r/   r:   r0   r;   r1   r<   r2   r=   r3   r>   r   r   
__name__
__module____qualname____annotations__r"   typing_extensions
deprecatedr
   rK   __classcell__r'   r'   r%   r(   r         
 c                
      r   )$r   AsyncEditsWithRawResponser   r   r   r   r   c                   r   r    )r!   r"   rV   r   r#   r%   r'   r(   r"   j   r)   zAsyncEdits.__init__r*   Nr+   r4   r5   r6   r7   r,   r8   r-   r9   r.   r:   r/   r0   r;   r1   r<   r2   r=   r3   r>   r   c       
      
     s<   | j dt||||||dtjt|||	|
dtdI dH S )r?   r@   rA   rB   rC   NrG   rJ   r'   r'   r(   rK   n   s$   4zAsyncEdits.create)r   r   r   r   rL   rM   r'   r'   r%   r(   r   g   rU   c                   @     e Zd ZdddZdS )	r   editsr   r   r   c                 C     t |j| _d S r    )r   rK   r$   rX   r'   r'   r(   r"         
zEditsWithRawResponse.__init__N)rX   r   r   r   rN   rO   rP   r"   r'   r'   r'   r(   r          r   c                   @  rW   )	rV   rX   r   r   r   c                 C  rY   r    )r   rK   rZ   r'   r'   r(   r"      r[   z"AsyncEditsWithRawResponse.__init__N)rX   r   r   r   r\   r'   r'   r'   r(   rV      r]   rV   )$
__future__r   rR   typingr   r   r   r   httpxtypesr   r	   _typesr
   r   r   r   r   _utilsr   	_resourcer   r   	_responser   r   _base_clientr   _clientr   r   __all__r   r   r   rV   r'   r'   r'   r(   <module>   s$   OO