
    +h                       d dl m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)    )annotations)TYPE_CHECKINGListUnion)LiteralN   )ModerationCreateResponsemoderation_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ModerationsAsyncModerationsc                  \     e Zd ZU ded<   d fdZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )	r   ModerationsWithRawResponsewith_raw_responsec                D    t         |   |       t        |       | _        y N)super__init__r   r   selfclient	__class__s     O/var/www/html/venv/lib/python3.12/site-packages/openai/resources/moderations.pyr    zModerations.__init__   s     !;D!A    Nmodelextra_headersextra_query
extra_bodytimeoutc          
         | j                  dt        ||dt        j                        t	        ||||      t
              S )  
        Classifies if text violates OpenAI's Content Policy

        Args:
          input: The input text to classify

          model: Two content moderations models are available: `text-moderation-stable` and
              `text-moderation-latest`.

              The default is `text-moderation-latest` which will be automatically upgraded
              over time. This ensures you are always using our most accurate model. If you use
              `text-moderation-stable`, we will provide advanced notice before updating the
              model. Accuracy of `text-moderation-stable` may be slightly lower than for
              `text-moderation-latest`.

          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
        /moderationsinputr(   r)   r*   r+   r,   bodyoptionscast_to_postr   r
   ModerationCreateParamsr   r	   r"   r1   r(   r)   r*   r+   r,   s          r%   createzModerations.create   sV    F zz "" )?? )+Q[el -  
 	
r&   )r#   r   returnNoner1   zUnion[str, List[str]]r(   zRUnion[str, Literal['text-moderation-latest', 'text-moderation-stable']] | NotGivenr)   zHeaders | Noner*   zQuery | Noner+   zBody | Noner,   z'float | httpx.Timeout | None | NotGivenr<   r	   __name__
__module____qualname____annotations__r    r   r;   __classcell__r$   s   @r%   r   r      sp    11B en )-$("&;D0
 %0
 b	0
 &0
 "0
  0
 90
 
"0
r&   c                  \     e Zd ZU ded<   d fdZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )	r   AsyncModerationsWithRawResponser   c                D    t         |   |       t        |       | _        y r   )r   r    rG   r   r!   s     r%   r    zAsyncModerations.__init__T   s     !@!Fr&   Nr'   c          
        K   | j                  dt        ||dt        j                        t	        ||||      t
               d{   S 7 w)r.   r/   r0   r2   r3   Nr7   r:   s          r%   r;   zAsyncModerations.createX   sd     F ZZ "" )?? )+Q[el -   
 
 	
 
s   AAAA)r#   r   r<   r=   r>   r?   rE   s   @r%   r   r   Q   sp    66G en )-$("&;D0
 %0
 b	0
 &0
 "0
  0
 90
 
"0
r&   c                      e Zd ZddZy)r   c                8    t        |j                        | _        y r   )r   r;   r"   moderationss     r%   r    z#ModerationsWithRawResponse.__init__   s    -
r&   N)rM   r   r<   r=   r@   rA   rB   r     r&   r%   r   r          
r&   r   c                      e Zd ZddZy)rG   c                8    t        |j                        | _        y r   )r   r;   rL   s     r%   r    z(AsyncModerationsWithRawResponse.__init__   s    3
r&   N)rM   r   r<   r=   rN   rO   r&   r%   rG   rG      rP   r&   rG   )$
__future__r   typingr   r   r   typing_extensionsr   httpxtypesr	   r
   _typesr   r   r   r   r   _utilsr   	_resourcer   r   	_responser   r   _base_clientr   _clientr   r   __all__r   r   r   rG   rO   r&   r%   <module>r_      sk    # - - %  F > > $ 9 N /-,
-7
/ 7
t7
' 7
t
 

 
r&   