refactor: moved org-agent to its own repository as a submodule
This commit is contained in:
37
notes/skill-provider-ollama.org
Normal file
37
notes/skill-provider-ollama.org
Normal file
@@ -0,0 +1,37 @@
|
||||
#+TITLE - Ollama Provider Skill (Local)
|
||||
#+AUTHOR - org-agent
|
||||
#+SKILL_NAME - skill-provider-ollama
|
||||
|
||||
This skill registers a local Ollama instance as a pluggable System 1 backend.
|
||||
|
||||
* Backend Implementation
|
||||
#+begin_src lisp
|
||||
(defun execute-ollama-request (prompt system-prompt)
|
||||
"Executes a completion request via local Ollama."
|
||||
(let* ((url "http://host.docker.internal:11434/api/generate")
|
||||
(body (cl-json:encode-json-to-string
|
||||
`((model . "llama3")
|
||||
(system . ,system-prompt)
|
||||
(prompt . ,prompt)
|
||||
(stream . nil)))))
|
||||
(handler-case
|
||||
(let* ((response (dex:post url
|
||||
:headers '(("Content-Type" . "application/json"))
|
||||
:content body))
|
||||
(json (cl-json:decode-json-from-string response)))
|
||||
(cdr (assoc :response json)))
|
||||
(error (c)
|
||||
(format nil "(:type :LOG :payload (:text \"Ollama Failure - ~a\"))" c)))))
|
||||
|
||||
;; Register the backend
|
||||
(org-agent:register-neuro-backend :ollama #'execute-ollama-request)
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-ollama
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user