@@ -6,36 +6,40 @@ use serde_json::json;
66pub async fn new_session (
77 client : & HttpClient ,
88 output_format : OutputFormat ,
9+ compact : bool ,
910) -> Result < ( ) > {
1011 let response: serde_json:: Value = client. post ( "/api/v1/sessions" , & json ! ( { } ) ) . await ?;
11- output_success ( & response, output_format, false ) ;
12+ output_success ( & response, output_format, compact ) ;
1213 Ok ( ( ) )
1314}
1415
1516pub async fn list_sessions (
1617 client : & HttpClient ,
1718 output_format : OutputFormat ,
19+ compact : bool ,
1820) -> Result < ( ) > {
1921 let response: serde_json:: Value = client. get ( "/api/v1/sessions" , & [ ] ) . await ?;
20- output_success ( & response, output_format, false ) ;
22+ output_success ( & response, output_format, compact ) ;
2123 Ok ( ( ) )
2224}
2325
2426pub async fn get_session (
2527 client : & HttpClient ,
2628 session_id : & str ,
2729 output_format : OutputFormat ,
30+ compact : bool ,
2831) -> Result < ( ) > {
2932 let path = format ! ( "/api/v1/sessions/{}" , url_encode( session_id) ) ;
3033 let response: serde_json:: Value = client. get ( & path, & [ ] ) . await ?;
31- output_success ( & response, output_format, false ) ;
34+ output_success ( & response, output_format, compact ) ;
3235 Ok ( ( ) )
3336}
3437
3538pub async fn delete_session (
3639 client : & HttpClient ,
3740 session_id : & str ,
3841 output_format : OutputFormat ,
42+ compact : bool ,
3943) -> Result < ( ) > {
4044 let path = format ! ( "/api/v1/sessions/{}" , url_encode( session_id) ) ;
4145 let response: serde_json:: Value = client. delete ( & path, & [ ] ) . await ?;
@@ -47,7 +51,7 @@ pub async fn delete_session(
4751 response
4852 } ;
4953
50- output_success ( & result, output_format, false ) ;
54+ output_success ( & result, output_format, compact ) ;
5155 Ok ( ( ) )
5256}
5357
@@ -57,6 +61,7 @@ pub async fn add_message(
5761 role : & str ,
5862 content : & str ,
5963 output_format : OutputFormat ,
64+ compact : bool ,
6065) -> Result < ( ) > {
6166 let path = format ! ( "/api/v1/sessions/{}/messages" , url_encode( session_id) ) ;
6267 let body = json ! ( {
@@ -65,18 +70,19 @@ pub async fn add_message(
6570 } ) ;
6671
6772 let response: serde_json:: Value = client. post ( & path, & body) . await ?;
68- output_success ( & response, output_format, false ) ;
73+ output_success ( & response, output_format, compact ) ;
6974 Ok ( ( ) )
7075}
7176
7277pub async fn commit_session (
7378 client : & HttpClient ,
7479 session_id : & str ,
7580 output_format : OutputFormat ,
81+ compact : bool ,
7682) -> Result < ( ) > {
7783 let path = format ! ( "/api/v1/sessions/{}/commit" , url_encode( session_id) ) ;
7884 let response: serde_json:: Value = client. post ( & path, & json ! ( { } ) ) . await ?;
79- output_success ( & response, output_format, false ) ;
85+ output_success ( & response, output_format, compact ) ;
8086 Ok ( ( ) )
8187}
8288
0 commit comments