Skip to content

Commit

Permalink
Merge pull request #124 from s-kostyaev/fix-new-session-context
Browse files Browse the repository at this point in the history
Copy context from previous session on creating new session
  • Loading branch information
s-kostyaev authored Jun 9, 2024
2 parents 361e1aa + 1e26313 commit e527fdb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ellama.el
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,16 @@ If EPHEMERAL non nil new session will not be associated with any file."
(file-name-concat
ellama-sessions-directory
(concat id "." (ellama-get-session-file-extension)))))
(previous-session
(when ellama--current-session-id
(with-current-buffer
(ellama-get-session-buffer ellama--current-session-id)
ellama--current-session)))
(session (make-ellama-session
:id id :provider provider :file file-name :context ellama--new-session-context))
:id id :provider provider :file file-name
:context (if previous-session
(ellama-session-context previous-session)
ellama--new-session-context)))
(buffer (if file-name
(progn
(make-directory ellama-sessions-directory t)
Expand Down

0 comments on commit e527fdb

Please sign in to comment.