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
27
27
from ....pagination import SyncCursorPage , AsyncCursorPage
28
28
from ...._base_client import AsyncPaginator , make_request_options
29
29
from ....types .fine_tuning import job_list_params , job_create_params , job_list_events_params
30
+ from ....types .shared_params .metadata import Metadata
30
31
from ....types .fine_tuning .fine_tuning_job import FineTuningJob
31
32
from ....types .fine_tuning .fine_tuning_job_event import FineTuningJobEvent
32
33
@@ -64,6 +65,7 @@ def create(
64
65
training_file : str ,
65
66
hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
66
67
integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
68
+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
67
69
method : job_create_params .Method | NotGiven = NOT_GIVEN ,
68
70
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
69
71
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -111,6 +113,13 @@ def create(
111
113
112
114
integrations: A list of integrations to enable for your fine-tuning job.
113
115
116
+ metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
117
+ for storing additional information about the object in a structured format, and
118
+ querying for objects via API or the dashboard.
119
+
120
+ Keys are strings with a maximum length of 64 characters. Values are strings with
121
+ a maximum length of 512 characters.
122
+
114
123
method: The method used for fine-tuning.
115
124
116
125
seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -152,6 +161,7 @@ def create(
152
161
"training_file" : training_file ,
153
162
"hyperparameters" : hyperparameters ,
154
163
"integrations" : integrations ,
164
+ "metadata" : metadata ,
155
165
"method" : method ,
156
166
"seed" : seed ,
157
167
"suffix" : suffix ,
@@ -205,6 +215,7 @@ def list(
205
215
* ,
206
216
after : str | NotGiven = NOT_GIVEN ,
207
217
limit : int | NotGiven = NOT_GIVEN ,
218
+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
208
219
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
209
220
# The extra values given here take precedence over values defined on the client or passed to this method.
210
221
extra_headers : Headers | None = None ,
@@ -220,6 +231,9 @@ def list(
220
231
221
232
limit: Number of fine-tuning jobs to retrieve.
222
233
234
+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
235
+ Alternatively, set `metadata=null` to indicate no metadata.
236
+
223
237
extra_headers: Send extra headers
224
238
225
239
extra_query: Add additional query parameters to the request
@@ -240,6 +254,7 @@ def list(
240
254
{
241
255
"after" : after ,
242
256
"limit" : limit ,
257
+ "metadata" : metadata ,
243
258
},
244
259
job_list_params .JobListParams ,
245
260
),
@@ -362,6 +377,7 @@ async def create(
362
377
training_file : str ,
363
378
hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
364
379
integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
380
+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
365
381
method : job_create_params .Method | NotGiven = NOT_GIVEN ,
366
382
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
367
383
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -409,6 +425,13 @@ async def create(
409
425
410
426
integrations: A list of integrations to enable for your fine-tuning job.
411
427
428
+ metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
429
+ for storing additional information about the object in a structured format, and
430
+ querying for objects via API or the dashboard.
431
+
432
+ Keys are strings with a maximum length of 64 characters. Values are strings with
433
+ a maximum length of 512 characters.
434
+
412
435
method: The method used for fine-tuning.
413
436
414
437
seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -450,6 +473,7 @@ async def create(
450
473
"training_file" : training_file ,
451
474
"hyperparameters" : hyperparameters ,
452
475
"integrations" : integrations ,
476
+ "metadata" : metadata ,
453
477
"method" : method ,
454
478
"seed" : seed ,
455
479
"suffix" : suffix ,
@@ -503,6 +527,7 @@ def list(
503
527
* ,
504
528
after : str | NotGiven = NOT_GIVEN ,
505
529
limit : int | NotGiven = NOT_GIVEN ,
530
+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
506
531
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
507
532
# The extra values given here take precedence over values defined on the client or passed to this method.
508
533
extra_headers : Headers | None = None ,
@@ -518,6 +543,9 @@ def list(
518
543
519
544
limit: Number of fine-tuning jobs to retrieve.
520
545
546
+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
547
+ Alternatively, set `metadata=null` to indicate no metadata.
548
+
521
549
extra_headers: Send extra headers
522
550
523
551
extra_query: Add additional query parameters to the request
@@ -538,6 +566,7 @@ def list(
538
566
{
539
567
"after" : after ,
540
568
"limit" : limit ,
569
+ "metadata" : metadata ,
541
570
},
542
571
job_list_params .JobListParams ,
543
572
),
0 commit comments