Generate Clojure functions on demand via the LLM, caching the generated source so each function is only generated once.
(defextend (update-packages []) "Update all outdated dependencies")
defines update-packages immediately, right there: the body is written by
the LLM on the spot, persisted to generated-file, and eval'd into
hyperphor.ellum.generated. On a later call to defextend with the same
name -- a re-eval of the same form, or a future process once
generated-file has loaded -- the cached definition is reused and the LLM
isn't consulted again.
Ported from claude-extend (mt-elisp), which shells out to the claude
CLI since Emacs has no LLM client of its own; here we just call
hyperphor.ellum.core/query directly.
Generate Clojure functions on demand via the LLM, caching the generated source so each function is only generated once. (defextend (update-packages []) "Update all outdated dependencies") defines `update-packages` immediately, right there: the body is written by the LLM on the spot, persisted to `generated-file`, and eval'd into `hyperphor.ellum.generated`. On a later call to `defextend` with the same name -- a re-eval of the same form, or a future process once `generated-file` has loaded -- the cached definition is reused and the LLM isn't consulted again. Ported from `claude-extend` (mt-elisp), which shells out to the `claude` CLI since Emacs has no LLM client of its own; here we just call `hyperphor.ellum.core/query` directly.
Model used to generate function bodies, or nil for the provider default.
Model used to generate function bodies, or nil for the provider default.
Provider used to generate function bodies.
Provider used to generate function bodies.
(defextend signature description)Define (name arglist) in hyperphor.ellum.generated, generating the body
via the LLM right now if it isn't already cached in generated-file. This
blocks on the API call. SIGNATURE is (name arglist) exactly as it would
appear after defn, e.g. (greet [name]). Returns the resulting var.
Define `(name arglist)` in `hyperphor.ellum.generated`, generating the body via the LLM right now if it isn't already cached in `generated-file`. This blocks on the API call. SIGNATURE is `(name arglist)` exactly as it would appear after `defn`, e.g. `(greet [name])`. Returns the resulting var.
(define! name arglist description)Generate and define NAME/ARGLIST per DESCRIPTION in hyperphor.ellum.generated,
unless already generated. Returns the resulting var.
Generate and define NAME/ARGLIST per DESCRIPTION in `hyperphor.ellum.generated`, unless already generated. Returns the resulting var.
File that accumulates functions generated by defextend.
File that accumulates functions generated by `defextend`.
Namespace that generated functions are defined in.
Namespace that generated functions are defined in.
(load-generated!)Load generated-file once per process, populating registry.
Restores the caller's *ns* afterward -- the file's own ns form would
otherwise leave the reader parked in hyperphor.ellum.generated.
Load `generated-file` once per process, populating `registry`. Restores the caller's `*ns*` afterward -- the file's own `ns` form would otherwise leave the reader parked in `hyperphor.ellum.generated`.
(regenerate! name)Discard the cached body of defextend function NAME and regenerate it.
Discard the cached body of defextend function NAME and regenerate it.
(register! name arglist description)Record NAME as defextend-generated with ARGLIST/DESCRIPTION.
Called both live after generation and from generated-file itself on load.
Record NAME as defextend-generated with ARGLIST/DESCRIPTION. Called both live after generation and from `generated-file` itself on load.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |