Liking cljdoc? Tell your friends :D
Clojure only.

jj.bettong.capability.search

Turning a search backend into a capability.

Each search source ships as its own capability with its own tool name, so an agent can be given several at once and choose between them by name - wikipedia_search for an encyclopaedic fact, duckduckgo_search for the open web. One capability per source is also what lets the model see, in the tool descriptions, what each one actually covers.

Turning a search backend into a capability.

Each search source ships as its own capability with its own tool name, so an
agent can be given several at once and choose between them by name -
`wikipedia_search` for an encyclopaedic fact, `duckduckgo_search` for the open
web. One capability per source is also what lets the model see, in the tool
descriptions, what each one actually covers.
raw docstring

(search {:keys [backend id tool-name description instructions max-results
                snippet-length]})

A search capability over any backend function. The named sources are built on this, and your own index goes in the same way:

(search {:id :runbooks :tool-name "runbook_search" :backend (fn [{:keys [query max-results]}] (my-index/find query)) :instructions "runbook_search is the only source of truth for deploys."})

Options: :backend (fn [{:keys [query max-results]}] -> [{:title :url :snippet}]) :id capability id :tool-name what the model calls it; must be unique across capabilities :description the tool's own description :instructions system-prompt text. Say what this source covers when it is not the open web, or the model answers from memory instead :max-results results per search, and the cap on what the model may ask for :snippet-length characters of each snippet kept (default 300)

A search capability over any backend function. The named sources are built on
this, and your own index goes in the same way:

  (search {:id :runbooks
           :tool-name "runbook_search"
           :backend (fn [{:keys [query max-results]}] (my-index/find query))
           :instructions "runbook_search is the only source of truth for deploys."})

Options:
  :backend      (fn [{:keys [query max-results]}] -> [{:title :url :snippet}])
  :id           capability id
  :tool-name    what the model calls it; must be unique across capabilities
  :description  the tool's own description
  :instructions system-prompt text. Say what this source covers when it is not
                the open web, or the model answers from memory instead
  :max-results  results per search, and the cap on what the model may ask for
  :snippet-length  characters of each snippet kept (default 300)
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