File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
src/openai/cli/_api/fine_tuning Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ def register(subparser: _SubParsersAction[ArgumentParser]) -> None:
44
44
sub .set_defaults (func = CLIFineTuningJobs .list , args_model = CLIFineTuningJobsListArgs )
45
45
46
46
sub = subparser .add_parser ("fine_tuning.jobs.cancel" )
47
+ sub .add_argument (
48
+ "-i" ,
49
+ "--id" ,
50
+ help = "The ID of the fine-tuning job to cancel." ,
51
+ required = True ,
52
+ )
53
+ sub .set_defaults (
54
+ func = CLIFineTuningJobs .cancel , args_model = CLIFineTuningJobsCancelArgs
55
+ )
56
+
47
57
sub = subparser .add_parser ("fine_tuning.jobs.list_events" )
48
58
49
59
@@ -54,6 +64,8 @@ class CLIFineTuningJobsListArgs(BaseModel):
54
64
after : NotGivenOr [str ] = NOT_GIVEN
55
65
limit : NotGivenOr [int ] = NOT_GIVEN
56
66
67
+ class CLIFineTuningJobsCancelArgs (BaseModel ):
68
+ id : str
57
69
58
70
class CLIFineTuningJobs :
59
71
@staticmethod
@@ -70,4 +82,11 @@ def list(args: CLIFineTuningJobsListArgs) -> None:
70
82
] = get_client ().fine_tuning .jobs .list (
71
83
after = args .after or NOT_GIVEN , limit = args .limit or NOT_GIVEN
72
84
)
73
- print_model (fine_tuning_jobs )
85
+ print_model (fine_tuning_jobs )
86
+
87
+ @staticmethod
88
+ def cancel (args : CLIFineTuningJobsCancelArgs ) -> None :
89
+ fine_tuning_job : FineTuningJob = get_client ().fine_tuning .jobs .cancel (
90
+ fine_tuning_job_id = args .id
91
+ )
92
+ print_model (fine_tuning_job )
You can’t perform that action at this time.
0 commit comments