U
    ·ÜŸju  ã                   @  s,  d dl mZ d dlmZ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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ÚIterableNé   )Ú_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)ÚModerationMultiModalInputParamÚ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 ©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!   ú@/tmp/pip-unpacked-wheel-2qj3ofc_/openai/resources/moderations.pyÚwith_raw_response   s    zModerations.with_raw_responseÚ ModerationsWithStreamingResponsec                 C  s   t | ƒS ©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&   s    z#Moderations.with_streaming_responseN©ÚmodelÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutú?Union[str, List[str], Iterable[ModerationMultiModalInputParam]]ú&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 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©r4   r(   ©r)   r*   r+   r,   ©ÚbodyÚoptionsZcast_to)Ú_postr   r   ÚModerationCreateParamsr   r   ©r    r4   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   )rD   r   r!   r!   r"   r#   b   s    z"AsyncModerations.with_raw_responseÚ%AsyncModerationsWithStreamingResponsec                 C  s   t | ƒS r%   )rE   r   r!   r!   r"   r&   l   s    z(AsyncModerations.with_streaming_responseNr'   r-   r.   r/   r0   r1   r2   r   r3   c             	   Ã  s8   | j dt||dœtjƒI dH t||||d�td�I dH S )r5   r6   r7   Nr8   r9   )r<   r   r   r=   r   r   r>   r!   r!   r"   r?   u   s     "þû   ÿôzAsyncModerations.creater@   r!   r!   r!   r"   r   a   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 ©N)Ú_moderationsr   Zto_raw_response_wrapperr?   ©r    rH   r!   r!   r"   Ú__init__¨   s    ÿz#ModerationsWithRawResponse.__init__N©rA   rB   rC   rL   r!   r!   r!   r"   r   §   s   r   c                   @  s   e Zd Zdddœdd„ZdS )rD   r   rF   rG   c                 C  s   || _ t |j¡| _d S rI   )rJ   r   Zasync_to_raw_response_wrapperr?   rK   r!   r!   r"   rL   ±   s    ÿz(AsyncModerationsWithRawResponse.__init__NrM   r!   r!   r!   r"   rD   °   s   rD   c                   @  s   e Zd Zdddœdd„ZdS )r$   r   rF   rG   c                 C  s   || _ t|jƒ| _d S rI   )rJ   r   r?   rK   r!   r!   r"   rL   º   s    ÿz)ModerationsWithStreamingResponse.__init__NrM   r!   r!   r!   r"   r$   ¹   s   r$   c                   @  s   e Zd Zdddœdd„ZdS )rE   r   rF   rG   c                 C  s   || _ t|jƒ| _d S rI   )rJ   r   r?   rK   r!   r!   r"   rL   Ã   s    ÿz.AsyncModerationsWithStreamingResponse.__init__NrM   r!   r!   r!   r"   rE   Â   s   rE   )+Ú
__future__r   Útypingr   r   r   ZhttpxÚ r   Útypesr   Ú_typesr	   r
   r   r   r   Ú_utilsr   r   Ú_compatr   Z	_resourcer   r   Ú	_responser   r   Z_base_clientr   Ztypes.moderation_modelr   Z types.moderation_create_responser   Z(types.moderation_multi_modal_input_paramr   Ú__all__r   r   r   rD   r$   rE   r!   r!   r!   r"   Ú<module>   s(   FF			