PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.
This commit is contained in:
@@ -1,34 +1,22 @@
|
||||
;;;; config-logic.lisp --- Homoiconic configuration retrieval.
|
||||
;;;; This file is TANGLED from notes/environment-config.org. DO NOT EDIT MANUALLY.
|
||||
(in-package :org-agent)
|
||||
|
||||
(defpackage :org-skill-environment-config
|
||||
(:use :cl)
|
||||
(:export #:get-config-attribute
|
||||
#:get-tiered-model))
|
||||
(defun set-llm-model (provider model-id)
|
||||
"Registers a preferred model for a provider in the Object Store."
|
||||
(let ((config-id (format nil "config-llm-~a" (string-downcase (string provider)))))
|
||||
(let ((obj (make-org-object
|
||||
:id config-id
|
||||
:type :CONFIG
|
||||
:attributes `(:provider ,provider :model-id ,model-id)
|
||||
:content (format nil "Fleet preference for ~a set to ~a" provider model-id)
|
||||
:version (get-universal-time))))
|
||||
(setf (gethash config-id *object-store*) obj)
|
||||
(kernel-log "CONFIG - Fleet updated: ~a -> ~a" provider model-id)
|
||||
t)))
|
||||
|
||||
(in-package :org-skill-environment-config)
|
||||
|
||||
(defun get-config-attribute (property-key &optional default)
|
||||
"Searches the global *object-store* for any headline containing PROPERTY-KEY."
|
||||
;; Note: In a real environment, this would access the org-agent:*object-store*
|
||||
;; For the purpose of this skill implementation, we define the signature.
|
||||
(let ((store (and (boundp 'org-agent:*object-store*) org-agent:*object-store*)))
|
||||
(if store
|
||||
(maphash (lambda (id obj)
|
||||
(declare (ignore id))
|
||||
(when (eq (org-agent:org-object-type obj) :HEADLINE)
|
||||
(let ((val (getf (org-agent:org-object-attributes obj) property-key)))
|
||||
(when val
|
||||
(return-from get-config-attribute val)))))
|
||||
store)
|
||||
default))
|
||||
default)
|
||||
|
||||
(defun get-tiered-model (tier default-model)
|
||||
"Retrieves a model ID based on a tier keyword (:POWERFUL, :FAST, :FREE)."
|
||||
(let ((prop (case tier
|
||||
(:powerful :LLM_MODEL_POWERFUL)
|
||||
(:fast :LLM_MODEL_FAST)
|
||||
(:free :LLM_MODEL_FREE)
|
||||
(t :LLM_MODEL_TEXT))))
|
||||
(get-config-attribute prop default-model)))
|
||||
(defun get-llm-model (provider &optional default)
|
||||
"Retrieves the preferred model for a provider from the Object Store."
|
||||
(let* ((config-id (format nil "config-llm-~a" (string-downcase (string provider))))
|
||||
(obj (gethash config-id *object-store*)))
|
||||
(if obj
|
||||
(getf (org-object-attributes obj) :model-id)
|
||||
default)))
|
||||
|
||||
Reference in New Issue
Block a user