(project-folder-identifier)(project-folder-identifier project-dir)Builds a stable identifier for a project directory.
Builds a stable identifier for a project directory.
(prompt-send! {:keys [agent provider prompt] :as request})Sends a prompt request map through a provider.
Required request keys:
:agent:promptOptional request keys:
:provider to use for this call without mutating the connected provider:model, :temperature, :top-p,
:max-tokens, :stop, :tools, :tool-choice, :response-format,
:metadata, and similar fields:provider-step-limit to set an explicit positive loop cap; otherwise the
provider/tool loop is unlimited:request-modifier, :response-modifier, and :session-modifier:prompt may be:
Prompt entries may be strings, {:role ... :content ...} maps, or single-key
maps like {:system "..."} and {:user "..."}.
Returns:
:prompt is sequential: an atom containing the in-flight session mapSends a prompt request map through a provider.
Required request keys:
- `:agent`
- `:prompt`
Optional request keys:
- `:provider` to use for this call without mutating the connected provider
- provider request options like `:model`, `:temperature`, `:top-p`,
`:max-tokens`, `:stop`, `:tools`, `:tool-choice`, `:response-format`,
`:metadata`, and similar fields
- `:provider-step-limit` to set an explicit positive loop cap; otherwise the
provider/tool loop is unlimited
- `:request-modifier`, `:response-modifier`, and `:session-modifier`
`:prompt` may be:
- a string
- a single prompt map
- a sequential collection of prompt entries
Prompt entries may be strings, `{:role ... :content ...}` maps, or single-key
maps like `{:system "..."}` and `{:user "..."}`.
Returns:
- when `:prompt` is sequential: an atom containing the in-flight session map
- otherwise: the final provider response(provider-connect! agent provider-ref)(provider-connect! agent provider-name provider-ref)Connects the agent to a provider.
Supported forms:
[agent provider-ref][agent provider-name provider-ref]provider-ref may be:
:invoke function and optional :name, :kind,
:endpoint, :model, :request-modifier, :response-modifier, and
:session-modifierprovider-name overrides the inferred provider name when supplied.
Provider maps may also supply:
:request-modifier - function, var, or symbol called before each provider
invocation with {:agent ... :provider ... :provider-entry ... :request ... :session ... :step ...} and expected to return the request map that
should be sent:response-modifier - function, var, or symbol called after each provider
response with the same context plus :response, and expected to return the
response value that should continue through the loop:session-modifier - function, var, or symbol called with the live session
map and phase context, and expected to return the updated session mapConnects the agent to a provider.
Supported forms:
- `[agent provider-ref]`
- `[agent provider-name provider-ref]`
`provider-ref` may be:
- a provider map with an `:invoke` function and optional `:name`, `:kind`,
`:endpoint`, `:model`, `:request-modifier`, `:response-modifier`, and
`:session-modifier`
- a var, function, or resolvable symbol that yields such a provider map or a
plain callable
`provider-name` overrides the inferred provider name when supplied.
Provider maps may also supply:
- `:request-modifier` - function, var, or symbol called before each provider
invocation with `{:agent ... :provider ... :provider-entry ... :request
... :session ... :step ...}` and expected to return the request map that
should be sent
- `:response-modifier` - function, var, or symbol called after each provider
response with the same context plus `:response`, and expected to return the
response value that should continue through the loop
- `:session-modifier` - function, var, or symbol called with the live session
map and phase context, and expected to return the updated session map(provider-current agent)Returns the connected provider summary, if any.
Returns the connected provider summary, if any.
(provider-disconnect! agent)Disconnects the current provider and returns its summary when one was set.
Disconnects the current provider and returns its summary when one was set.
(session-read path)Reads a persisted session file as a session map.
Reads a persisted session file as a session map.
(sessions-directory agent)Returns the directory where this agent stores prompt sessions.
The path is derived from the agent's :sessions-root and :project-dir.
Returns the directory where this agent stores prompt sessions. The path is derived from the agent's `:sessions-root` and `:project-dir`.
(sessions-list agent)Lists persisted session files for an agent.
Lists persisted session files for an agent.
(sessions-root-default)Returns the default root directory for stored sessions.
Returns the default root directory for stored sessions.
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 |