2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Union , Iterable , Optional
5
+ from typing import Dict , Union , Iterable , Optional
6
6
from typing_extensions import Literal
7
7
8
8
import httpx
30
30
make_request_options ,
31
31
)
32
32
from ....types .fine_tuning import job_list_params , job_create_params , job_list_events_params
33
+ from ....types .shared_params .metadata import Metadata
33
34
from ....types .fine_tuning .fine_tuning_job import FineTuningJob
34
35
from ....types .fine_tuning .fine_tuning_job_event import FineTuningJobEvent
35
36
@@ -67,6 +68,7 @@ def create(
67
68
training_file : str ,
68
69
hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
69
70
integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
71
+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
70
72
method : job_create_params .Method | NotGiven = NOT_GIVEN ,
71
73
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
72
74
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -114,6 +116,13 @@ def create(
114
116
115
117
integrations: A list of integrations to enable for your fine-tuning job.
116
118
119
+ metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
120
+ for storing additional information about the object in a structured format, and
121
+ querying for objects via API or the dashboard.
122
+
123
+ Keys are strings with a maximum length of 64 characters. Values are strings with
124
+ a maximum length of 512 characters.
125
+
117
126
method: The method used for fine-tuning.
118
127
119
128
seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -155,6 +164,7 @@ def create(
155
164
"training_file" : training_file ,
156
165
"hyperparameters" : hyperparameters ,
157
166
"integrations" : integrations ,
167
+ "metadata" : metadata ,
158
168
"method" : method ,
159
169
"seed" : seed ,
160
170
"suffix" : suffix ,
@@ -208,6 +218,7 @@ def list(
208
218
* ,
209
219
after : str | NotGiven = NOT_GIVEN ,
210
220
limit : int | NotGiven = NOT_GIVEN ,
221
+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
211
222
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
212
223
# The extra values given here take precedence over values defined on the client or passed to this method.
213
224
extra_headers : Headers | None = None ,
@@ -223,6 +234,9 @@ def list(
223
234
224
235
limit: Number of fine-tuning jobs to retrieve.
225
236
237
+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
238
+ Alternatively, set `metadata=null` to indicate no metadata.
239
+
226
240
extra_headers: Send extra headers
227
241
228
242
extra_query: Add additional query parameters to the request
@@ -243,6 +257,7 @@ def list(
243
257
{
244
258
"after" : after ,
245
259
"limit" : limit ,
260
+ "metadata" : metadata ,
246
261
},
247
262
job_list_params .JobListParams ,
248
263
),
@@ -365,6 +380,7 @@ async def create(
365
380
training_file : str ,
366
381
hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
367
382
integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
383
+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
368
384
method : job_create_params .Method | NotGiven = NOT_GIVEN ,
369
385
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
370
386
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -412,6 +428,13 @@ async def create(
412
428
413
429
integrations: A list of integrations to enable for your fine-tuning job.
414
430
431
+ metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
432
+ for storing additional information about the object in a structured format, and
433
+ querying for objects via API or the dashboard.
434
+
435
+ Keys are strings with a maximum length of 64 characters. Values are strings with
436
+ a maximum length of 512 characters.
437
+
415
438
method: The method used for fine-tuning.
416
439
417
440
seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -453,6 +476,7 @@ async def create(
453
476
"training_file" : training_file ,
454
477
"hyperparameters" : hyperparameters ,
455
478
"integrations" : integrations ,
479
+ "metadata" : metadata ,
456
480
"method" : method ,
457
481
"seed" : seed ,
458
482
"suffix" : suffix ,
@@ -506,6 +530,7 @@ def list(
506
530
* ,
507
531
after : str | NotGiven = NOT_GIVEN ,
508
532
limit : int | NotGiven = NOT_GIVEN ,
533
+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
509
534
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
510
535
# The extra values given here take precedence over values defined on the client or passed to this method.
511
536
extra_headers : Headers | None = None ,
@@ -521,6 +546,9 @@ def list(
521
546
522
547
limit: Number of fine-tuning jobs to retrieve.
523
548
549
+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
550
+ Alternatively, set `metadata=null` to indicate no metadata.
551
+
524
552
extra_headers: Send extra headers
525
553
526
554
extra_query: Add additional query parameters to the request
@@ -541,6 +569,7 @@ def list(
541
569
{
542
570
"after" : after ,
543
571
"limit" : limit ,
572
+ "metadata" : metadata ,
544
573
},
545
574
job_list_params .JobListParams ,
546
575
),
0 commit comments