6
6
"net/http"
7
7
)
8
8
9
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
10
+ // This API will be officially deprecated on January 4th, 2024.
11
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
9
12
type FineTuneRequest struct {
10
13
TrainingFile string `json:"training_file"`
11
14
ValidationFile string `json:"validation_file,omitempty"`
@@ -21,6 +24,9 @@ type FineTuneRequest struct {
21
24
Suffix string `json:"suffix,omitempty"`
22
25
}
23
26
27
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
28
+ // This API will be officially deprecated on January 4th, 2024.
29
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
24
30
type FineTune struct {
25
31
ID string `json:"id"`
26
32
Object string `json:"object"`
@@ -37,35 +43,54 @@ type FineTune struct {
37
43
UpdatedAt int64 `json:"updated_at"`
38
44
}
39
45
46
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
47
+ // This API will be officially deprecated on January 4th, 2024.
48
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
40
49
type FineTuneEvent struct {
41
50
Object string `json:"object"`
42
51
CreatedAt int64 `json:"created_at"`
43
52
Level string `json:"level"`
44
53
Message string `json:"message"`
45
54
}
46
55
56
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
57
+ // This API will be officially deprecated on January 4th, 2024.
58
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
47
59
type FineTuneHyperParams struct {
48
60
BatchSize int `json:"batch_size"`
49
61
LearningRateMultiplier float64 `json:"learning_rate_multiplier"`
50
62
Epochs int `json:"n_epochs"`
51
63
PromptLossWeight float64 `json:"prompt_loss_weight"`
52
64
}
53
65
66
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
67
+ // This API will be officially deprecated on January 4th, 2024.
68
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
54
69
type FineTuneList struct {
55
70
Object string `json:"object"`
56
71
Data []FineTune `json:"data"`
57
72
}
73
+
74
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
75
+ // This API will be officially deprecated on January 4th, 2024.
76
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
58
77
type FineTuneEventList struct {
59
78
Object string `json:"object"`
60
79
Data []FineTuneEvent `json:"data"`
61
80
}
62
81
82
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
83
+ // This API will be officially deprecated on January 4th, 2024.
84
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
63
85
type FineTuneDeleteResponse struct {
64
86
ID string `json:"id"`
65
87
Object string `json:"object"`
66
88
Deleted bool `json:"deleted"`
67
89
}
68
90
91
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
92
+ // This API will be officially deprecated on January 4th, 2024.
93
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
69
94
func (c * Client ) CreateFineTune (ctx context.Context , request FineTuneRequest ) (response FineTune , err error ) {
70
95
urlSuffix := "/fine-tunes"
71
96
req , err := c .newRequest (ctx , http .MethodPost , c .fullURL (urlSuffix ), withBody (request ))
@@ -78,6 +103,9 @@ func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (r
78
103
}
79
104
80
105
// CancelFineTune cancel a fine-tune job.
106
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
107
+ // This API will be officially deprecated on January 4th, 2024.
108
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
81
109
func (c * Client ) CancelFineTune (ctx context.Context , fineTuneID string ) (response FineTune , err error ) {
82
110
req , err := c .newRequest (ctx , http .MethodPost , c .fullURL ("/fine-tunes/" + fineTuneID + "/cancel" ))
83
111
if err != nil {
@@ -88,6 +116,9 @@ func (c *Client) CancelFineTune(ctx context.Context, fineTuneID string) (respons
88
116
return
89
117
}
90
118
119
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
120
+ // This API will be officially deprecated on January 4th, 2024.
121
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
91
122
func (c * Client ) ListFineTunes (ctx context.Context ) (response FineTuneList , err error ) {
92
123
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL ("/fine-tunes" ))
93
124
if err != nil {
@@ -98,6 +129,9 @@ func (c *Client) ListFineTunes(ctx context.Context) (response FineTuneList, err
98
129
return
99
130
}
100
131
132
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
133
+ // This API will be officially deprecated on January 4th, 2024.
134
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
101
135
func (c * Client ) GetFineTune (ctx context.Context , fineTuneID string ) (response FineTune , err error ) {
102
136
urlSuffix := fmt .Sprintf ("/fine-tunes/%s" , fineTuneID )
103
137
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL (urlSuffix ))
@@ -109,6 +143,9 @@ func (c *Client) GetFineTune(ctx context.Context, fineTuneID string) (response F
109
143
return
110
144
}
111
145
146
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
147
+ // This API will be officially deprecated on January 4th, 2024.
148
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
112
149
func (c * Client ) DeleteFineTune (ctx context.Context , fineTuneID string ) (response FineTuneDeleteResponse , err error ) {
113
150
req , err := c .newRequest (ctx , http .MethodDelete , c .fullURL ("/fine-tunes/" + fineTuneID ))
114
151
if err != nil {
@@ -119,6 +156,9 @@ func (c *Client) DeleteFineTune(ctx context.Context, fineTuneID string) (respons
119
156
return
120
157
}
121
158
159
+ // Deprecated: On August 22nd, 2023, OpenAI announced the deprecation of the /v1/fine-tunes API.
160
+ // This API will be officially deprecated on January 4th, 2024.
161
+ // OpenAI recommends to migrate to the new fine tuning API implemented in fine_tuning_job.go.
122
162
func (c * Client ) ListFineTuneEvents (ctx context.Context , fineTuneID string ) (response FineTuneEventList , err error ) {
123
163
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL ("/fine-tunes/" + fineTuneID + "/events" ))
124
164
if err != nil {
0 commit comments