X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/0da1ef837bbd190cc5787214187d1b29d62b9410..d008b46cbfc6348255e9b9a1fc009f0e4bd6aa2a:/turn.go diff --git a/turn.go b/turn.go index e304714..837ac7c 100644 --- a/turn.go +++ b/turn.go @@ -9,10 +9,10 @@ import ( "time" ) -// 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) { +// newTurnLoop returns the loop of agent with its memory, its subagents, and the +// WhatsApp link and the schedules of its tools. 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, whatsapp *WhatsApp, schedules *Schedules, 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 @@ -47,6 +47,8 @@ func newTurnLoop(agent *Agent, memory *Memory, subagents *Subagents, client Chai chat: memory, subagents: subagents, runs: l.runs, + whatsapp: whatsapp, + schedules: schedules, workdir: agent.config.Workdir, }