@@ -792,25 +792,24 @@ func (s *Session) Abort(ctx context.Context) error {
792792// SetModelOptions configures optional parameters for SetModel.
793793type SetModelOptions struct {
794794 // ReasoningEffort sets the reasoning effort level for the new model (e.g., "low", "medium", "high", "xhigh").
795- ReasoningEffort string
795+ ReasoningEffort * string
796796}
797797
798798// SetModel changes the model for this session.
799799// The new model takes effect for the next message. Conversation history is preserved.
800800//
801801// Example:
802802//
803- // if err := session.SetModel(context.Background(), "gpt-4.1"); err != nil {
803+ // if err := session.SetModel(context.Background(), "gpt-4.1", nil ); err != nil {
804804// log.Printf("Failed to set model: %v", err)
805805// }
806- // if err := session.SetModel(context.Background(), "claude-sonnet-4.6", SetModelOptions{ReasoningEffort: "high"}); err != nil {
806+ // if err := session.SetModel(context.Background(), "claude-sonnet-4.6", & SetModelOptions{ReasoningEffort: new( "high") }); err != nil {
807807// log.Printf("Failed to set model: %v", err)
808808// }
809- func (s * Session ) SetModel (ctx context.Context , model string , opts ... SetModelOptions ) error {
809+ func (s * Session ) SetModel (ctx context.Context , model string , opts * SetModelOptions ) error {
810810 params := & rpc.SessionModelSwitchToParams {ModelID : model }
811- if len (opts ) > 0 && opts [0 ].ReasoningEffort != "" {
812- re := opts [0 ].ReasoningEffort
813- params .ReasoningEffort = & re
811+ if opts != nil {
812+ params .ReasoningEffort = opts .ReasoningEffort
814813 }
815814 _ , err := s .RPC .Model .SwitchTo (ctx , params )
816815 if err != nil {
0 commit comments