a
    !f                     @  s   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rd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 )    )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                	      sV   e Zd ZU ded< ddd fddZeddded	d
dddddddddZ  ZS )r   ModerationsWithRawResponsewith_raw_responser   Noneclientreturnc                   s   t  | t| | _d S N)super__init__r   r   selfr   	__class__ ]/var/www/html/python-backend/venv/lib/python3.9/site-packages/openai/resources/moderations.pyr!      s    zModerations.__init__Nmodelextra_headersextra_query
extra_bodytimeoutUnion[str, List[str]]RUnion[str, Literal['text-moderation-latest', 'text-moderation-stable']] | NotGivenHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenr   inputr)   r*   r+   r,   r-   r   c             	   C  s,   | j dt||dtjt||||dtd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r5   r)   r*   r+   r,   r-   bodyoptionsZcast_to_postr   r	   ZModerationCreateParamsr   r   r#   r5   r)   r*   r+   r,   r-   r&   r&   r'   create   s    #zModerations.create__name__
__module____qualname____annotations__r!   r
   r@   __classcell__r&   r&   r$   r'   r      s   
c                	      sV   e Zd ZU ded< ddd fddZeddded	d
dddddddddZ  ZS )r   AsyncModerationsWithRawResponser   r   r   r   c                   s   t  | t| | _d S r   )r    r!   rG   r   r"   r$   r&   r'   r!   T   s    zAsyncModerations.__init__Nr(   r.   r/   r0   r1   r2   r3   r   r4   c             	     s2   | j dt||dtjt||||dtdI dH S )r6   r7   r8   r9   r:   Nr=   r?   r&   r&   r'   r@   X   s    #zAsyncModerations.createrA   r&   r&   r$   r'   r   Q   s   
c                   @  s   e Zd ZdddddZdS )r   r   r   moderationsr   c                 C  s   t |j| _d S r   )r   r@   r#   rI   r&   r&   r'   r!      s    z#ModerationsWithRawResponse.__init__NrB   rC   rD   r!   r&   r&   r&   r'   r      s   r   c                   @  s   e Zd ZdddddZdS )rG   r   r   rH   c                 C  s   t |j| _d S r   )r   r@   rJ   r&   r&   r'   r!      s    z(AsyncModerationsWithRawResponse.__init__NrK   r&   r&   r&   r'   rG      s   rG   )$
__future__r   typingr   r   r   Ztyping_extensionsr   Zhttpxtypesr   r	   _typesr
   r   r   r   r   _utilsr   Z	_resourcer   r   	_responser   r   Z_base_clientr   Z_clientr   r   __all__r   r   r   rG   r&   r&   r&   r'   <module>   s    ::