o
    iR                     @  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%   V/home/kim/smarthome/.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inputIUnion[str, SequenceNotStr[str], Iterable[ModerationMultiModalInputParam]]r.   "Union[str, ModerationModel] | Omitr/   Headers | Noner0   Query | Noner1   Body | Noner2   'float | httpx.Timeout | None | NotGivenr   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r3   r.   r/   r0   r1   r2   bodyoptionsZ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   rD   r%   r%   r%   r&   r          	c                   @  r   )r   r   r   AsyncModerationsWithRawResponsec                 C  r!   r"   )rL   r#   r%   r%   r&   r'   g   r(   z"AsyncModerations.with_raw_response%AsyncModerationsWithStreamingResponsec                 C  r!   r*   )rM   r#   r%   r%   r&   r+   q   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tdI dH S )r:   r;   r<   Nr=   r>   )rA   r   r   rB   r   r   rC   r%   r%   r&   rD   z   s   "zAsyncModerations.create)r   rL   )r   rM   rE   rF   r%   r%   r%   r&   r   b   rK   c                   @     e Zd ZdddZdS )	r    moderationsr   r   Nonec                 C     || _ t|j| _d S N)_moderationsr   Zto_raw_response_wrapperrD   r$   rO   r%   r%   r&   __init__      
z#ModerationsWithRawResponse.__init__NrO   r   r   rP   rG   rH   rI   rU   r%   r%   r%   r&   r           r    c                   @  rN   )	rL   rO   r   r   rP   c                 C  rQ   rR   )rS   r   Zasync_to_raw_response_wrapperrD   rT   r%   r%   r&   rU      rV   z(AsyncModerationsWithRawResponse.__init__NrO   r   r   rP   rX   r%   r%   r%   r&   rL      rY   rL   c                   @  rN   )	r)   rO   r   r   rP   c                 C     || _ t|j| _d S rR   )rS   r   rD   rT   r%   r%   r&   rU         
z)ModerationsWithStreamingResponse.__init__NrW   rX   r%   r%   r%   r&   r)      rY   r)   c                   @  rN   )	rM   rO   r   r   rP   c                 C  r[   rR   )rS   r   rD   rT   r%   r%   r&   rU      r\   z.AsyncModerationsWithStreamingResponse.__init__NrZ   rX   r%   r%   r%   r&   rM      rY   rM   )-
__future__r   typingr   r   Zhttpx r   typesr   _typesr   r	   r
   r   r   r   r   r   Z_utilsr   r   Z_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    rL   r)   rM   r%   r%   r%   r&   <module>   s*   (JJ			