]> git.giacomolli.uk - onechat/blobdiff - turn.go
Store the subagents and read them with zoom
[onechat] / turn.go
diff --git a/turn.go b/turn.go
index 051c74df822c2c95b4299e40327f5cf0cad304ee..84f788337e80a7ea79b21461337b62ca68c24141 100644 (file)
--- a/turn.go
+++ b/turn.go
@@ -8,9 +8,10 @@ import (
        "time"
 )
 
-// newTurnLoop returns the loop of agent with its memory. Its calls go through
-// client, and notify gets each event. The clock gives the date of a turn.
-func newTurnLoop(agent *Agent, memory *Memory, client ChainClient, clock func() time.Time, notify func(Event)) (*TurnLoop, error) {
+// newTurnLoop returns the loop of agent with its memory and its subagents. Its
+// calls go through client, and notify gets each event. The clock gives the date
+// of a turn.
+func newTurnLoop(agent *Agent, memory *Memory, subagents *Subagents, client ChainClient, clock func() time.Time, notify func(Event)) (*TurnLoop, error) {
        layout, err := loadViewLayout(filepath.Join(agent.dir, viewLayoutFileName))
        if err != nil {
                return nil, err
@@ -27,9 +28,10 @@ func newTurnLoop(agent *Agent, memory *Memory, client ChainClient, clock func()
        }
 
        l.tools = &Toolbox{
-               log:     l,
-               chat:    memory,
-               workdir: agent.config.Workdir,
+               log:       l,
+               chat:      memory,
+               subagents: subagents,
+               workdir:   agent.config.Workdir,
        }
 
        return l, nil