o
    ØRWj   ã                   @  s4  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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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)ÚUnionÚIterableNé   )Ú_legacy_response)Úmoderation_create_params)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚSequenceNotStrÚomitÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)Úmake_request_options)ÚModerationModel)ÚModerationCreateResponse)ÚModerationMultiModalInputParamÚModerationsÚAsyncModerationsc                   @  óD   e Zd 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   ú]
    Given text and/or image inputs, classifies if those inputs are potentially harmful.
    ÚreturnÚModerationsWithRawResponsec                 C  ó   t | ƒS ©a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r    ©Úself© r%   úk/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/openai/resources/moderations.pyÚwith_raw_response   ó   zModerations.with_raw_responseÚ ModerationsWithStreamingResponsec                 C  r!   ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r)   r#   r%   r%   r&   Úwith_streaming_response'   ó   z#Moderations.with_streaming_responseN©ÚmodelÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚinputúIUnion[str, SequenceNotStr[str], Iterable[ModerationMultiModalInputParam]]r.   ú"Union[str, ModerationModel] | Omitr/   úHeaders | Noner0   úQuery | Noner1   úBody | Noner2   ú'float | httpx.Timeout | None | NotGivenr   c             
   C  s2   | j dt||dœtjƒt||||ddid�td�S )áª  Classifies if text and/or image inputs are potentially harmful.

        Learn more in
        the [moderation guide](https://platform.openai.com/docs/guides/moderation).

        Args:
          input: Input (or inputs) to classify. Can be a single string, an array of strings, or
              an array of multi-modal input objects similar to other models.

          model: The content moderation model you would like to use. Learn more in
              [the moderation guide](https://platform.openai.com/docs/guides/moderation), and
              learn about available models
              [here](https://platform.openai.com/docs/models#moderation).

          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©r3   r.   Úbearer_authT©r/   r0   r1   r2   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚModerationCreateParamsr   r   ©r$   r3   r.   r/   r0   r1   r2   r%   r%   r&   Úcreate0   s"   "þûûðzModerations.create)r   r    )r   r)   ©r3   r4   r.   r5   r/   r6   r0   r7   r1   r8   r2   r9   r   r   ©
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r'   r+   r   r   rG   r%   r%   r%   r&   r      ó    	öc                   @  r   )r   r   r   ÚAsyncModerationsWithRawResponsec                 C  r!   r"   )rO   r#   r%   r%   r&   r'   k   r(   z"AsyncModerations.with_raw_responseÚ%AsyncModerationsWithStreamingResponsec                 C  r!   r*   )rP   r#   r%   r%   r&   r+   u   r,   z(AsyncModerations.with_streaming_responseNr-   r3   r4   r.   r5   r/   r6   r0   r7   r1   r8   r2   r9   r   c             
   Ã  s@   �| j dt||dœtjƒI dH t||||ddid�td�I dH S )r:   r;   r<   Nr=   Tr>   r@   )rD   r   r   rE   r   r   rF   r%   r%   r&   rG   ~   s$   €"þûûðzAsyncModerations.create)r   rO   )r   rP   rH   rI   r%   r%   r%   r&   r   f   rN   c                   @  ó   e Zd Zddd„ZdS )	r    Úmoderationsr   r   ÚNonec                 C  ó   || _ t |j¡| _d S ©N)Ú_moderationsr   Úto_raw_response_wrapperrG   ©r$   rR   r%   r%   r&   Ú__init__µ   ó   
ÿz#ModerationsWithRawResponse.__init__N©rR   r   r   rS   ©rJ   rK   rL   rY   r%   r%   r%   r&   r    ´   ó    r    c                   @  rQ   )	rO   rR   r   r   rS   c                 C  rT   rU   )rV   r   Úasync_to_raw_response_wrapperrG   rX   r%   r%   r&   rY   ¾   rZ   z(AsyncModerationsWithRawResponse.__init__N©rR   r   r   rS   r\   r%   r%   r%   r&   rO   ½   r]   rO   c                   @  rQ   )	r)   rR   r   r   rS   c                 C  ó   || _ t|jƒ| _d S rU   )rV   r   rG   rX   r%   r%   r&   rY   Ç   ó   
ÿz)ModerationsWithStreamingResponse.__init__Nr[   r\   r%   r%   r%   r&   r)   Æ   r]   r)   c                   @  rQ   )	rP   rR   r   r   rS   c                 C  r`   rU   )rV   r   rG   rX   r%   r%   r&   rY   Ð   ra   z.AsyncModerationsWithStreamingResponse.__init__Nr_   r\   r%   r%   r%   r&   rP   Ï   r]   rP   )-Ú
__future__r   Útypingr   r   ÚhttpxÚ r   Útypesr   Ú_typesr   r	   r
   r   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Útypes.moderation_modelr   Ú types.moderation_create_responser   Ú(types.moderation_multi_modal_input_paramr   Ú__all__r   r   r    rO   r)   rP   r%   r%   r%   r&   Ú<module>   s*   (NN			