Skip to content

Commit

Permalink
Merge pull request #119 from s-kostyaev/fix-chat-with-special-provider
Browse files Browse the repository at this point in the history
Begin new session if ellama-chat called with another provider
  • Loading branch information
s-kostyaev committed May 29, 2024
2 parents fddc102 + c82530a commit b831191
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ellama.el
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,15 @@ ARGS contains keys for fine control.
ellama-provider)))
(session (if (or create-session
current-prefix-arg
(and provider
(or (plist-get args :provider)
(not (equal provider ellama-provider)))
ellama--current-session-id
(with-current-buffer (ellama-get-session-buffer
ellama--current-session-id)
(not (equal
provider
(ellama-session-provider ellama--current-session)))))
(and (not ellama--current-session)
(not ellama--current-session-id)))
(ellama-new-session provider prompt)
Expand Down

0 comments on commit b831191

Please sign in to comment.