Skip to content

Commit bebe361

Browse files
feat(api): Add reinforcement fine-tuning api support
1 parent b8e848d commit bebe361

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2048
-566
lines changed

.stats.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0ee6b36cf3cc278cef4199a6aec5f7d530a6c1f17a74830037e96d50ca1edc50.yml
3-
openapi_spec_hash: e8ec5f46bc0655b34f292422d58a60f6
4-
config_hash: d9b6b6e6bc85744663e300eebc482067
1+
configured_endpoints: 101
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-794a6ed3c3d3d77887564755168056af8a426b17cf1ec721e3a300503dc22a41.yml
3+
openapi_spec_hash: 25a81c220713cd5b0bafc221d1dfa79a
4+
config_hash: 0b768ed1b56c6d82816f0fa40dc4aaf5

api.md

+49-3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,21 @@ Methods:
225225

226226
# FineTuning
227227

228+
## Methods
229+
230+
Types:
231+
232+
```python
233+
from openai.types.fine_tuning import (
234+
DpoHyperparameters,
235+
DpoMethod,
236+
ReinforcementHyperparameters,
237+
ReinforcementMethod,
238+
SupervisedHyperparameters,
239+
SupervisedMethod,
240+
)
241+
```
242+
228243
## Jobs
229244

230245
Types:
@@ -246,6 +261,8 @@ Methods:
246261
- <code title="get /fine_tuning/jobs">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list</a>(\*\*<a href="src/openai/types/fine_tuning/job_list_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">SyncCursorPage[FineTuningJob]</a></code>
247262
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">cancel</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
248263
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">list_events</a>(fine_tuning_job_id, \*\*<a href="src/openai/types/fine_tuning/job_list_events_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job_event.py">SyncCursorPage[FineTuningJobEvent]</a></code>
264+
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/pause">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">pause</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
265+
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/resume">client.fine_tuning.jobs.<a href="./src/openai/resources/fine_tuning/jobs/jobs.py">resume</a>(fine_tuning_job_id) -> <a href="./src/openai/types/fine_tuning/fine_tuning_job.py">FineTuningJob</a></code>
249266

250267
### Checkpoints
251268

@@ -279,6 +296,38 @@ Methods:
279296
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.fine_tuning.checkpoints.permissions.<a href="./src/openai/resources/fine_tuning/checkpoints/permissions.py">retrieve</a>(fine_tuned_model_checkpoint, \*\*<a href="src/openai/types/fine_tuning/checkpoints/permission_retrieve_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/checkpoints/permission_retrieve_response.py">PermissionRetrieveResponse</a></code>
280297
- <code title="delete /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}">client.fine_tuning.checkpoints.permissions.<a href="./src/openai/resources/fine_tuning/checkpoints/permissions.py">delete</a>(permission_id, \*, fine_tuned_model_checkpoint) -> <a href="./src/openai/types/fine_tuning/checkpoints/permission_delete_response.py">PermissionDeleteResponse</a></code>
281298

299+
## Alpha
300+
301+
### Graders
302+
303+
Types:
304+
305+
```python
306+
from openai.types.fine_tuning.alpha import GraderRunResponse, GraderValidateResponse
307+
```
308+
309+
Methods:
310+
311+
- <code title="post /fine_tuning/alpha/graders/run">client.fine_tuning.alpha.graders.<a href="./src/openai/resources/fine_tuning/alpha/graders.py">run</a>(\*\*<a href="src/openai/types/fine_tuning/alpha/grader_run_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/alpha/grader_run_response.py">GraderRunResponse</a></code>
312+
- <code title="post /fine_tuning/alpha/graders/validate">client.fine_tuning.alpha.graders.<a href="./src/openai/resources/fine_tuning/alpha/graders.py">validate</a>(\*\*<a href="src/openai/types/fine_tuning/alpha/grader_validate_params.py">params</a>) -> <a href="./src/openai/types/fine_tuning/alpha/grader_validate_response.py">GraderValidateResponse</a></code>
313+
314+
# Graders
315+
316+
## GraderModels
317+
318+
Types:
319+
320+
```python
321+
from openai.types.graders import (
322+
LabelModelGrader,
323+
MultiGrader,
324+
PythonGrader,
325+
ScoreModelGrader,
326+
StringCheckGrader,
327+
TextSimilarityGrader,
328+
)
329+
```
330+
282331
# VectorStores
283332

284333
Types:
@@ -738,10 +787,7 @@ Types:
738787
```python
739788
from openai.types import (
740789
EvalCustomDataSourceConfig,
741-
EvalLabelModelGrader,
742790
EvalStoredCompletionsDataSourceConfig,
743-
EvalStringCheckGrader,
744-
EvalTextSimilarityGrader,
745791
EvalCreateResponse,
746792
EvalRetrieveResponse,
747793
EvalUpdateResponse,

src/openai/resources/fine_tuning/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
JobsWithStreamingResponse,
99
AsyncJobsWithStreamingResponse,
1010
)
11+
from .alpha import (
12+
Alpha,
13+
AsyncAlpha,
14+
AlphaWithRawResponse,
15+
AsyncAlphaWithRawResponse,
16+
AlphaWithStreamingResponse,
17+
AsyncAlphaWithStreamingResponse,
18+
)
1119
from .checkpoints import (
1220
Checkpoints,
1321
AsyncCheckpoints,
@@ -38,6 +46,12 @@
3846
"AsyncCheckpointsWithRawResponse",
3947
"CheckpointsWithStreamingResponse",
4048
"AsyncCheckpointsWithStreamingResponse",
49+
"Alpha",
50+
"AsyncAlpha",
51+
"AlphaWithRawResponse",
52+
"AsyncAlphaWithRawResponse",
53+
"AlphaWithStreamingResponse",
54+
"AsyncAlphaWithStreamingResponse",
4155
"FineTuning",
4256
"AsyncFineTuning",
4357
"FineTuningWithRawResponse",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .alpha import (
4+
Alpha,
5+
AsyncAlpha,
6+
AlphaWithRawResponse,
7+
AsyncAlphaWithRawResponse,
8+
AlphaWithStreamingResponse,
9+
AsyncAlphaWithStreamingResponse,
10+
)
11+
from .graders import (
12+
Graders,
13+
AsyncGraders,
14+
GradersWithRawResponse,
15+
AsyncGradersWithRawResponse,
16+
GradersWithStreamingResponse,
17+
AsyncGradersWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"Graders",
22+
"AsyncGraders",
23+
"GradersWithRawResponse",
24+
"AsyncGradersWithRawResponse",
25+
"GradersWithStreamingResponse",
26+
"AsyncGradersWithStreamingResponse",
27+
"Alpha",
28+
"AsyncAlpha",
29+
"AlphaWithRawResponse",
30+
"AsyncAlphaWithRawResponse",
31+
"AlphaWithStreamingResponse",
32+
"AsyncAlphaWithStreamingResponse",
33+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from .graders import (
6+
Graders,
7+
AsyncGraders,
8+
GradersWithRawResponse,
9+
AsyncGradersWithRawResponse,
10+
GradersWithStreamingResponse,
11+
AsyncGradersWithStreamingResponse,
12+
)
13+
from ...._compat import cached_property
14+
from ...._resource import SyncAPIResource, AsyncAPIResource
15+
16+
__all__ = ["Alpha", "AsyncAlpha"]
17+
18+
19+
class Alpha(SyncAPIResource):
20+
@cached_property
21+
def graders(self) -> Graders:
22+
return Graders(self._client)
23+
24+
@cached_property
25+
def with_raw_response(self) -> AlphaWithRawResponse:
26+
"""
27+
This property can be used as a prefix for any HTTP method call to return
28+
the raw response object instead of the parsed content.
29+
30+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
31+
"""
32+
return AlphaWithRawResponse(self)
33+
34+
@cached_property
35+
def with_streaming_response(self) -> AlphaWithStreamingResponse:
36+
"""
37+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38+
39+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
40+
"""
41+
return AlphaWithStreamingResponse(self)
42+
43+
44+
class AsyncAlpha(AsyncAPIResource):
45+
@cached_property
46+
def graders(self) -> AsyncGraders:
47+
return AsyncGraders(self._client)
48+
49+
@cached_property
50+
def with_raw_response(self) -> AsyncAlphaWithRawResponse:
51+
"""
52+
This property can be used as a prefix for any HTTP method call to return
53+
the raw response object instead of the parsed content.
54+
55+
For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
56+
"""
57+
return AsyncAlphaWithRawResponse(self)
58+
59+
@cached_property
60+
def with_streaming_response(self) -> AsyncAlphaWithStreamingResponse:
61+
"""
62+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63+
64+
For more information, see https://www.github.com/openai/openai-python#with_streaming_response
65+
"""
66+
return AsyncAlphaWithStreamingResponse(self)
67+
68+
69+
class AlphaWithRawResponse:
70+
def __init__(self, alpha: Alpha) -> None:
71+
self._alpha = alpha
72+
73+
@cached_property
74+
def graders(self) -> GradersWithRawResponse:
75+
return GradersWithRawResponse(self._alpha.graders)
76+
77+
78+
class AsyncAlphaWithRawResponse:
79+
def __init__(self, alpha: AsyncAlpha) -> None:
80+
self._alpha = alpha
81+
82+
@cached_property
83+
def graders(self) -> AsyncGradersWithRawResponse:
84+
return AsyncGradersWithRawResponse(self._alpha.graders)
85+
86+
87+
class AlphaWithStreamingResponse:
88+
def __init__(self, alpha: Alpha) -> None:
89+
self._alpha = alpha
90+
91+
@cached_property
92+
def graders(self) -> GradersWithStreamingResponse:
93+
return GradersWithStreamingResponse(self._alpha.graders)
94+
95+
96+
class AsyncAlphaWithStreamingResponse:
97+
def __init__(self, alpha: AsyncAlpha) -> None:
98+
self._alpha = alpha
99+
100+
@cached_property
101+
def graders(self) -> AsyncGradersWithStreamingResponse:
102+
return AsyncGradersWithStreamingResponse(self._alpha.graders)

0 commit comments

Comments
 (0)