a
    f                     @  s  d dl mZ d dlmZmZ d dlZddlmZ ddlm	Z	 ddl
mZmZmZmZmZ ddl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 ddlmZ ddl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%G dd dZ&G dd dZ'dS )    )annotations)ListUnionN   )_legacy_response)moderation_create_params)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)ModerationModel)ModerationCreateResponseModerationsAsyncModerationsc                	   @  sX   e Zd ZeddddZeddddZeddded	d
dddddddddZdS )r   ModerationsWithRawResponsereturnc                 C  s   t | S N)r   self r   U/var/www/ai-form-bot/venv/lib/python3.9/site-packages/openai/resources/moderations.pywith_raw_response   s    zModerations.with_raw_response ModerationsWithStreamingResponsec                 C  s   t | S r   )r"   r   r   r   r    with_streaming_response   s    z#Moderations.with_streaming_responseNmodelextra_headersextra_query
extra_bodytimeoutUnion[str, List[str]]&Union[str, ModerationModel] | 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 is potentially harmful.

        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r1   r%   r&   r'   r(   r)   bodyoptionsZcast_to)_postr   r   ModerationCreateParamsr   r   r   r1   r%   r&   r'   r(   r)   r   r   r    create#   s    #zModerations.create__name__
__module____qualname__r   r!   r#   r   r<   r   r   r   r    r      s   c                	   @  sX   e Zd ZeddddZeddddZeddded	d
dddddddddZdS )r   AsyncModerationsWithRawResponser   c                 C  s   t | S r   )rA   r   r   r   r    r!   W   s    z"AsyncModerations.with_raw_response%AsyncModerationsWithStreamingResponsec                 C  s   t | S r   )rB   r   r   r   r    r#   [   s    z(AsyncModerations.with_streaming_responseNr$   r*   r+   r,   r-   r.   r/   r   r0   c             	     s8   | j dt||dtjI dH t||||dtdI dH S )r2   r3   r4   Nr5   r6   )r9   r   r   r:   r   r   r;   r   r   r    r<   _   s    #zAsyncModerations.creater=   r   r   r   r    r   V   s   c                   @  s   e Zd ZdddddZdS )r   r   Nonemoderationsr   c                 C  s   || _ t|j| _d S r   )_moderationsr   Zto_raw_response_wrapperr<   r   rE   r   r   r    __init__   s    z#ModerationsWithRawResponse.__init__Nr>   r?   r@   rH   r   r   r   r    r      s   r   c                   @  s   e Zd ZdddddZdS )rA   r   rC   rD   c                 C  s   || _ t|j| _d S r   )rF   r   Zasync_to_raw_response_wrapperr<   rG   r   r   r    rH      s    z(AsyncModerationsWithRawResponse.__init__NrI   r   r   r   r    rA      s   rA   c                   @  s   e Zd ZdddddZdS )r"   r   rC   rD   c                 C  s   || _ t|j| _d S r   )rF   r   r<   rG   r   r   r    rH      s    z)ModerationsWithStreamingResponse.__init__NrI   r   r   r   r    r"      s   r"   c                   @  s   e Zd ZdddddZdS )rB   r   rC   rD   c                 C  s   || _ t|j| _d S r   )rF   r   r<   rG   r   r   r    rH      s    z.AsyncModerationsWithStreamingResponse.__init__NrI   r   r   r   r    rB      s   rB   )(
__future__r   typingr   r   Zhttpx r   typesr   _typesr   r	   r
   r   r   Z_utilsr   r   _compatr   Z	_resourcer   r   	_responser   r   Z_base_clientr   Ztypes.moderation_modelr   Z types.moderation_create_responser   __all__r   r   r   rA   r"   rB   r   r   r   r    <module>   s&   <<			