File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/together/lib/cli/api/fine_tuning Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 55from rich .json import JSON
66
77from together import Together
8+ from together ._utils ._json import openapi_dumps
89from together .lib .cli .api ._utils import handle_api_errors , generate_progress_bar
910from together .lib .utils .serializer import datetime_serializer
1011
1112
1213@click .command ()
1314@click .pass_context
1415@click .argument ("fine_tune_id" , type = str , required = True )
16+ @click .option ("--json" , is_flag = True , help = "Output the response in JSON format" )
1517@handle_api_errors ("Fine-tuning" )
16- def retrieve (ctx : click .Context , fine_tune_id : str ) -> None :
18+ def retrieve (ctx : click .Context , fine_tune_id : str , json : bool ) -> None :
1719 """Retrieve fine-tuning job details"""
1820 client : Together = ctx .obj
1921
2022 response = client .fine_tuning .retrieve (fine_tune_id )
2123
24+ if json :
25+ click .echo (openapi_dumps (response .model_dump (exclude_none = True )))
26+ return
27+
2228 # remove events from response for cleaner output
2329 response .events = None
2430
You can’t perform that action at this time.
0 commit comments