22
33from __future__ import annotations
44
5- from typing import Union , Iterable , Optional
5+ from typing import Dict , Union , Iterable , Optional
66from typing_extensions import Literal
77
88import httpx
3030 make_request_options ,
3131)
3232from ....types .fine_tuning import job_list_params , job_create_params , job_list_events_params
33+ from ....types .shared_params .metadata import Metadata
3334from ....types .fine_tuning .fine_tuning_job import FineTuningJob
3435from ....types .fine_tuning .fine_tuning_job_event import FineTuningJobEvent
3536
@@ -67,6 +68,7 @@ def create(
6768 training_file : str ,
6869 hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
6970 integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
71+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
7072 method : job_create_params .Method | NotGiven = NOT_GIVEN ,
7173 seed : Optional [int ] | NotGiven = NOT_GIVEN ,
7274 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -114,6 +116,13 @@ def create(
114116
115117 integrations: A list of integrations to enable for your fine-tuning job.
116118
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+
117126 method: The method used for fine-tuning.
118127
119128 seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -155,6 +164,7 @@ def create(
155164 "training_file" : training_file ,
156165 "hyperparameters" : hyperparameters ,
157166 "integrations" : integrations ,
167+ "metadata" : metadata ,
158168 "method" : method ,
159169 "seed" : seed ,
160170 "suffix" : suffix ,
@@ -208,6 +218,7 @@ def list(
208218 * ,
209219 after : str | NotGiven = NOT_GIVEN ,
210220 limit : int | NotGiven = NOT_GIVEN ,
221+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
211222 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
212223 # The extra values given here take precedence over values defined on the client or passed to this method.
213224 extra_headers : Headers | None = None ,
@@ -223,6 +234,9 @@ def list(
223234
224235 limit: Number of fine-tuning jobs to retrieve.
225236
237+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
238+ Alternatively, set `metadata=null` to indicate no metadata.
239+
226240 extra_headers: Send extra headers
227241
228242 extra_query: Add additional query parameters to the request
@@ -243,6 +257,7 @@ def list(
243257 {
244258 "after" : after ,
245259 "limit" : limit ,
260+ "metadata" : metadata ,
246261 },
247262 job_list_params .JobListParams ,
248263 ),
@@ -365,6 +380,7 @@ async def create(
365380 training_file : str ,
366381 hyperparameters : job_create_params .Hyperparameters | NotGiven = NOT_GIVEN ,
367382 integrations : Optional [Iterable [job_create_params .Integration ]] | NotGiven = NOT_GIVEN ,
383+ metadata : Optional [Metadata ] | NotGiven = NOT_GIVEN ,
368384 method : job_create_params .Method | NotGiven = NOT_GIVEN ,
369385 seed : Optional [int ] | NotGiven = NOT_GIVEN ,
370386 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -412,6 +428,13 @@ async def create(
412428
413429 integrations: A list of integrations to enable for your fine-tuning job.
414430
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+
415438 method: The method used for fine-tuning.
416439
417440 seed: The seed controls the reproducibility of the job. Passing in the same seed and
@@ -453,6 +476,7 @@ async def create(
453476 "training_file" : training_file ,
454477 "hyperparameters" : hyperparameters ,
455478 "integrations" : integrations ,
479+ "metadata" : metadata ,
456480 "method" : method ,
457481 "seed" : seed ,
458482 "suffix" : suffix ,
@@ -506,6 +530,7 @@ def list(
506530 * ,
507531 after : str | NotGiven = NOT_GIVEN ,
508532 limit : int | NotGiven = NOT_GIVEN ,
533+ metadata : Optional [Dict [str , str ]] | NotGiven = NOT_GIVEN ,
509534 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
510535 # The extra values given here take precedence over values defined on the client or passed to this method.
511536 extra_headers : Headers | None = None ,
@@ -521,6 +546,9 @@ def list(
521546
522547 limit: Number of fine-tuning jobs to retrieve.
523548
549+ metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
550+ Alternatively, set `metadata=null` to indicate no metadata.
551+
524552 extra_headers: Send extra headers
525553
526554 extra_query: Add additional query parameters to the request
@@ -541,6 +569,7 @@ def list(
541569 {
542570 "after" : after ,
543571 "limit" : limit ,
572+ "metadata" : metadata ,
544573 },
545574 job_list_params .JobListParams ,
546575 ),
0 commit comments