File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -639,11 +639,21 @@ Must be a positive integer."
639639(defun eca-chat--rollback (session content-id )
640640 " Rollback chat messages for SESSION to before CONTENT-ID."
641641 (unless eca-chat--chat-loading
642- (when (y-or-n-p " Do you want to really rollback the chat to before this message?" )
643- (eca-api-request-sync session
644- :method " chat/rollback"
645- :params (list :chatId eca-chat--id
646- :contentId content-id)))))
642+ (let ((rollback-messages-str " Rollback only messages" )
643+ (rollback-tools-str " Rollback only changes done by tool calls" )
644+ (rollback-messages-and-tools-str " Rollback messages and changes done by tool calls" ))
645+ (when-let* ((rollback-type (completing-read " Select the rollback type:" (list rollback-messages-and-tools-str
646+ rollback-messages-str
647+ rollback-tools-str) nil t )))
648+ (let ((include (cond
649+ ((string= rollback-type rollback-messages-str) [" messages" ])
650+ ((string= rollback-type rollback-tools-str) [" tools" ])
651+ ((string= rollback-type rollback-messages-and-tools-str) [" messages" " tools" ]))))
652+ (eca-api-request-sync session
653+ :method " chat/rollback"
654+ :params (list :chatId eca-chat--id
655+ :contentId content-id
656+ :include include)))))))
647657
648658(defun eca-chat--set-chat-loading (session loading )
649659 " Set the SESSION chat to a loading state if LOADING is non nil.
You can’t perform that action at this time.
0 commit comments