Liking cljdoc? Tell your friends :D

repling.clj-agent.main


agent-makeclj

(agent-make)
(agent-make initial-tools)
(agent-make initial-tools
            {:keys [project-dir sessions-root]
             :or {project-dir "."
                  sessions-root (session/sessions-root-default)}})

Creates a tiny agent that stores callable tools and exposes them through SCI.

Supported forms:

  • []
  • [initial-tools]
  • [initial-tools opts]

opts accepts:

  • :project-dir - directory used to derive the stable session storage id. Defaults to .
  • :sessions-root - root directory where persisted sessions are stored. Defaults to (session/sessions-root-default)
Creates a tiny agent that stores callable tools and exposes them through SCI.

Supported forms:
- `[]`
- `[initial-tools]`
- `[initial-tools opts]`

`opts` accepts:
- `:project-dir` - directory used to derive the stable session storage id.
  Defaults to `.`
- `:sessions-root` - root directory where persisted sessions are stored.
  Defaults to `(session/sessions-root-default)`
raw docstring

string-evalclj

(string-eval agent code)

Evaluates code in an SCI runtime where registered tools are directly callable.

code must be a string.

Evaluates code in an SCI runtime where registered tools are directly callable.

`code` must be a string.
raw docstring

tool-lookupclj

(tool-lookup agent tool-ref)

Finds a registered tool by handle or by name.

tool-ref may be a registered var, function, Java Method, symbol, keyword, or string.

Returns tool metadata including fields like :doc, :arglists, :symbol, and :method when available.

Finds a registered tool by handle or by name.

`tool-ref` may be a registered var, function, Java `Method`, symbol, keyword,
or string.

Returns tool metadata including fields like `:doc`, `:arglists`, `:symbol`,
and `:method` when available.
raw docstring

tool-register!clj

(tool-register! agent tool-ref)
(tool-register! agent tool-name-or-class tool-ref-or-method-name)
(tool-register! agent tool-name class-ref method-name)

Registers a tool backed by a var, function, or Java method.

Supported forms:

  • [agent tool-ref]
  • [agent tool-name tool-ref]
  • [agent class-ref method-name]
  • [agent tool-name class-ref method-name]

tool-name may be a string, keyword, or symbol. tool-ref may be a var, function, Java Method, or resolvable symbol.

Registers a tool backed by a var, function, or Java method.

Supported forms:
- `[agent tool-ref]`
- `[agent tool-name tool-ref]`
- `[agent class-ref method-name]`
- `[agent tool-name class-ref method-name]`

`tool-name` may be a string, keyword, or symbol. `tool-ref` may be a var,
function, Java `Method`, or resolvable symbol.
raw docstring

tool-unregister!clj

(tool-unregister! agent tool-ref)
(tool-unregister! agent class-ref method-name)

Removes a registered tool.

Supported forms:

  • [agent tool-ref]
  • [agent class-ref method-name]

tool-ref may be the original handle used during registration or the registered tool name as a string, keyword, or symbol.

Removes a registered tool.

Supported forms:
- `[agent tool-ref]`
- `[agent class-ref method-name]`

`tool-ref` may be the original handle used during registration or the
registered tool name as a string, keyword, or symbol.
raw docstring

tools-listclj

(tools-list agent)

Returns the registered tool metadata, sorted by tool name.

Returns the registered tool metadata, sorted by tool name.
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