o
    ùT·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"   úm/home/dinkstrade/pdmp-scanner/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ÚoptionsÚ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?   )rC   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   rH   r,   r5   r-   r6   r.   r7   r/   r8   r   r   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r(   r
   r   rF   rM   r"   r"   r"   r#   r      ó"    	õ@÷c                   @  r   )%r   r   r   ÚAsyncGradersWithRawResponsec                 C  r   r   )rV   r    r"   r"   r#   r$   �   r%   zAsyncGraders.with_raw_responseÚ!AsyncGradersWithStreamingResponsec                 C  r   r'   )rW   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?   )rC   r   r   rD   r   r   rE   r"   r"   r#   rF   ¢   s&   €&ýúûïzAsyncGraders.runrG   rH   r   c             
   Ã  s>   �| j dtd|itjƒI dH t||||ddid�td�I dH S )rI   rJ   r0   Nr<   Tr=   r?   )rC   r   r   rK   r   r   rL   r"   r"   r#   rM   Ü   s   €ûözAsyncGraders.validate)r   rV   )r   rW   rN   rO   rP   r"   r"   r"   r#   r   Œ   rU   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_wrapperrF   rM   ©r!   rY   r"   r"   r#   Ú__init__  ó   ÿ
ÿzGradersWithRawResponse.__init__N©rY   r   r   rZ   ©rQ   rR   rS   r`   r"   r"   r"   r#   r     ó    r   c                   @  rX   )	rV   rY   r   r   rZ   c                 C  r[   r\   )r]   r   Úasync_to_raw_response_wrapperrF   rM   r_   r"   r"   r#   r`     ra   z$AsyncGradersWithRawResponse.__init__N©rY   r   r   rZ   rc   r"   r"   r"   r#   rV     rd   rV   c                   @  rX   )	r&   rY   r   r   rZ   c                 C  ó"   || _ t|jƒ| _t|jƒ| _d S r\   )r]   r   rF   rM   r_   r"   r"   r#   r`     ó   ÿ
ÿz%GradersWithStreamingResponse.__init__Nrb   rc   r"   r"   r"   r#   r&     rd   r&   c                   @  rX   )	rW   rY   r   r   rZ   c                 C  rg   r\   )r]   r   rF   rM   r_   r"   r"   r#   r`   (  rh   z*AsyncGradersWithStreamingResponse.__init__Nrf   rc   r"   r"   r"   r#   rW   '  rd   rW   )(Ú
__future__r   Úhttpx2Ú r   Ú_typesr   r   r   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   rV   r&   rW   r"   r"   r"   r#   Ú<module>   s&   $ww