X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/6d96a69d33eb634f61f809001aca19ae57113180..1379d7d0d0173416237ddf8ebe820743d2cecfa6:/turn.go diff --git a/turn.go b/turn.go index 08a144e..c6a083b 100644 --- a/turn.go +++ b/turn.go @@ -17,7 +17,7 @@ var errTurnLogWrite = errors.New("log write failed") // 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 TurnClient, clock func() time.Time, notify func(Event)) (*TurnLoop, error) { - layout, err := loadLayout(filepath.Join(agent.dir, layoutFileName)) + layout, err := loadViewLayout(filepath.Join(agent.dir, viewLayoutFileName)) if err != nil { return nil, err } @@ -32,7 +32,7 @@ func newTurnLoop(agent *Agent, memory *Memory, client TurnClient, clock func() t wake: make(chan struct{}, 1), } - l.tools = &toolbox{ + l.tools = &Toolbox{ log: l, chat: memory, workdir: agent.config.Workdir, @@ -64,8 +64,8 @@ type Event struct { // of turnInput. The loop runs the tool calls of each response and sends their // results back, until a response has no tool call: the final answer. // -// The view goes out as the messages of a viewLayout, so the first request of -// a turn reads the view of the turn before from the prompt cache. +// The view goes out as the messages of a ViewLayout, so the first request of a +// turn reads the view of the turn before from the prompt cache. // // Each later request of a turn begins with the whole input of the request // before it, then its output items, then the tool results. The output items @@ -78,8 +78,8 @@ type TurnLoop struct { agent *Agent memory *Memory client TurnClient - tools *toolbox - layout *viewLayout + tools *Toolbox + layout *ViewLayout clock func() time.Time notify func(Event) wake chan struct{} @@ -261,7 +261,7 @@ func (l *TurnLoop) chain(ctx context.Context) error { Model: l.agent.config.Model, Effort: l.agent.config.Effort, Instructions: instructions, - Tools: agentTools(), + Tools: promptTools(), Input: input, Turn: turn, })