o
    Yi*                     @  s  d dl mZ d dlZddlmZ ddl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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 )    )annotationsN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)make_request_options)grader_run_paramsgrader_validate_params)GraderRunResponse)GraderValidateResponseGradersAsyncGradersc                   @  V   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ddedd#ddZ	dS )$r   returnGradersWithRawResponsec                 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!   a/home/app/Keep/.python/lib/python3.10/site-packages/openai/resources/fine_tuning/alpha/graders.pywith_raw_response      zGraders.with_raw_responseGradersWithStreamingResponsec                 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Graders.with_streaming_responseNitemextra_headersextra_query
extra_bodytimeoutgradergrader_run_params.Gradermodel_samplestrr*   object | Omitr+   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 )  
        Run a grader.

        Args:
          grader: The grader used for the fine-tuning job.

          model_sample: The model sample to be evaluated. This value will be used to populate the
              `sample` namespace. See
              [the guide](https://platform.openai.com/docs/guides/graders) for more details.
              The `output_json` variable will be populated if the model sample is a valid JSON
              string.

          item: The dataset item provided to the grader. This will be used to populate the
              `item` namespace. See
              [the guide](https://platform.openai.com/docs/guides/graders) for more details.

          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
        /fine_tuning/alpha/graders/runr/   r1   r*   r+   r,   r-   r.   bodyoptionsZcast_to)_postr   r   GraderRunParamsr   r   r    r/   r1   r*   r+   r,   r-   r.   r!   r!   r"   run)   s   %zGraders.runr;   grader_validate_params.Graderr   c             	   C  s*   | j dtd|itjt||||dtdS )  
        Validate a grader.

        Args:
          grader: The grader used for the fine-tuning job.

          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
        #/fine_tuning/alpha/graders/validater/   r;   r<   )r?   r   r   GraderValidateParamsr   r   r    r/   r+   r,   r-   r.   r!   r!   r"   validate^   s   zGraders.validate)r   r   )r   r%   r/   r0   r1   r2   r*   r3   r+   r4   r,   r5   r-   r6   r.   r7   r   r   r/   rC   r+   r4   r,   r5   r-   r6   r.   r7   r   r   
__name__
__module____qualname__r   r#   r'   r
   r   rB   rH   r!   r!   r!   r"   r           	;c                   @  r   )$r   r   AsyncGradersWithRawResponsec                 C  r   r   )rP   r   r!   r!   r"   r#      r$   zAsyncGraders.with_raw_response!AsyncGradersWithStreamingResponsec                 C  r   r&   )rQ   r   r!   r!   r"   r'      r(   z$AsyncGraders.with_streaming_responseNr)   r/   r0   r1   r2   r*   r3   r+   r4   r,   r5   r-   r6   r.   r7   r   c             	     s<   | j dt|||dtjI dH t||||dtdI dH S )r8   r9   r:   Nr;   r<   )r?   r   r   r@   r   r   rA   r!   r!   r"   rB      s   %zAsyncGraders.runr;   rC   r   c             	     s8   | j dtd|itjI dH t||||dtdI dH S )rD   rE   r/   Nr;   r<   )r?   r   r   rF   r   r   rG   r!   r!   r"   rH      s   zAsyncGraders.validate)r   rP   )r   rQ   rI   rJ   rK   r!   r!   r!   r"   r      rO   c                   @     e Zd ZdddZdS )	r   gradersr   r   Nonec                 C  &   || _ t|j| _t|j| _d S N)_gradersr   Zto_raw_response_wrapperrB   rH   r    rS   r!   r!   r"   __init__      
zGradersWithRawResponse.__init__NrS   r   r   rT   rL   rM   rN   rY   r!   r!   r!   r"   r          r   c                   @  rR   )	rP   rS   r   r   rT   c                 C  rU   rV   )rW   r   Zasync_to_raw_response_wrapperrB   rH   rX   r!   r!   r"   rY      rZ   z$AsyncGradersWithRawResponse.__init__NrS   r   r   rT   r\   r!   r!   r!   r"   rP      r]   rP   c                   @  rR   )	r%   rS   r   r   rT   c                 C  "   || _ t|j| _t|j| _d S rV   )rW   r   rB   rH   rX   r!   r!   r"   rY        
z%GradersWithStreamingResponse.__init__Nr[   r\   r!   r!   r!   r"   r%     r]   r%   c                   @  rR   )	rQ   rS   r   r   rT   c                 C  r_   rV   )rW   r   rB   rH   rX   r!   r!   r"   rY     r`   z*AsyncGradersWithStreamingResponse.__init__Nr^   r\   r!   r!   r!   r"   rQ     r]   rQ   )(
__future__r   Zhttpx r   _typesr   r   r   r   r	   r
   r   _utilsr   r   Z_compatr   Z	_resourcer   r   	_responser   r   Z_base_clientr   Ztypes.fine_tuning.alphar   r   Z+types.fine_tuning.alpha.grader_run_responser   Z0types.fine_tuning.alpha.grader_validate_responser   __all__r   r   r   rP   r%   rQ   r!   r!   r!   r"   <module>   s&   $ll