o
    i*                     @  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                   @  Z   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	d	d	edd$dd Z
d	S )%r   IManage fine-tuning jobs to tailor a model to your specific training data.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"   d/home/kim/smarthome/.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 | 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r0   r2   r+   r,   r-   r.   r/   bodyoptionsZcast_to)_postr   r   GraderRunParamsr   r   r!   r0   r2   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/validater0   r<   r=   )r@   r   r   GraderValidateParamsr   r   r!   r0   r,   r-   r.   r/   r"   r"   r#   validate`   s   zGraders.validate)r   r   )r   r&   r0   r1   r2   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r   r   r0   rD   r,   r5   r-   r6   r.   r7   r/   r8   r   r   __name__
__module____qualname____doc__r   r$   r(   r
   r   rC   rI   r"   r"   r"   r#   r      "    	;c                   @  r   )%r   r   r   AsyncGradersWithRawResponsec                 C  r   r   )rR   r    r"   r"   r#   r$      r%   zAsyncGraders.with_raw_response!AsyncGradersWithStreamingResponsec                 C  r   r'   )rS   r    r"   r"   r#   r(      r)   z$AsyncGraders.with_streaming_responseNr*   r0   r1   r2   r3   r+   r4   r,   r5   r-   r6   r.   r7   r/   r8   r   c             	     s<   | j dt|||dtjI dH t||||dtdI dH S )r9   r:   r;   Nr<   r=   )r@   r   r   rA   r   r   rB   r"   r"   r#   rC      s   %zAsyncGraders.runr<   rD   r   c             	     s8   | j dtd|itjI dH t||||dtdI dH S )rE   rF   r0   Nr<   r=   )r@   r   r   rG   r   r   rH   r"   r"   r#   rI      s   zAsyncGraders.validate)r   rR   )r   rS   rJ   rK   rL   r"   r"   r"   r#   r      rQ   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_wrapperrC   rI   r!   rU   r"   r"   r#   __init__      
zGradersWithRawResponse.__init__NrU   r   r   rV   rM   rN   rO   r[   r"   r"   r"   r#   r          r   c                   @  rT   )	rR   rU   r   r   rV   c                 C  rW   rX   )rY   r   Zasync_to_raw_response_wrapperrC   rI   rZ   r"   r"   r#   r[      r\   z$AsyncGradersWithRawResponse.__init__NrU   r   r   rV   r^   r"   r"   r"   r#   rR      r_   rR   c                   @  rT   )	r&   rU   r   r   rV   c                 C  "   || _ t|j| _t|j| _d S rX   )rY   r   rC   rI   rZ   r"   r"   r#   r[   
     
z%GradersWithStreamingResponse.__init__Nr]   r^   r"   r"   r"   r#   r&   	  r_   r&   c                   @  rT   )	rS   rU   r   r   rV   c                 C  ra   rX   )rY   r   rC   rI   rZ   r"   r"   r#   r[     rb   z*AsyncGradersWithStreamingResponse.__init__Nr`   r^   r"   r"   r"   r#   rS     r_   rS   )(
__future__r   Zhttpx r   _typesr   r   r   r   r	   r
   r   Z_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   rR   r&   rS   r"   r"   r"   r#   <module>   s&   $nn