MCPcopy
hub / github.com/openai/openai-python / run

Method run

src/openai/resources/fine_tuning/alpha/graders.py:43–98  ·  view source on GitHub ↗

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/

(
        self,
        *,
        grader: grader_run_params.Grader,
        model_sample: str,
        item: object | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    )

Source from the content-addressed store, hash-verified

41 return GradersWithStreamingResponse(self)
42
43 def run(
44 self,
45 *,
46 grader: grader_run_params.Grader,
47 model_sample: str,
48 item: object | Omit = omit,
49 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
50 # The extra values given here take precedence over values defined on the client or passed to this method.
51 extra_headers: Headers | None = None,
52 extra_query: Query | None = None,
53 extra_body: Body | None = None,
54 timeout: float | httpx.Timeout | None | NotGiven = not_given,
55 ) -> GraderRunResponse:
56 """
57 Run a grader.
58
59 Args:
60 grader: The grader used for the fine-tuning job.
61
62 model_sample: The model sample to be evaluated. This value will be used to populate the
63 `sample` namespace. See
64 [the guide](https://platform.openai.com/docs/guides/graders) for more details.
65 The `output_json` variable will be populated if the model sample is a valid JSON
66 string.
67
68 item: The dataset item provided to the grader. This will be used to populate the
69 `item` namespace. See
70 [the guide](https://platform.openai.com/docs/guides/graders) for more details.
71
72 extra_headers: Send extra headers
73
74 extra_query: Add additional query parameters to the request
75
76 extra_body: Add additional JSON properties to the request
77
78 timeout: Override the client-level default timeout for this request, in seconds
79 """
80 return self._post(
81 "/fine_tuning/alpha/graders/run",
82 body=maybe_transform(
83 {
84 "grader": grader,
85 "model_sample": model_sample,
86 "item": item,
87 },
88 grader_run_params.GraderRunParams,
89 ),
90 options=make_request_options(
91 extra_headers=extra_headers,
92 extra_query=extra_query,
93 extra_body=extra_body,
94 timeout=timeout,
95 security={"bearer_auth": True},
96 ),
97 cast_to=GraderRunResponse,
98 )
99
100 def validate(

Callers 15

test_pydantic_v1Function · 0.45
mainFunction · 0.45
test_method_runMethod · 0.45
test_raw_response_runMethod · 0.45
test_method_runMethod · 0.45
test_raw_response_runMethod · 0.45
speech_to_text.pyFile · 0.45
streaming.pyFile · 0.45

Calls 2

maybe_transformFunction · 0.85
make_request_optionsFunction · 0.85

Tested by 9

test_pydantic_v1Function · 0.36
test_method_runMethod · 0.36
test_raw_response_runMethod · 0.36
test_method_runMethod · 0.36
test_raw_response_runMethod · 0.36