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