o
    ¨Ýjl,  ã                   @  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"   úe/var/www/html/chatgpt/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 | httpx2.Timeout | None | NotGivenr   c             
   C  s4   | j dt|||dœtjƒt||||ddi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://developers.openai.com/api/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://developers.openai.com/api/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+   Úbearer_authT©r,   r-   r.   r/   Úsecurity©ÚbodyÚoptionsZcast_to)Ú_postr   r   ÚGraderRunParamsr   r   ©r!   r0   r2   r+   r,   r-   r.   r/   r"   r"   r#   Úrun+   s$   &ýúûïzGraders.run©r,   r-   r.   r/   úgrader_validate_params.Graderr   c             
   C  s0   | j dtd|itjƒt||||ddi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<   Tr=   r?   )rB   r   r   ÚGraderValidateParamsr   r   ©r!   r0   r,   r-   r.   r/   r"   r"   r#   Úvalidatee   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   rG   r,   r5   r-   r6   r.   r7   r/   r8   r   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r(   r
   r   rE   rL   r"   r"   r"   r#   r      ó"    	õ@÷c                   @  r   )%r   r   r   ÚAsyncGradersWithRawResponsec                 C  r   r   )rU   r    r"   r"   r#   r$   �   r%   zAsyncGraders.with_raw_responseÚ!AsyncGradersWithStreamingResponsec                 C  r   r'   )rV   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             
   Ã  sB   �| j dt|||dœtjƒI dH t||||ddid�td�I dH S )r9   r:   r;   Nr<   Tr=   r?   )rB   r   r   rC   r   r   rD   r"   r"   r#   rE   ¢   s&   €&ýúûïzAsyncGraders.runrF   rG   r   c             
   Ã  s>   �| j dtd|itjƒI dH t||||ddid�td�I dH S )rH   rI   r0   Nr<   Tr=   r?   )rB   r   r   rJ   r   r   rK   r"   r"   r#   rL   Ü   s   €ûözAsyncGraders.validate)r   rU   )r   rV   rM   rN   rO   r"   r"   r"   r#   r   Œ   rT   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_wrapperrE   rL   ©r!   rX   r"   r"   r#   Ú__init__  ó   ÿ
ÿzGradersWithRawResponse.__init__N©rX   r   r   rY   ©rP   rQ   rR   r^   r"   r"   r"   r#   r     ó    r   c                   @  rW   )	rU   rX   r   r   rY   c                 C  rZ   r[   )r\   r   Zasync_to_raw_response_wrapperrE   rL   r]   r"   r"   r#   r^     r_   z$AsyncGradersWithRawResponse.__init__N©rX   r   r   rY   ra   r"   r"   r"   r#   rU     rb   rU   c                   @  rW   )	r&   rX   r   r   rY   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S r[   )r\   r   rE   rL   r]   r"   r"   r#   r^     ó   ÿ
ÿz%GradersWithStreamingResponse.__init__Nr`   ra   r"   r"   r"   r#   r&     rb   r&   c                   @  rW   )	rV   rX   r   r   rY   c                 C  rd   r[   )r\   r   rE   rL   r]   r"   r"   r#   r^   (  re   z*AsyncGradersWithStreamingResponse.__init__Nrc   ra   r"   r"   r"   r#   rV   '  rb   rV   )(Ú
__future__r   Zhttpx2Ú 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   rU   r&   rV   r"   r"   r"   r#   Ú<module>   s&   $ww