Liking cljdoc? Tell your friends :D

repling.agent.session


project-folder-identifierclj

(project-folder-identifier)
(project-folder-identifier project-dir)

Builds a stable identifier for a project directory.

Builds a stable identifier for a project directory.
raw docstring

prompt-send!clj

(prompt-send! {:keys [agent provider prompt] :as request})
(prompt-send! agent request)

Sends a prompt to a provider. The one-arg map form returns a session atom and processes queued :user prompts on a virtual thread.

Supported forms:

  • [{:agent agent :provider provider-ref :prompt prompt-entry-or-entries ...}]
  • [agent request]

One-arg map form:

  • required :agent
  • optional :provider to use for this queued session without calling provider-connect!
  • required :prompt, which may be a string, a single prompt map, or a sequential collection of prompt entries
  • any additional keys are forwarded to each provider request turn, which is useful for provider options like :model, :temperature, :top-p, :max-tokens, :stop, :tools, :tool-choice, :response-format, :metadata, and similar request settings
  • for provider/provider-openai-compatible, the model sees a small tool surface centered on repling.agent.main/string-eval, while registered vars remain available inside the SCI runtime that tool evaluates against
  • tool call failures are returned to the provider/model as structured tool results so it can inspect the error and retry

Prompt entries may be strings, {:role ... :content ...} maps, or single-key maps like {:system "..."} and {:user "..."}.

Two-arg form:

  • request may be a string or a request map
  • request maps commonly use :prompt, optional :system, or explicit :messages, plus any provider-specific request keys
  • for provider/provider-openai-compatible, the model sees a small tool surface centered on repling.agent.main/string-eval, while registered vars remain available inside the SCI runtime that tool evaluates against
  • tool call failures are returned to the provider/model as structured tool results so it can inspect the error and retry

Returns:

  • one-arg map form: an atom containing the in-flight session vector
  • two-arg form: the final provider response
Sends a prompt to a provider. The one-arg map form returns a session atom and
processes queued `:user` prompts on a virtual thread.

Supported forms:
- `[{:agent agent :provider provider-ref :prompt prompt-entry-or-entries ...}]`
- `[agent request]`

One-arg map form:
- required `:agent`
- optional `:provider` to use for this queued session without calling
  `provider-connect!`
- required `:prompt`, which may be a string, a single prompt map, or a
  sequential collection of prompt entries
- any additional keys are forwarded to each provider request turn, which is
  useful for provider options like `:model`, `:temperature`, `:top-p`,
  `:max-tokens`, `:stop`, `:tools`, `:tool-choice`, `:response-format`,
  `:metadata`, and similar request settings
 - for `provider/provider-openai-compatible`, the model sees a small tool
   surface centered on `repling.agent.main/string-eval`, while registered
   vars remain available inside the SCI runtime that tool evaluates against
 - tool call failures are returned to the provider/model as structured tool
   results so it can inspect the error and retry

Prompt entries may be strings, `{:role ... :content ...}` maps, or single-key
maps like `{:system "..."}` and `{:user "..."}`.

Two-arg form:
- `request` may be a string or a request map
- request maps commonly use `:prompt`, optional `:system`, or explicit
  `:messages`, plus any provider-specific request keys
 - for `provider/provider-openai-compatible`, the model sees a small tool
   surface centered on `repling.agent.main/string-eval`, while registered
   vars remain available inside the SCI runtime that tool evaluates against
 - tool call failures are returned to the provider/model as structured tool
   results so it can inspect the error and retry

Returns:
- one-arg map form: an atom containing the in-flight session vector
- two-arg form: the final provider response
raw docstring

provider-connect!clj

(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:

  • a provider map with an :invoke function and optional :name, :kind, :endpoint, and :model
  • 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.

Connects 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`, and `:model`
- 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.
raw docstring

provider-currentclj

(provider-current agent)

Returns the connected provider summary, if any.

Returns the connected provider summary, if any.
raw docstring

provider-disconnect!clj

(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.
raw docstring

session-readclj

(session-read path)

Reads a persisted session file as a vector of messages.

Reads a persisted session file as a vector of messages.
raw docstring

sessions-directoryclj

(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`.
raw docstring

sessions-listclj

(sessions-list agent)

Lists persisted session files for an agent.

Lists persisted session files for an agent.
raw docstring

sessions-root-defaultclj

(sessions-root-default)

Returns the default root directory for stored sessions.

Returns the default root directory for stored sessions.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close