mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 05:39:11 +00:00
Fix khoj server config update in khoj.el by unquoting list to cl-push to
- cl-push expects a generatlized variable. Else throws (setf quote) undefined warning - This results in the config call failing on calling khoj entrypoint
This commit is contained in:
@@ -391,7 +391,7 @@ CONFIG is json obtained from Khoj config API."
|
||||
(compressed-jsonl . ,(format "%s/org.jsonl.gz" default-index-dir))
|
||||
(embeddings-file . ,(format "%s/org.pt" default-index-dir))
|
||||
(index-heading-entries . ,json-false)))))
|
||||
'config))
|
||||
config))
|
||||
|
||||
;; Else if khoj config has no org content config
|
||||
((not (alist-get 'org (alist-get 'content-type config)))
|
||||
@@ -403,9 +403,9 @@ CONFIG is json obtained from Khoj config API."
|
||||
(compressed-jsonl . ,(format "%s/org.jsonl.gz" default-index-dir))
|
||||
(embeddings-file . ,(format "%s/org.pt" default-index-dir))
|
||||
(index-heading-entries . ,json-false)))
|
||||
'new-content-type)
|
||||
new-content-type)
|
||||
(setq config (delq (assoc 'content-type config) config))
|
||||
(cl-pushnew `(content-type . ,new-content-type) 'config)))
|
||||
(cl-pushnew `(content-type . ,new-content-type) config)))
|
||||
|
||||
;; Else if khoj is not configured to index specified org files
|
||||
((not (and (equal (alist-get 'input-files (alist-get 'org (alist-get 'content-type config))) khoj-org-files)
|
||||
@@ -419,9 +419,9 @@ CONFIG is json obtained from Khoj config API."
|
||||
(compressed-jsonl . ,(format "%s/org.jsonl.gz" index-directory))
|
||||
(embeddings-file . ,(format "%s/org.pt" index-directory))
|
||||
(index-heading-entries . ,json-false)))
|
||||
'new-content-type)
|
||||
new-content-type)
|
||||
(setq config (delq (assoc 'content-type config) config))
|
||||
(cl-pushnew `(content-type . ,new-content-type) 'config))))
|
||||
(cl-pushnew `(content-type . ,new-content-type) config))))
|
||||
|
||||
;; Configure processors
|
||||
(cond
|
||||
@@ -434,7 +434,7 @@ CONFIG is json obtained from Khoj config API."
|
||||
(cl-pushnew `(processor . ((conversation . ((conversation-logfile . ,(format "%s/conversation.json" default-chat-dir))
|
||||
(model . ,default-model)
|
||||
(openai-api-key . ,khoj-openai-api-key)))))
|
||||
'config))
|
||||
config))
|
||||
|
||||
((not (alist-get 'conversation (alist-get 'processor config)))
|
||||
(message "khoj.el: Chat not configured yet.")
|
||||
@@ -443,9 +443,9 @@ CONFIG is json obtained from Khoj config API."
|
||||
(cl-pushnew `(conversation . ((conversation-logfile . ,(format "%s/conversation.json" default-chat-dir))
|
||||
(model . ,default-model)
|
||||
(openai-api-key . ,khoj-openai-api-key)))
|
||||
'new-processor-type)
|
||||
new-processor-type)
|
||||
(setq config (delq (assoc 'processor config) config))
|
||||
(cl-pushnew `(processor . ,new-processor-type) 'config)))
|
||||
(cl-pushnew `(processor . ,new-processor-type) config)))
|
||||
|
||||
;; Else if khoj is not configured with specified openai api key
|
||||
((not (equal (alist-get 'openai-api-key (alist-get 'conversation (alist-get 'processor config))) khoj-openai-api-key))
|
||||
@@ -457,9 +457,9 @@ CONFIG is json obtained from Khoj config API."
|
||||
(cl-pushnew `(conversation . ((conversation-logfile . ,(format "%s/conversation.json" chat-directory))
|
||||
(model . ,model-name)
|
||||
(openai-api-key . ,khoj-openai-api-key)))
|
||||
'new-processor-type)
|
||||
new-processor-type)
|
||||
(setq config (delq (assoc 'processor config) config))
|
||||
(cl-pushnew `(processor . ,new-processor-type) 'config))))
|
||||
(cl-pushnew `(processor . ,new-processor-type) config))))
|
||||
|
||||
;; Update server with latest configuration, if required
|
||||
(cond ((not current-config)
|
||||
|
||||
Reference in New Issue
Block a user