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})

Sends 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
Sends 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
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, :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
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`, `: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
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 session map.

Reads a persisted session file as a session map.
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