o
    ?Hhu                     @  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                   @  @   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 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"   \/home/air/sanwanet/gpt-api/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?Union[str, List[str], Iterable[ModerationMultiModalInputParam]]r+   &Union[str, ModerationModel] | 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 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r0   r+   r,   r-   r.   r/   bodyoptionscast_to)_postr   r   ModerationCreateParamsr   r   r!   r0   r+   r,   r-   r.   r/   r"   r"   r#   create/   s   "zModerations.create)r   r   )r   r&   r0   r1   r+   r2   r,   r3   r-   r4   r.   r5   r/   r6   r   r   __name__
__module____qualname__r   r$   r(   r	   rB   r"   r"   r"   r#   r          	c                   @  r   )r   r   AsyncModerationsWithRawResponsec                 C  r   r   )rI   r    r"   r"   r#   r$   b   r%   z"AsyncModerations.with_raw_response%AsyncModerationsWithStreamingResponsec                 C  r   r'   )rJ   r    r"   r"   r#   r(   l   r)   z(AsyncModerations.with_streaming_responseNr*   r0   r1   r+   r2   r,   r3   r-   r4   r.   r5   r/   r6   r   c             	     s:   | j dt||dtjI dH t||||dtdI dH S )r7   r8   r9   Nr:   r;   )r?   r   r   r@   r   r   rA   r"   r"   r#   rB   u   s   "zAsyncModerations.create)r   rI   )r   rJ   rC   rD   r"   r"   r"   r#   r   a   rH   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_wrapperrB   r!   rL   r"   r"   r#   __init__      
z#ModerationsWithRawResponse.__init__NrL   r   r   rM   rE   rF   rG   rS   r"   r"   r"   r#   r          r   c                   @  rK   )	rI   rL   r   r   rM   c                 C  rN   rO   )rP   r   async_to_raw_response_wrapperrB   rR   r"   r"   r#   rS      rT   z(AsyncModerationsWithRawResponse.__init__NrL   r   r   rM   rV   r"   r"   r"   r#   rI      rW   rI   c                   @  rK   )	r&   rL   r   r   rM   c                 C     || _ t|j| _d S rO   )rP   r   rB   rR   r"   r"   r#   rS         
z)ModerationsWithStreamingResponse.__init__NrU   rV   r"   r"   r"   r#   r&      rW   r&   c                   @  rK   )	rJ   rL   r   r   rM   c                 C  rZ   rO   )rP   r   rB   rR   r"   r"   r#   rS      r[   z.AsyncModerationsWithStreamingResponse.__init__NrY   rV   r"   r"   r"   r#   rJ      rW   rJ   )+
__future__r   typingr   r   r   httpx r   typesr   _typesr	   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   rI   r&   rJ   r"   r"   r"   r#   <module>   s*   FF			