o
    +Âif  ã                   @  s  d dl mZ d dlmZmZ d dl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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ÚUnion)ÚLiteralNé   )Ú_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)ÚModerationCreateResponseÚModerationsÚAsyncModerationsc                   @  ó@   e Zd Zeddd„ƒZeddd„ƒZeddded	œddd„ZdS )r   ÚreturnÚModerationsWithRawResponsec                 C  ó   t | ƒS ©N)r   ©Úself© r    úU/var/www/html/corbot_env/lib/python3.10/site-packages/openai/resources/moderations.pyÚwith_raw_response   ó   zModerations.with_raw_responseÚ ModerationsWithStreamingResponsec                 C  r   r   )r$   r   r    r    r!   Úwith_streaming_response!   r#   z#Moderations.with_streaming_responseN©ÚmodelÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚinputúUnion[str, List[str]]r'   úRUnion[str, Literal['text-moderation-latest', 'text-moderation-stable']] | NotGivenr(   úHeaders | Noner)   úQuery | Noner*   úBody | Noner+   ú'float | httpx.Timeout | None | NotGivenr   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©r,   r'   ©r(   r)   r*   r+   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚModerationCreateParamsr   r   ©r   r,   r'   r(   r)   r*   r+   r    r    r!   Úcreate%   s   #þûÿôzModerations.create)r   r   )r   r$   ©r,   r-   r'   r.   r(   r/   r)   r0   r*   r1   r+   r2   r   r   ©Ú__name__Ú
__module__Ú__qualname__r   r"   r%   r	   r>   r    r    r    r!   r      ó    öc                   @  r   )r   r   ÚAsyncModerationsWithRawResponsec                 C  r   r   )rE   r   r    r    r!   r"   Y   r#   z"AsyncModerations.with_raw_responseÚ%AsyncModerationsWithStreamingResponsec                 C  r   r   )rF   r   r    r    r!   r%   ]   r#   z(AsyncModerations.with_streaming_responseNr&   r,   r-   r'   r.   r(   r/   r)   r0   r*   r1   r+   r2   r   c             	   Ã  s:   �| j dt||dœtjƒI dH t||||d�td�I dH S )r3   r4   r5   Nr6   r7   )r;   r   r   r<   r   r   r=   r    r    r!   r>   a   s   €#þûÿôzAsyncModerations.create)r   rE   )r   rF   r?   r@   r    r    r    r!   r   X   rD   c                   @  ó   e Zd Zddd„ZdS )	r   Úmoderationsr   r   ÚNonec                 C  ó   || _ t |j¡| _d S r   )Ú_moderationsr   Úto_raw_response_wrapperr>   ©r   rH   r    r    r!   Ú__init__•   ó   
ÿz#ModerationsWithRawResponse.__init__N©rH   r   r   rI   ©rA   rB   rC   rN   r    r    r    r!   r   ”   ó    r   c                   @  rG   )	rE   rH   r   r   rI   c                 C  rJ   r   )rK   r   Úasync_to_raw_response_wrapperr>   rM   r    r    r!   rN   ž   rO   z(AsyncModerationsWithRawResponse.__init__N©rH   r   r   rI   rQ   r    r    r    r!   rE   �   rR   rE   c                   @  rG   )	r$   rH   r   r   rI   c                 C  ó   || _ t|jƒ| _d S r   )rK   r   r>   rM   r    r    r!   rN   §   ó   
ÿz)ModerationsWithStreamingResponse.__init__NrP   rQ   r    r    r    r!   r$   ¦   rR   r$   c                   @  rG   )	rF   rH   r   r   rI   c                 C  rU   r   )rK   r   r>   rM   r    r    r!   rN   °   rV   z.AsyncModerationsWithStreamingResponse.__init__NrT   rQ   r    r    r    r!   rF   ¯   rR   rF   )(Ú
__future__r   Útypingr   r   Útyping_extensionsr   ÚhttpxÚ r   Útypesr   Ú_typesr	   r
   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Ú types.moderation_create_responser   Ú__all__r   r   r   rE   r$   rF   r    r    r    r!   Ú<module>   s(   <<			