Update Chat API, Logs, Interfaces to store, use references as list

- Remove the need to split by magic string in emacs and chat interfaces
- Move compiling references into string as context for GPT to GPT layer
- Update setup in tests to use new style of setting references
- Name first argument to converse as more appropriate "references"
This commit is contained in:
Debanjum Singh Solanky
2023-03-24 21:55:22 +07:00
parent b08745b541
commit 508b2176b7
6 changed files with 91 additions and 86 deletions

View File

@@ -443,9 +443,8 @@ RECEIVE-DATE is the message receive date."
(let* ((message (cdr (or (assoc 'response json-response) (assoc 'message json-response))))
(sender (cdr (assoc 'by json-response)))
(receive-date (cdr (assoc 'created json-response)))
(context (or (cdr (assoc 'context json-response)) ""))
(reference-source-texts (split-string context "\n\n# " t))
(footnotes (mapcar #'khoj--generate-reference reference-source-texts))
(references (or (cdr (assoc 'context json-response)) '()))
(footnotes (mapcar #'khoj--generate-reference references))
(footnote-links (mapcar #'car footnotes))
(footnote-defs (mapcar #'cdr footnotes)))
(thread-first