ARCH: Clean Core Refactor & Terminology Alignment
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
(let ((active-skill (find-triggered-skill context)))
|
||||
(if active-skill
|
||||
(progn
|
||||
(kernel-log "SYSTEM 1: Engaging skill '~a'~%" (skill-name active-skill))
|
||||
(kernel-log "PROBABILISTIC ENGINE: Engaging skill '~a'~%" (skill-name active-skill))
|
||||
(let* ((prompt-generator (skill-neuro-prompt active-skill))
|
||||
(prompt (when prompt-generator (funcall prompt-generator context))))
|
||||
(if prompt
|
||||
@@ -17,17 +17,17 @@
|
||||
(if (and regs (> (length regs) 0)) (elt regs 0) thought))
|
||||
(string-trim '(#\Space #\Newline #\Tab) thought))))
|
||||
(suggestion (ignore-errors (read-from-string cleaned-thought))))
|
||||
(kernel-log "SYSTEM 1 Suggestion: ~a~%" cleaned-thought)
|
||||
(kernel-log "PROBABILISTIC ENGINE Suggestion: ~a~%" cleaned-thought)
|
||||
(cond
|
||||
((and suggestion (listp suggestion)) suggestion)
|
||||
;; SALVAGE: If LLM returned plain text or a non-list symbol
|
||||
((and (let ((p (getf context :payload))) (eq (getf p :sensor) :chat-message))
|
||||
(> (length cleaned-thought) 0))
|
||||
(kernel-log "SYSTEM 1: SALVAGING plain-text response.~%")
|
||||
(kernel-log "PROBABILISTIC ENGINE: SALVAGING plain-text response.~%")
|
||||
(let* ((no-prefix (cl-ppcre:regex-replace "(?i)^(okay,? |sure,? |i will |i've |i have |here is |got it\\.? |understood\\.? |done\\.? |yes,? )+" cleaned-thought "")))
|
||||
`(:target :emacs :payload (:action :insert-at-end :buffer "*org-agent-chat*" :text ,no-prefix))))
|
||||
(t
|
||||
(kernel-log "SYSTEM 1 ERROR: Could not parse response as Lisp plist.~%")
|
||||
(kernel-log "PROBABILISTIC ENGINE ERROR: Could not parse response as Lisp plist.~%")
|
||||
nil)))
|
||||
nil)))
|
||||
nil)))
|
||||
|
||||
Reference in New Issue
Block a user