(defagent name graph entry-node node-map)
One-stop macro to define and run an agent To run the agent call (<name> graph entry-node nodemap)
One-stop macro to define and run an agent To run the agent call (<name> graph entry-node nodemap)
(defgraph name & edge-defs)
Create a loom digraph that can be run within the agent (edges + optional labels)
Create a loom digraph that can be run within the agent (edges + optional labels)
(defnode name args & body)
Define each node behavior get the current state and execut the body on the state The node function must always return a map with the values to be used in the future states Anything saved in the :completion key will be pushed into history. will be traversed to under the :next key The state in general is of the form {:key1 <output for node behavior> :key2 ... :history [[:node-name {:bosquet/completion....}]..] :trace [[:node1 :node2]...[:node-n :end]] ;the actual path taken by this agent run } Return any keys that you would like to return in the state that you want future nodes to use {:my-key 'some value returned by the llm or the result of a search' :completion 'the result of an llm call that will be added to history' }
Define each node behavior get the current state and execut the body on the state The node function must always return a map with the values to be used in the future states Anything saved in the :completion key will be pushed into history. will be traversed to under the :next key The state in general is of the form {:key1 <output for node behavior> :key2 ... :history [[:node-name {:bosquet/completion....}]..] :trace [[:node1 :node2]...[:node-n :end]] ;the actual path taken by this agent run } Return any keys that you would like to return in the state that you want future nodes to use {:my-key 'some value returned by the llm or the result of a search' :completion 'the result of an llm call that will be added to history' }
(resume-graph interrupted-result updated-state)
Resume graph execution after human intervention Takes the interrupted state and updated user input to continue execution
Resume graph execution after human intervention Takes the interrupted state and updated user input to continue execution
(run-graph graph-def
node-map
entry-node
{:keys [trace __pos history] :as input})
Graph executor run a digraph given
Graph executor run a digraph given - graph-def - a loom digraph, branch-conditions and functions to select branches {:graph <loom graph> :condition-maps <optional {:source-node {condition destination-node}..}> :condition-fns <optional {:source-node (fn[state] return values in condi}tion in the condtions map to branch on)}> } - a node-map mapping the nodes to behaviors - the entry node recording the history(completions) as it traverses the graph If a node returns {:interrupt true}, execution pauses and returns interrupt state
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 |