@@ -9,8 +9,8 @@ use crate::error::CodexError;
99use crate :: transport:: CodexTransport ;
1010use crate :: types:: {
1111 Capabilities , ClientInfo , InitializeParams , InputItem , JsonRpcNotification , ThreadForkParams ,
12- ThreadResumeParams , ThreadStartParams , TurnInterruptParams , TurnStartParams , TurnSteerParams ,
13- extract_thread_id, extract_turn_id,
12+ ThreadResumeParams , ThreadStartParams , TurnInterruptParams , TurnStartOptions , TurnStartParams ,
13+ TurnSteerParams , extract_thread_id, extract_turn_id,
1414} ;
1515
1616// ---------------------------------------------------------------------------
@@ -173,12 +173,26 @@ impl CodexClient {
173173 & self ,
174174 thread_id : & str ,
175175 input : Vec < InputItem > ,
176+ ) -> Result < String , CodexError > {
177+ self . start_turn_with_options ( thread_id, input, TurnStartOptions :: default ( ) )
178+ . await
179+ }
180+
181+ /// Start a turn with optional sticky execution settings.
182+ pub async fn start_turn_with_options (
183+ & self ,
184+ thread_id : & str ,
185+ input : Vec < InputItem > ,
186+ options : TurnStartOptions ,
176187 ) -> Result < String , CodexError > {
177188 self . require_initialized ( ) ?;
178189
179190 let params = TurnStartParams {
180191 thread_id : thread_id. to_owned ( ) ,
181192 input,
193+ model : options. model ,
194+ effort : options. effort ,
195+ service_tier : options. service_tier ,
182196 } ;
183197 let value = serde_json:: to_value ( & params)
184198 . map_err ( |e| CodexError :: Fatal ( format ! ( "serialize error: {e}" ) ) ) ?;
0 commit comments