
    +hy                       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rddlmZmZ ddgZ G d de      Z  G d de      Z! G d d      Z" G d d      Z#y)    )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            
           e Zd ZU ded<   d fdZ ej                  d      eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	d       Z xZ	S )
r   EditsWithRawResponsewith_raw_responsec                D    t         |   |       t        |       | _        y N)super__init__r   r   selfclient	__class__s     I/var/www/html/venv/lib/python3.12/site-packages/openai/resources/edits.pyr    zEdits.__init__   s     !5d!;    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timeoutc       
            | j                  dt        ||||||dt        j                        t	        |||	|
      t
              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instructionmodelr)   r*   r+   r,   r-   r.   r/   r0   bodyoptionscast_to_postr   r
   EditCreateParamsr   r	   r"   r5   r6   r)   r*   r+   r,   r-   r.   r/   r0   s              r%   createzEdits.create   sb    h zz #.""#." #33
 )+Q[el !  
 	
r&   )r#   r   returnNoner5   strr6   zEUnion[str, Literal['text-davinci-edit-001', 'code-davinci-edit-001']]r)   zOptional[str] | NotGivenr*   zOptional[int] | NotGivenr+   Optional[float] | NotGivenr,   rE   r-   zHeaders | Noner.   zQuery | Noner/   zBody | Noner0   z'float | httpx.Timeout | None | NotGivenrA   r	   
__name__
__module____qualname____annotations__r    typing_extensions
deprecatedr   r@   __classcell__r$   s   @r%   r   r      s    ++< "!! 	e +4&/2;,5 )-$("&;DB
 B
 U	B

 (B
 $B
 0B
 *B
 &B
 "B
  B
 9B
 
B
B
r&   c            
           e Zd ZU ded<   d fdZ ej                  d      eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	d       Z xZ	S )
r   AsyncEditsWithRawResponser   c                D    t         |   |       t        |       | _        y r   )r   r    rP   r   r!   s     r%   r    zAsyncEdits.__init__j   s     !:4!@r&   r'   Nr(   c       
           K   | j                  dt        ||||||dt        j                        t	        |||	|
      t
               d{   S 7 w)r2   r3   r4   r7   r8   Nr<   r?   s              r%   r@   zAsyncEdits.createn   sp     h ZZ #.""#." #33
 )+Q[el !   
 
 	
 
s   A	AAA)r#   r   rA   rB   rC   rF   rN   s   @r%   r   r   g   s    00A "!! 	e +4&/2;,5 )-$("&;DB
 B
 U	B

 (B
 $B
 0B
 *B
 &B
 "B
  B
 9B
 
B
B
r&   c                      e Zd ZddZy)r   c                8    t        |j                        | _        y r   )r   r@   r"   editss     r%   r    zEditsWithRawResponse.__init__   s    -LL
r&   N)rV   r   rA   rB   rG   rH   rI   r     r&   r%   r   r          
r&   r   c                      e Zd ZddZy)rP   c                8    t        |j                        | _        y r   )r   r@   rU   s     r%   r    z"AsyncEditsWithRawResponse.__init__   s    3LL
r&   N)rV   r   rA   rB   rW   rX   r&   r%   rP   rP      rY   r&   rP   )$
__future__r   rK   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   rP   rX   r&   r%   <module>rg      sq    #  1 1 %  , > > $ 9 N /-L
!L
O L
^L
! L
^
 

 
r&   