From 715d56d4f0989d91f500ce45dbf20c1db8471526 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 26 Jul 2023 17:34:16 -0700 Subject: [PATCH] Use new schema to update khoj.yml config from khoj.el --- src/interface/emacs/khoj.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index f8620ace..70d50b16 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -439,11 +439,8 @@ CONFIG is json obtained from Khoj config API." (message "khoj.el: Chat not configured yet.") (setq config (delq (assoc 'processor config) config)) (cl-pushnew `(processor . ((conversation . ((conversation-logfile . ,(format "%s/conversation.json" default-chat-dir)) - (openai . ( - (chat-model . ,chat-model) - (api-key . ,khoj-openai-api-key) - )) - )))) + (openai . ((chat-model . ,chat-model) + (api-key . ,khoj-openai-api-key))))))) config)) ((not (alist-get 'conversation (alist-get 'processor config))) @@ -451,8 +448,8 @@ CONFIG is json obtained from Khoj config API." (let ((new-processor-type (alist-get 'processor config))) (setq new-processor-type (delq (assoc 'conversation new-processor-type) new-processor-type)) (cl-pushnew `(conversation . ((conversation-logfile . ,(format "%s/conversation.json" default-chat-dir)) - (chat-model . ,chat-model) - (openai-api-key . ,khoj-openai-api-key))) + (openai . ((chat-model . ,chat-model) + (api-key . ,khoj-openai-api-key))))) new-processor-type) (setq config (delq (assoc 'processor config) config)) (cl-pushnew `(processor . ,new-processor-type) config))) @@ -465,8 +462,8 @@ CONFIG is json obtained from Khoj config API." (new-processor-type (alist-get 'processor config))) (setq new-processor-type (delq (assoc 'conversation new-processor-type) new-processor-type)) (cl-pushnew `(conversation . ((conversation-logfile . ,(format "%s/conversation.json" chat-directory)) - (chat-model . ,khoj-chat-model) - (openai-api-key . ,khoj-openai-api-key))) + (openai . ((chat-model . ,khoj-chat-model) + (api-key . ,khoj-openai-api-key))))) new-processor-type) (setq config (delq (assoc 'processor config) config)) (cl-pushnew `(processor . ,new-processor-type) config))))